<commit_before>require "rushover/version"
require "rest-client"
require "json"

module Rushover
  class Client
    MESSAGES_ENDPOINT = "https://api.pushover.net/1/messages.json".freeze

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def notify(user_key, message, options = {})
      data = { :token => token, :user => user_key, :message => message }
      data.merge!(options)
      data = begin
        resp = RestClient.post MESSAGES_ENDPOINT, data.to_json, :content_type => "application/json"
        JSON.parse(resp)
      rescue RestClient::Exception => e
        JSON.parse(e.response)
      end

      Response.new(data)
    end
  end

  class User<commit_msg>Cleanup #notify a little, weird tempvars<commit_after>require "rushover/version"
require "rest-client"
require "json"

module Rushover
  class Client
    MESSAGES_ENDPOINT = "https://api.pushover.net/1/messages.json".freeze

    attr_accessor :token

    def initialize(token)
      @token = token
    end

    def notify(user_key, message, options = {})
      data = { :token => token, :user => user_key, :message => message }
      data.merge!(options)

      raw_response = begin
        RestClient.post MESSAGES_ENDPOINT, data.to_json, :content_type => "application/json"
      rescue RestClient::Exception => e
        e.response
      end

      Response.new JSON.parse(raw_response)
    end
  end

  class User
{'fraction_non_alphanumeric': 0.10822206605762473, 'fraction_numerical': 0.0014054813773717498, 'mean_word_length': 2.9337016574585637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, 'https://': 2, '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': '4961593', 'n_tokens_mistral': 451, 'n_tokens_neox': 435, 'n_words': 103}