<commit_before>require 'net/http'
require 'net/https'
require 'addressable/uri'

require 'pathname'
require Pathname(__FILE__).dirname + 'header'

module Addressable
  class URI
    def absolute_path
      absolute_path = ""
      absolute_path << self.path.to_s
      absolute_path << "?#{self.query}" if self.query != nil
      absolute_path << "##{self.fragment}" if self.fragment != nil
      return absolute_path
    end
  end
end

module Resourceful

  class NetHttpAdapter
    def self.make_request(method, uri, body = nil, header = nil)
      uri = uri.is_a?(Addressable::URI) ? uri : Addressable::URI.parse(uri)

      req = net_http_request_class(method).new(uri.absolute_path)
      #req = Net::HTTP::Head.new('http://dm-s3-adapter-test.s3.amazonaws.com')
      header.each { |k,v| req[k] = v } if header
      conn = Net::HTTP.new(uri.host, uri.port)
      conn.use_ssl = (/https/i === uri.scheme)
      begin 
        conn.start
        res = conn.request(req, body)
      ensure<commit_msg>Remove this line I had left in for testing<commit_after>require 'net/http'
require 'net/https'
require 'addressable/uri'

require 'pathname'
require Pathname(__FILE__).dirname + 'header'

module Addressable
  class URI
    def absolute_path
      absolute_path = ""
      absolute_path << self.path.to_s
      absolute_path << "?#{self.query}" if self.query != nil
      absolute_path << "##{self.fragment}" if self.fragment != nil
      return absolute_path
    end
  end
end

module Resourceful

  class NetHttpAdapter
    def self.make_request(method, uri, body = nil, header = nil)
      uri = uri.is_a?(Addressable::URI) ? uri : Addressable::URI.parse(uri)

      req = net_http_request_class(method).new(uri.absolute_path)
      header.each { |k,v| req[k] = v } if header
      conn = Net::HTTP.new(uri.host, uri.port)
      conn.use_ssl = (/https/i === uri.scheme)
      begin 
        conn.start
        res = conn.request(req, body)
      ensure
{'fraction_non_alphanumeric': 0.12665985699693566, 'fraction_numerical': 0.0010214504596527069, 'mean_word_length': 3.0727650727650726, 'pattern_counts': {'":': 0, '<': 15, '<?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': '652252', 'n_tokens_mistral': 638, 'n_tokens_neox': 634, 'n_words': 149}