<commit_before>require 'json'

module Faye
  module Authentication
    class HTTPClient

      def self.publish(url, channel, data, key)
        uri = URI(url)
        req = Net::HTTP::Post.new(uri)
        message = {channel: channel, data: data, clientId: 'http'}
        message[:signature] = Faye::Authentication.sign(message, key)
        req.set_form_data(message: JSON.dump(message))
        Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') { |http| http.request(req) }
      end

    end
  end
end<commit_msg>Fix specs failing with ruby 1.9<commit_after>require 'json'

module Faye
  module Authentication
    class HTTPClient

      def self.publish(url, channel, data, key)
        uri = URI(url)
        req = Net::HTTP::Post.new(url)
        message = {channel: channel, data: data, clientId: 'http'}
        message[:signature] = Faye::Authentication.sign(message, key)
        req.set_form_data(message: JSON.dump(message))
        Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') { |http| http.request(req) }
      end

    end
  end
end
{'fraction_non_alphanumeric': 0.1331521739130435, 'fraction_numerical': 0.0018115942028985507, 'mean_word_length': 3.077490774907749, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '4654242', 'n_tokens_mistral': 353, 'n_tokens_neox': 347, 'n_words': 84}