Module: EacRailsBase0App::Application::All::ClassMethods
- Defined in:
- lib/eac_rails_base0/app_base/application/all.rb
Instance Method Summary collapse
- #app_temporary_directory ⇒ String
- #setup_app_root ⇒ Object
- #setup_assets_cache ⇒ Object
- #setup_defaults ⇒ Object
- #setup_dependencies ⇒ Object
- #setup_deprecated_migrations ⇒ Object
- #setup_engines ⇒ Object
- #setup_fs_cache_context ⇒ Object
- #setup_load_paths ⇒ Object
- #setup_local_engines ⇒ Object
- #setup_localization ⇒ Object
- #setup_loggers ⇒ Object
- #setup_unknown_asset_fallback ⇒ Object
Instance Method Details
#app_temporary_directory ⇒ String
19 20 21 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 19 def app_temporary_directory ::Dir.tmpdir.to_pathname.join(::Rails.root.to_path.parameterize, 'tmp') end |
#setup_app_root ⇒ Object
23 24 25 26 27 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 23 def setup_app_root return unless defined?(APP_PATH) config.root = find_root(APP_PATH) end |
#setup_assets_cache ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 29 def setup_assets_cache config.assets.configure do |env| env.cache = Sprockets::Cache::FileStore.new( ::File.join(app_temporary_directory, 'cache', 'assets'), config.assets.cache_limit, env.logger ) end end |
#setup_defaults ⇒ Object
57 58 59 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 57 def setup_defaults config.load_defaults 5.1 end |
#setup_dependencies ⇒ Object
61 62 63 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 61 def setup_dependencies require 'carrierwave' end |
#setup_deprecated_migrations ⇒ Object
65 66 67 68 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 65 def setup_deprecated_migrations path = ::Rails.root.join('db/migrate_deprecated') config.paths['db/migrate'] << path if path.directory? end |
#setup_engines ⇒ Object
45 46 47 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 45 def setup_engines require 'eac_rails_base0/engine' end |
#setup_fs_cache_context ⇒ Object
39 40 41 42 43 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 39 def setup_fs_cache_context ::EacFs::Contexts.cache.push( ::EacFs::StorageTree.new(::Rails.root.join('tmp/cache/eac_fs')) ) end |
#setup_load_paths ⇒ Object
70 71 72 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 70 def setup_load_paths config.autoload_paths << Rails.root.join('lib') end |
#setup_local_engines ⇒ Object
49 50 51 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 49 def setup_local_engines ::EacRailsBase0::XEngine.require_local end |
#setup_localization ⇒ Object
74 75 76 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 74 def setup_localization config.i18n.default_locale = :'pt-BR' end |
#setup_loggers ⇒ Object
78 79 80 81 82 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 78 def setup_loggers config.after_initialize do ActiveRecord::Base.logger = nil end end |
#setup_unknown_asset_fallback ⇒ Object
53 54 55 |
# File 'lib/eac_rails_base0/app_base/application/all.rb', line 53 def setup_unknown_asset_fallback config.assets.unknown_asset_fallback = false end |