<commit_before># Wraps jQuery's ajax request into a ruby class.
#
#     HTTP.get("/users/1.json") do |response|
#       puts "Got response!"
#     end
#
class HTTP
  attr_reader :body
  attr_reader :error_message
  attr_reader :method
  attr_reader :status_code
  attr_reader :url

  def self.get(url, opts={}, &block)
    self.new(url, :GET, opts, block).send!
  end

  def self.post(url, opts={}, &block)
    self.new(url, :POST, opts, block).send!
  end

  def initialize(url, method, options, handler=nil)
    @url     = url<commit_msg>Add HTTP.put() method as a shortcut for :PUT requests<commit_after># Wraps jQuery's ajax request into a ruby class.
#
#     HTTP.get("/users/1.json") do |response|
#       puts "Got response!"
#     end
#
class HTTP
  attr_reader :body
  attr_reader :error_message
  attr_reader :method
  attr_reader :status_code
  attr_reader :url

  def self.get(url, opts={}, &block)
    self.new(url, :GET, opts, block).send!
  end

  def self.post(url, opts={}, &block)
    self.new(url, :POST, opts, block).send!
  end

  def self.put(url, opts={}, &block)
    self.new(url, :PUT, opts, block).send!
  end

  def initialize(url, method, options, handler=nil)
    @url     = url
{'fraction_non_alphanumeric': 0.1391880695940348, 'fraction_numerical': 0.0016570008285004142, 'mean_word_length': 3.3927272727272726, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7577873', 'n_tokens_mistral': 440, 'n_tokens_neox': 425, 'n_words': 122}