Module: Rails
Class Attribute Summary
- .app_class rw
- .application rw
- .application=(value) rw
- .cache rw
- .env rw
- .env=(environment) rw
- .logger rw
Class Method Summary
- .backtrace_cleaner
-
.configuration
The Configuration instance used to configure the
Rails
environment. -
.gem_version
Returns the version of the currently loaded
Rails
as aGem::Version
-
.groups(*groups)
Returns all rails groups for loading based on:
- .public_path
- .root
-
.version
Returns the version of the currently loaded
Rails
as a string.
::ActiveSupport::Autoload - Extended
Instance Method Summary
Class Attribute Details
.app_class (rw)
[ GitHub ].application (rw)
[ GitHub ].application=(value) (rw)
[ GitHub ]# File 'railties/lib/rails.rb', line 34
attr_writer :application
.cache (rw)
[ GitHub ].env (rw)
[ GitHub ]# File 'railties/lib/rails.rb', line 59
def env @_env ||= ActiveSupport::StringInquirer.new(ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "development") end
.env=(environment) (rw)
[ GitHub ]# File 'railties/lib/rails.rb', line 63
def env=(environment) @_env = ActiveSupport::StringInquirer.new(environment) end
.logger (rw)
[ GitHub ]Class Method Details
.backtrace_cleaner
[ GitHub ]# File 'railties/lib/rails.rb', line 47
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
.configuration
The Configuration instance used to configure the Rails
environment
# File 'railties/lib/rails.rb', line 43
def configuration application.config end
.gem_version
Returns the version of the currently loaded Rails
as a Gem::Version
See additional method definition at file version.rb line 3.
.groups(*groups)
Returns all rails groups for loading based on:
-
The Rails environment;
-
The environment variable RAILS_GROUPS;
-
The optional envs given as argument and the hash with group dependencies;
groups assets: [:development, :test]
# Returns # => [:default, :development, :assets] for Rails.env == “development” # => [:default, :production] for Rails.env == “production”
.public_path
[ GitHub ]# File 'railties/lib/rails.rb', line 89
def public_path application && Pathname.new(application.paths["public"].first) end
.root
[ GitHub ]# File 'railties/lib/rails.rb', line 55
def root application && application.config.root end
.version
Returns the version of the currently loaded Rails
as a string.
Instance Method Details
#initialize!
[ GitHub ]# File 'railties/lib/rails.rb', line 40
delegate :initialize!, :initialized?, to: :application
#initialized? ⇒ Boolean
# File 'railties/lib/rails.rb', line 40
delegate :initialize!, :initialized?, to: :application