<commit_before>module Typus

  class << self

    def applications
      apps = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1].has_key? 'application'
          apps << model[1]['application']
        end
      end
      return apps.uniq.sort
    end

    def modules(app_name)
      submodules = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1]['application'] == app_name
          submodules << model[0]
        end
      end
      return submodules.sort
    end

    def submodules(module_name)
      submodules = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1]['module'] == module_name
          submodules << model[0]
        end
      end
      return submodules.sort
    end

    def parent_module(submodule_name)
      Typus::Configuration.config[submodule_name]['module']
    end

    def parent_application(module_name)
      Typus::Configuration.config[module_name]['application']
    end

    def models
      m = []
      Typus::Configuration.config.to_a.each do |model|
        m << model[0]
      end
      return m.sort
    end

    def version
      VERSION::STRING
    end

    def enable
      enable_config
      enable_roles
      enable_models
      enable_views
      enable_controllers
      enable_helpers
      enable_version
      enable_testing_models if RAILS_ENV == 'test'
      enable_orm
      enable_routes
      enable_string
      enable_hash
      enable_authentication
      enable_patches if Rails.vendor_rails?
      enable_object
      enable_pagination
      enable_environments
    end

    def enable_config
      Typus::Configuration.config!
    end

    def enable_roles
      Typus::Configuration.roles!
    end

    def enable_models
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'models')
    end

    def enable_views
      ActionController::Base.append_view_path(File.join(File.dirname(__FILE__), '..', 'app', 'views'))
    end

    def enable_controllers
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'controllers')
    end

    def enable_helpers
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'helpers')
    end

    def enable_version
      require 'typus/version'<commit_msg>Append view_path as an array, not using the append_view_path method<commit_after>module Typus

  class << self

    def applications
      apps = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1].has_key? 'application'
          apps << model[1]['application']
        end
      end
      return apps.uniq.sort
    end

    def modules(app_name)
      submodules = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1]['application'] == app_name
          submodules << model[0]
        end
      end
      return submodules.sort
    end

    def submodules(module_name)
      submodules = []
      Typus::Configuration.config.to_a.each do |model|
        if model[1]['module'] == module_name
          submodules << model[0]
        end
      end
      return submodules.sort
    end

    def parent_module(submodule_name)
      Typus::Configuration.config[submodule_name]['module']
    end

    def parent_application(module_name)
      Typus::Configuration.config[module_name]['application']
    end

    def models
      m = []
      Typus::Configuration.config.to_a.each do |model|
        m << model[0]
      end
      return m.sort
    end

    def version
      VERSION::STRING
    end

    def enable
      enable_config
      enable_roles
      enable_models
      enable_views
      enable_controllers
      enable_helpers
      enable_version
      enable_testing_models if RAILS_ENV == 'test'
      enable_orm
      enable_routes
      enable_string
      enable_hash
      enable_authentication
      enable_patches if Rails.vendor_rails?
      enable_object
      enable_pagination
      enable_environments
    end

    def enable_config
      Typus::Configuration.config!
    end

    def enable_roles
      Typus::Configuration.roles!
    end

    def enable_models
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'models')
    end

    def enable_views
      ActionController::Base.view_paths << File.join(File.dirname(__FILE__), '..', 'app', 'views')
    end

    def enable_controllers
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'controllers')
    end

    def enable_helpers
      ActiveSupport::Dependencies.load_paths << File.join(File.dirname(__FILE__), '..', 'app', 'helpers')
    end

    def enable_version
      require 'typus/version'
{'fraction_non_alphanumeric': 0.09435146443514644, 'fraction_numerical': 0.0029288702928870294, 'mean_word_length': 2.464492753623188, 'pattern_counts': {'":': 0, '<': 37, '<?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': '5121735', 'n_tokens_mistral': 1421, 'n_tokens_neox': 1384, 'n_words': 289}