<commit_before>require 'oauth'

class Autotest
  module Twitter
    class Client
      def initialize
        yield(self) if block_given?
      end

      attr_accessor :consumer, :access_token, :label, :image_dir

      def client
        @client ||= create_client(consumer, access_token)
      end

      def update(status, icon = nil)
        status = "#{label}: #{status}" unless label.nil? || label.empty?
        client.post('/statuses/update.json', :status => status)
      end

      private

      def create_client(consumer, access_token)
        raise '`consumer` is required'     if consumer.nil?
        raise '`access_token` is required' if access_token.nil?

        raise '`consumer` must be an array'     unless Array === consumer
        raise '`access_token` must be an array' unless Array === access_token

        raise 'The number of elements in `consumer` must be at least two'     if consumer.size < 2
        raise 'The number of elements in `access_token` must be at least two' if access_token.size < 2

        args = consumer + ['https://api.twitter.com/1']
        OAuth::AccessToken.new(OAuth::Consumer.new(*args), *access_token)
      end
    end
  end
end<commit_msg>Fix the arguments to give to OAuth::Consumer.new<commit_after>require 'oauth'

class Autotest
  module Twitter
    class Client
      def initialize
        yield(self) if block_given?
      end

      attr_accessor :consumer, :access_token, :label, :image_dir

      def client
        @client ||= create_client(consumer, access_token)
      end

      def update(status, icon = nil)
        status = "#{label}: #{status}" unless label.nil? || label.empty?
        client.post('/statuses/update.json', :status => status)
      end

      private

      def create_client(consumer, access_token)
        raise '`consumer` is required'     if consumer.nil?
        raise '`access_token` is required' if access_token.nil?

        raise '`consumer` must be an array'     unless Array === consumer
        raise '`access_token` must be an array' unless Array === access_token

        raise 'The number of elements in `consumer` must be at least two'     if consumer.size < 2
        raise 'The number of elements in `access_token` must be at least two' if access_token.size < 2

        args = consumer + [{:site => 'https://api.twitter.com/1'}]
        OAuth::AccessToken.new(OAuth::Consumer.new(*args), *access_token)
      end
    end
  end
end
{'fraction_non_alphanumeric': 0.10147299509001637, 'fraction_numerical': 0.0024549918166939444, 'mean_word_length': 2.671171171171171, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 6, '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': '7366461', 'n_tokens_mistral': 721, 'n_tokens_neox': 686, 'n_words': 230}