Module: Application::Defaults
- Included in:
- Application
- Defined in:
- lib/ruby-app/application_defaults.rb
Instance Method Summary collapse
- #bundler_group ⇒ Object
- #config ⇒ Object
- #env ⇒ Object (also: #environment)
- #error_mailer ⇒ Object
- #identifier ⇒ Object
- #initializer_paths ⇒ Object
- #logger ⇒ Object
- #logger_dir ⇒ Object
- #rake_paths ⇒ Object
- #tmp_dir ⇒ Object
Instance Method Details
#bundler_group ⇒ Object
60 61 |
# File 'lib/ruby-app/application_defaults.rb', line 60 def bundler_group end |
#config ⇒ Object
44 45 46 |
# File 'lib/ruby-app/application_defaults.rb', line 44 def config CommonConfig end |
#env ⇒ Object Also known as: environment
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ruby-app/application_defaults.rb', line 13 def env @gem_env ||= begin env = ENV['APP_ENV'] || ENV['RAILS_ENV'] # if not specify env, try find file with env config/environment.current # which created this file by a capistrano, by example unless env path = File.join(root, %w{ config environment.current }) if File.exists?(path) env = File.read(path) env.strip! end end env = 'development' unless env env end end |
#error_mailer ⇒ Object
63 64 65 |
# File 'lib/ruby-app/application_defaults.rb', line 63 def error_mailer ErrorMailer end |
#identifier ⇒ Object
48 49 50 |
# File 'lib/ruby-app/application_defaults.rb', line 48 def identifier "ruby-app" end |
#initializer_paths ⇒ Object
56 57 58 |
# File 'lib/ruby-app/application_defaults.rb', line 56 def initializer_paths @gem_initializer_paths ||= [] end |
#logger ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/ruby-app/application_defaults.rb', line 35 def logger @gem_logger ||= begin file = env.to_s['test'] ? File.open(File.join(logger_dir, "#{name rescue 'ruby-app'}.log"), "a") : STDERR LocalLogger.new(file).tap do |l| l.level = App.config.log_level end end end |
#logger_dir ⇒ Object
9 10 11 |
# File 'lib/ruby-app/application_defaults.rb', line 9 def logger_dir @gem_logger_dir ||= File.join(root, %w{log}) end |
#rake_paths ⇒ Object
52 53 54 |
# File 'lib/ruby-app/application_defaults.rb', line 52 def rake_paths @gem_rake_paths ||= [] end |
#tmp_dir ⇒ Object
5 6 7 |
# File 'lib/ruby-app/application_defaults.rb', line 5 def tmp_dir @gem_tmp_dir ||= File.join(root, %w{tmp}) end |