lib/faalis/configuration.rb in faalis-2.1.1 vs lib/faalis/configuration.rb in faalis-2.2.0.pre.rc1

- old
+ new

@@ -1,6 +1,8 @@ module Faalis + # This module contains all the configuration of `Faalis::Engine` + # which can be setup in `config/initializer/faalis.rb` module Configuration @@modules_to_load = {} # Configure logger @@ -30,10 +32,14 @@ if value ::I18n.exception_handler = Faalis::I18n::MissingKeyHandler.new end end + mattr_accessor :i18n_debug do + false + end + # Site Title attr_accessor :site_title do 'Faalis' end @@ -56,21 +62,30 @@ mattr_accessor :devise_for do {} end + # Whether using UUID with models or not. + mattr_accessor :use_uuid do + false + end + mattr_accessor :amd_dir do 'amd' end mattr_accessor :amd do true end - + # This hash map contains all the features as keys and + # the required dependencies of each feature in form of + # an array as value @@modules_to_load[:amd] = ['amd'] + # Load all the features dependencies based on their configuration + # value. For example if `amd` class method returns true all of its + # dependencies will be loaded. def load_dependencies_based_on_configuration - @@modules_to_load.each do |k, v| v.map { |mod| require mod } if send(k) end end