<commit_before>module Typus

  module Configuration

    module Reloader

      def reload_config_et_roles
        logger.info "[typus] Configuration files have been reloaded."
        Typus::Configuration.roles!
        Typus::Configuration.config!
      end

    end

    ##
    # Default application options that can be overwritten from
    # an initializer.
    #
    # Example:
    #
    #   Typus::Configuration.options[:app_name] = "Your App Name"
    #   Typus::Configuration.options[:app_description] = "Your App Description"
    #   Typus::Configuration.options[:per_page] = 15
    #   Typus::Configuration.options[:toggle] = true
    #   Typus::Configuration.options[:root] = 'admin'
    #   Typus::Configuration.options[:recover_password] = false
    #   Typus::Configuration.options[:disable_typus_enabled_plugins] = true
    #   Typus::Configuration.options[:email] = '<EMAIL>'
    #   Typus::Configuration.options[:password] = 8
    #   Typus::Configuration.options[:special_characters_on_password] = true
    #   Typus::Configuration.options[:ssl] = false
    #
    # Experimental options: (don't use in production)
    #
    #   Typus::Configuration.options[:actions_on_table] = false
    #
    @@options = { :app_name => 'Typus', 
                  :app_description => '', 
                  :per_page => 15, 
                  :version => '', 
                  :form_rows => 10, 
                  :form_columns => 10, 
                  :minute_step => 5, 
                  :toggle => true, 
                  :edit_after_create => true, 
                  :root => 'admin', 
                  :recover_password => true, 
                  :email => '<EMAIL>', 
                  :password => 8, 
                  :special_characters_on_password => false, 
                  :ssl => false, 
                  :actions_on_table => false }

    mattr_accessor :options

    ##
    # Read Typus Configuration file
    #
    #   Typus::Configuration.config! overwrites @@config
    #
    def self.config!

      folders = if Rails.test?
                  ["vendor/plugins/typus/test/config/typus.yml"]
                else
                  Dir["config/typus/*"] - Dir["config/typus/*"].grep(/roles.yml/)
                end

      @@config = {}
      folders.each do |folder|
        @@config = @@config.merge(YAML.load_file("#{RAILS_ROOT}/#{folder}"))
      end

      return @@config

    end

    mattr_accessor :config

    ##
    # Read Typus Roles
    #
    #   Typus::Configuration.roles! overwrites @@roles
    #
    def self.roles!

      folders = if Rails.test?
                  ["vendor/plugins/typus/test/config/typus_roles.yml"]
                else
                  Dir["config/typus/*_roles.yml"]
                end

      @@roles = { 'admin' => {} }

      folders.each do |folder|
        YAML.load_file("#{RAILS_ROOT}/#{folder}").each do |key, value|
          begin
            @@roles[key] = @@roles[key].merge(value)
          rescue
            @@roles[key] = value
          end
        end
      end

      return @@roles

    end

    mattr_accessor :roles

  end

end<commit_msg>Use StringInquier<commit_after>module Typus

  module Configuration

    module Reloader

      def reload_config_et_roles
        logger.info "[typus] Configuration files have been reloaded."
        Typus::Configuration.roles!
        Typus::Configuration.config!
      end

    end

    ##
    # Default application options that can be overwritten from
    # an initializer.
    #
    # Example:
    #
    #   Typus::Configuration.options[:app_name] = "Your App Name"
    #   Typus::Configuration.options[:app_description] = "Your App Description"
    #   Typus::Configuration.options[:per_page] = 15
    #   Typus::Configuration.options[:toggle] = true
    #   Typus::Configuration.options[:root] = 'admin'
    #   Typus::Configuration.options[:recover_password] = false
    #   Typus::Configuration.options[:disable_typus_enabled_plugins] = true
    #   Typus::Configuration.options[:email] = '<EMAIL>'
    #   Typus::Configuration.options[:password] = 8
    #   Typus::Configuration.options[:special_characters_on_password] = true
    #   Typus::Configuration.options[:ssl] = false
    #
    # Experimental options: (don't use in production)
    #
    #   Typus::Configuration.options[:actions_on_table] = false
    #
    @@options = { :app_name => 'Typus', 
                  :app_description => '', 
                  :per_page => 15, 
                  :version => '', 
                  :form_rows => 10, 
                  :form_columns => 10, 
                  :minute_step => 5, 
                  :toggle => true, 
                  :edit_after_create => true, 
                  :root => 'admin', 
                  :recover_password => true, 
                  :email => '<EMAIL>', 
                  :password => 8, 
                  :special_characters_on_password => false, 
                  :ssl => false, 
                  :actions_on_table => false }

    mattr_accessor :options

    ##
    # Read Typus Configuration file
    #
    #   Typus::Configuration.config! overwrites @@config
    #
    def self.config!

      folders = if Rails.env.test?
                  ["vendor/plugins/typus/test/config/typus.yml"]
                else
                  Dir["config/typus/*"] - Dir["config/typus/*"].grep(/roles.yml/)
                end

      @@config = {}
      folders.each do |folder|
        @@config = @@config.merge(YAML.load_file("#{RAILS_ROOT}/#{folder}"))
      end

      return @@config

    end

    mattr_accessor :config

    ##
    # Read Typus Roles
    #
    #   Typus::Configuration.roles! overwrites @@roles
    #
    def self.roles!

      folders = if Rails.env.test?
                  ["vendor/plugins/typus/test/config/typus_roles.yml"]
                else
                  Dir["config/typus/*_roles.yml"]
                end

      @@roles = { 'admin' => {} }

      folders.each do |folder|
        YAML.load_file("#{RAILS_ROOT}/#{folder}").each do |key, value|
          begin
            @@roles[key] = @@roles[key].merge(value)
          rescue
            @@roles[key] = value
          end
        end
      end

      return @@roles

    end

    mattr_accessor :roles

  end

end
{'fraction_non_alphanumeric': 0.12312599681020733, 'fraction_numerical': 0.0035087719298245615, 'mean_word_length': 1.8070725156669651, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 41, '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': '3485337', 'n_tokens_mistral': 1966, 'n_tokens_neox': 1789, 'n_words': 332}