<commit_before>require 'settingslogic'

# Terrific assertions
#raise "config.rb: APP_ROOT is not defined" unless defined? APP_ROOT
APP_NAME = "rest-ftp-daemon"
APP_CONF = "/etc/#{APP_NAME}.yml"
APP_DEV = ARGV.include?("development") ? true : false

class Settings < Settingslogic
  # Read configuration
  source (File.exists? APP_CONF) ? APP_CONF : Hash.new
  namespace (APP_DEV ? "development" : "production")
  suppress_errors true

  # Some constants
  self[:dev] = APP_DEV
  self[:app_name] = APP_NAME
  self[:app_lib] = File.expand_path File.dirname(__FILE__)
  self[:app_ver] = "0.72.1"
  self[:app_started] = Time.now
  self[:default_trim_progname] = "18"

  # Some defaults
  self[:default_chunk_size] = "1000000"
  self[:default_notify_size] = "10000000"
end
<commit_msg>protected config.rb for situations where SettingsLogic gem was not available to load Gemspec<commit_after># Try to load Settingslogic
begin
  require "settingslogic"
rescue LoadError
  raise "config.rb warning: Settingslogic is needed to provide configuration values to the Gemspec file"
end

# Terrific assertions
#raise "config.rb: APP_ROOT is not defined" unless defined? APP_ROOT
APP_NAME = "rest-ftp-daemon"
APP_CONF = "/etc/#{APP_NAME}.yml"
APP_DEV = ARGV.include?("development") ? true : false

# Configuration class
class Settings < Settingslogic
  # Read configuration
  source (File.exists? APP_CONF) ? APP_CONF : Hash.new
  namespace (APP_DEV ? "development" : "production")
  suppress_errors true

  # Some constants
  self[:dev] = APP_DEV
  self[:app_name] = APP_NAME
  self[:app_lib] = File.expand_path File.dirname(__FILE__)
  self[:app_ver] = "0.72.1"
  self[:app_started] = Time.now
  self[:default_trim_progname] = "18"

  # Some defaults
  self[:default_chunk_size] = "1000000"
  self[:default_notify_size] = "10000000"
end

{'fraction_non_alphanumeric': 0.11464618760285245, 'fraction_numerical': 0.02303894679100384, 'mean_word_length': 5.1003344481605355, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 2, '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': '2948972', 'n_tokens_mistral': 658, 'n_tokens_neox': 597, 'n_words': 155}