Class: Locomotive::Configuration
- Inherits:
-
Object
- Object
- Locomotive::Configuration
- Defined in:
- lib/locomotive/configuration.rb
Constant Summary collapse
- @@default_locales =
%w{en de fr bg cs da el es ca fa-IR fi-FI it ja-JP lt nl pl-PL pt pt-BR ru sv sv-FI uk zh-CN}
- @@site_locales =
@@default_locales + %w{hr et nb sk sl sr}
- @@defaults =
{ name: 'Locomotive', host: nil, # forbidden_paths: %w{layouts snippets stylesheets javascripts assets admin system api}, reserved_site_handles: %w(sites my_account password sign_in sign_out), reserved_slugs: %w{stylesheets javascripts assets admin locomotive images api pages edit}, reserved_domains: [], locales: @@default_locales, site_locales: @@site_locales, cookie_key: '_locomotive_session', enable_logs: false, steam_log_file: nil, steam_log_level: ::Logger::DEBUG, enable_admin_ssl: false, delayed_job: false, default_locale: :en, mailer_sender: '[email protected]', unsafe_token_authentication: false, enable_registration: true, optimize_uploaded_files: false, default_maximum_uploaded_file_size: 2.megabytes, ui: { per_page: 10 }, rack_cache: { verbose: true, metastore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/meta"), # URI encoded in case of spaces entitystore: URI.encode("file:#{Rails.root}/tmp/dragonfly/cache/body") }, devise_modules: [:registerable, :rememberable, :database_authenticatable, :recoverable, :trackable, :validatable, :encryptable, { encryptor: :sha1 }], steam_image_resizer_secret: 'please change it' }
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #method_missing(name, *args, &block) ⇒ Object
- #respond_to?(name, include_all = false) ⇒ Boolean
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
42 43 44 |
# File 'lib/locomotive/configuration.rb', line 42 def initialize @@settings = self.class.get_from_hash(@@defaults) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
50 51 52 |
# File 'lib/locomotive/configuration.rb', line 50 def method_missing(name, *args, &block) self.settings.send(name, *args, &block) end |
Class Method Details
.settings ⇒ Object
46 47 48 |
# File 'lib/locomotive/configuration.rb', line 46 def self.settings @@settings end |
Instance Method Details
#respond_to?(name, include_all = false) ⇒ Boolean
54 55 56 |
# File 'lib/locomotive/configuration.rb', line 54 def respond_to?(name, include_all = false) self.settings.keys.include?(name.to_sym) || super end |