<commit_before>begin
  db_settings = YAML.load_file('config/database.yml')["test"]
rescue
  puts "Couldn't find config/database.yml. Do you need to copy it from config/database.yml.example?"
end

# Update the renalwareconn.php for this environment
ENV['php_db_host'] = db_settings["host"]
ENV['php_db_user'] = db_settings["username"]
ENV['php_db_password'] = db_settings["password"]
ENV['php_db'] = db_settings["database"]

client = Mysql2::Client.new(:host => db_settings["host"], :username => db_settings["username"])

Before do
  client.query("CREATE DATABASE IF NOT EXISTS #{db_settings["database"]}")

  # Load legacy schema
  `cat db/schema.sql | mysql #{db_settings["database"]} -u #{db_settings["username"]}`

  $client = Mysql2::Client.new(:host => "localhost", :username => db_settings["username"],
    :database => db_settings["database"])
end

at_exit do
  client.query("DROP DATABASE #{db_settings["database"]}")
  client.close
end<commit_msg>Adding password to access databases<commit_after>begin
  db_settings = YAML.load_file('config/database.yml')["test"]
rescue
  puts "Couldn't find config/database.yml. Do you need to copy it from config/database.yml.example?"
end

# Update the renalwareconn.php for this environment
ENV['php_db_host'] = db_settings["host"]
ENV['php_db_user'] = db_settings["username"]
ENV['php_db_password'] = db_settings["password"]
ENV['php_db'] = db_settings["database"]

client = Mysql2::Client.new(:host => db_settings["host"], :username => db_settings["username"], :password => "password")

Before do
  client.query("CREATE DATABASE IF NOT EXISTS #{db_settings["database"]}")

  # Load legacy schema
  `cat db/schema.sql | mysql #{db_settings["database"]} -u #{db_settings["username"]} --password=password`

  $client = Mysql2::Client.new(:host => "localhost", :username => db_settings["username"],
    :database => db_settings["database"], :password => "password")
end

at_exit do
  client.query("DROP DATABASE #{db_settings["database"]}")
  client.close
end
{'fraction_non_alphanumeric': 0.16516966067864272, 'fraction_numerical': 0.001996007984031936, 'mean_word_length': 6.537593984962406, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 15, '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': '5411175', 'n_tokens_mistral': 654, 'n_tokens_neox': 632, 'n_words': 144}