<commit_before>db_config = YAML::load(File.read(RAILS_ROOT + "/config/database.yml"))
 
if db_config[Rails.env] && db_config[Rails.env]['adapter'] == 'mongodb'
  mongo = db_config[Rails.env]
  MongoMapper.connection = Mongo::Connection.new(mongo['hostname'],
                                                 mongo['port'] || 27017,
                                                 :logger => Rails.logger)
  MongoMapper.database = mongo['database']
  OpenIdAuthentication.store = OpenIdAuthentication::Mongo::Store.new
end
 
if defined?(PhusionPassenger)
   PhusionPassenger.on_event(:starting_worker_process) do |forked|
     MongoMapper.database.connect_to_master if forked
   end
end
<commit_msg>Passenger and  mongomapper compatibility<commit_after>db_config = YAML::load(File.read(RAILS_ROOT + "/config/database.yml"))
 
if db_config[Rails.env] && db_config[Rails.env]['adapter'] == 'mongodb'
  mongo = db_config[Rails.env]
  MongoMapper.connection = Mongo::Connection.new(mongo['hostname'],
                                                 mongo['port'] || 27017,
                                                 :logger => Rails.logger)
  MongoMapper.database = mongo['database']
  OpenIdAuthentication.store = OpenIdAuthentication::Mongo::Store.new
end
 
if defined?(PhusionPassenger)
   PhusionPassenger.on_event(:starting_worker_process) do |forked|
     MongoMapper.connection.connect_to_master if forked
   end
end

{'fraction_non_alphanumeric': 0.11772950245269796, 'fraction_numerical': 0.00700770847932726, 'mean_word_length': 2.977715877437326, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 8, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6413379', 'n_tokens_mistral': 437, 'n_tokens_neox': 413, 'n_words': 63}