module Rails
def application
def application @@application ||= nil end
def application=(application)
def application=(application) @@application = application end
def backtrace_cleaner
def backtrace_cleaner @@backtrace_cleaner ||= begin # Relies on Active Support, so we have to lazy load to postpone definition until AS has been loaded require 'rails/backtrace_cleaner' Rails::BacktraceCleaner.new end end
def cache
def cache RAILS_CACHE end
def configuration
def configuration application.config end
def env
def env @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") end
def env=(environment)
def env=(environment) @_env = ActiveSupport::StringInquirer.new(environment) end
def initialize!
def initialize! application.initialize! end
def initialized=(initialized)
def initialized=(initialized) @@initialized ||= initialized end
def initialized?
def initialized? @@initialized || false end
def logger
def logger @@logger ||= nil end
def logger=(logger)
def logger=(logger) @@logger = logger end
def public_path
def public_path application && application.paths.public.to_a.first end
def public_path=(path)
def public_path=(path) ActiveSupport::Deprecation.warn "Setting Rails.public_path= is deprecated. " << "Please set paths.public = in config/application.rb instead.", caller end
def root
def root application && application.config.root end
def version
def version VERSION::STRING end