<commit_before>require 'rubygems'
require 'trollop'
require 'daemons'
require 'etc'

require 'ghtorrent/settings'

module GHTorrent

  # Base class for all GHTorrent command line utilities. Provides basic command
  # line argument parsing and command bootstraping support. The order of
  # initialization is the following:
  # prepare_options
  # validate
  # go
  class Command

    include GHTorrent::Settings

    # Specify the run method for subclasses.
    class << self
      def run(args = ARGV)
        attr_accessor :args
        attr_accessor :settings
        attr_accessor :name
        attr_accessor :options

        command = new()

        command.name = self.class.name
        command.args = args

        command.process_options
        command.validate

        command.settings = YAML::load_file command.options[:config]
<commit_msg>Report GHTorrent gem version on startup<commit_after>require 'rubygems'
require 'trollop'
require 'daemons'
require 'etc'

require 'ghtorrent/settings'
require 'version'

module GHTorrent

  # Base class for all GHTorrent command line utilities. Provides basic command
  # line argument parsing and command bootstraping support. The order of
  # initialization is the following:
  # prepare_options
  # validate
  # go
  class Command

    include GHTorrent::Settings
    include GHTorrent::Settings

    # Specify the run method for subclasses.
    class << self
      def run(args = ARGV)
        attr_accessor :args
        attr_accessor :settings
        attr_accessor :name
        attr_accessor :options

        command = new()

        command.name = self.class.name
        command.args = args

        command.process_options
        command.validate

        puts "GHTorrent version: #{GHTorrent::VERSION}"

        command.settings = YAML::load_file command.options[:config]

{'fraction_non_alphanumeric': 0.06626833242802825, 'fraction_numerical': 0.0, 'mean_word_length': 2.9443254817987152, 'pattern_counts': {'":': 0, '<': 7, '<?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': '2725799', 'n_tokens_mistral': 532, 'n_tokens_neox': 509, 'n_words': 161}