<commit_before>module Godwit
  module Bootloader
  
    class << self
  
      attr_accessor :booted
  
      def boot(argv=ARGV)
        return if booted?
        load_config(argv)
        display_init unless Godwit::Config[:silence]
        load_rails
        set_load_path
        set_logger
        init_db
        init_am
        load_plugins
        @booted = true
      end
      
      def display_init
        system('clear')
        Godwit::Buffer.puts "Godwit " + Godwit::VERSION::STRING
        Godwit::Buffer.puts "\nInitializaing..."
      end
      
      def booted?
        @booted ||= false
      end
      
      def load_rails
        unless Godwit::Config[:rails_root].nil?
          require "#{Godwit::Config[:rails_root]}/config/environment"
        end
      end
      
      def load_config(argv=ARGV)
        Godwit::Config.setup
        require File.join(Godwit::Config[:godwit_root], 'config', 'environment.rb')
        Godwit::Config.parse_args(argv)
      end
      
      def set_load_path
        $:.concat [File.join(Godwit::Config[:godwit_root], 'app', 'models'),
                   File.join(Godwit::Config[:godwit_root], 'app', 'migrations'),
                   File.join(Godwit::Config[:godwit_root], 'lib')]
        Dir[File.join(Godwit::Config[:godwit_root], 'vendor', 'plugins', '*', 'lib')].each do |dir|
          $:.push dir
        end
        Dependencies.load_paths.concat $:           
      end
      
      def set_logger
        ActiveRecord::Base.logger = Godwit::Config[:active_record_log]
        ActiveRecord::Base.logger.level = Godwit::Config[:active_record_log_level]
        ActiveMigration::Base.logger = Godwit::Config[:active_migration_log]
        ActiveMigration::Base.logger.level = Godwit::Config[:active_migration_log_level]
      end
      
      def init_db
        db_conf = YAML::load(File.open(File.join(Godwit::Config[:godwit_root], 'config', 'database.yml')))
        LegacyRecord::Base.establish_connection(db_conf['legacy'])
        ActiveRecord::Base.establish_connection(db_conf['active']) if Godwit::Config[:rails_root].nil?
      end
      <commit_msg>fixed deprecations for active_support<commit_after>module Godwit
  module Bootloader
  
    class << self
  
      attr_accessor :booted
  
      def boot(argv=ARGV)
        return if booted?
        load_config(argv)
        display_init unless Godwit::Config[:silence]
        load_rails
        set_load_path
        set_logger
        init_db
        init_am
        load_plugins
        @booted = true
      end
      
      def display_init
        system('clear')
        Godwit::Buffer.puts "Godwit " + Godwit::VERSION::STRING
        Godwit::Buffer.puts "\nInitializaing..."
      end
      
      def booted?
        @booted ||= false
      end
      
      def load_rails
        unless Godwit::Config[:rails_root].nil?
          require "#{Godwit::Config[:rails_root]}/config/environment"
        end
      end
      
      def load_config(argv=ARGV)
        Godwit::Config.setup
        require File.join(Godwit::Config[:godwit_root], 'config', 'environment.rb')
        Godwit::Config.parse_args(argv)
      end
      
      def set_load_path
        $:.concat [File.join(Godwit::Config[:godwit_root], 'app', 'models'),
                   File.join(Godwit::Config[:godwit_root], 'app', 'migrations'),
                   File.join(Godwit::Config[:godwit_root], 'lib')]
        Dir[File.join(Godwit::Config[:godwit_root], 'vendor', 'plugins', '*', 'lib')].each do |dir|
          $:.push dir
        end
        ActiveSupport::Dependencies.load_paths.concat $:           
      end
      
      def set_logger
        ActiveRecord::Base.logger = Godwit::Config[:active_record_log]
        ActiveRecord::Base.logger.level = Godwit::Config[:active_record_log_level]
        ActiveMigration::Base.logger = Godwit::Config[:active_migration_log]
        ActiveMigration::Base.logger.level = Godwit::Config[:active_migration_log_level]
      end
      
      def init_db
        db_conf = YAML::load(File.open(File.join(Godwit::Config[:godwit_root], 'config', 'database.yml')))
        LegacyRecord::Base.establish_connection(db_conf['legacy'])
        ActiveRecord::Base.establish_connection(db_conf['active']) if Godwit::Config[:rails_root].nil?
      end
      
{'fraction_non_alphanumeric': 0.11997209951174145, 'fraction_numerical': 0.0, 'mean_word_length': 2.414285714285714, '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': '6853490', 'n_tokens_mistral': 1368, 'n_tokens_neox': 1341, 'n_words': 205}