<commit_before>require 'net/https'

module DeployTracking
  USE_SSL = true
  DEPLOY_TRACKING_HOST = 'deploytracking.heroku.com'
  DEPLOY_TRACKING_PATH = '/deploys'
  DEPLOY_TRACKING_PORT = 443

  def self.notify(api_key, data)
    puts "[DeployTracking] Tracking Deployment to #{DEPLOY_TRACKING_HOST}"

    params = {'api_key' => api_key}
    data.each {|k,v| params["deploy[#{k}]"] = v }

    http = Net::HTTP.new(DEPLOY_TRACKING_HOST, DEPLOY_TRACKING_PORT)
    http.use_ssl = USE_SSL
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    request = Net::HTTP::Post.new(DEPLOY_TRACKING_PATH)
    request.set_form_data(params)
    response = http.request(request)

    throw "[DeployTracking] Error posting to server." unless response.is_a?(Net::HTTPSuccess)
    puts "[DeployTracking] Deployment tracked"
  end
end<commit_msg>Send back the version of the gem<commit_after>require 'net/https'

module DeployTracking
  USE_SSL = true
  DEPLOY_TRACKING_HOST = 'deploytracking.heroku.com'
  DEPLOY_TRACKING_PATH = '/deploys'
  DEPLOY_TRACKING_PORT = 443

  def self.notify(api_key, data)
    puts "[DeployTracking] Tracking Deployment to #{DEPLOY_TRACKING_HOST}"

    params = {'api_key' => api_key, 'deploy["gem_version"]' => DeployTracking::VERSION}
    data.each {|k,v| params["deploy[#{k}]"] = v }

    http = Net::HTTP.new(DEPLOY_TRACKING_HOST, DEPLOY_TRACKING_PORT)
    http.use_ssl = USE_SSL
    http.verify_mode = OpenSSL::SSL::VERIFY_NONE
    request = Net::HTTP::Post.new(DEPLOY_TRACKING_PATH)
    request.set_form_data(params)
    response = http.request(request)

    throw "[DeployTracking] Error posting to server." unless response.is_a?(Net::HTTPSuccess)
    puts "[DeployTracking] Deployment tracked"
  end
end
{'fraction_non_alphanumeric': 0.1179546775130738, 'fraction_numerical': 0.003486345148169669, 'mean_word_length': 4.897260273972603, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '1318477', 'n_tokens_mistral': 658, 'n_tokens_neox': 634, 'n_words': 115}