Skip to content

Commit

Permalink
Add Rails.logger, Rails.root, Rails.env and Rails.cache shortcuts for…
Browse files Browse the repository at this point in the history
… RAILS_* constants

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9180 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
lifo committed Apr 1, 2008
1 parent c2ea287 commit dc1166d
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
2 changes: 2 additions & 0 deletions railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Add Rails.logger, Rails.root, Rails.env and Rails.cache shortcuts for RAILS_* constants [pratik]

* Allow files in plugins to be reloaded like the rest of the application. [rick]

Enables or disables plugin reloading.
Expand Down
16 changes: 16 additions & 0 deletions railties/lib/initializer.rb
Expand Up @@ -22,6 +22,22 @@ def self.configuration=(configuration)
@@configuration = configuration
end

def self.logger
RAILS_DEFAULT_LOGGER
end

def self.root
RAILS_ROOT
end

def self.env

This comment has been minimized.

Copy link
@mapmarkus

mapmarkus May 11, 2008

A method like Rails.env?(“environment”) or Rails.production? to ask for current environment could be very helpful too.

RAILS_ENV
end

def self.cache
RAILS_CACHE
end

# The Initializer is responsible for processing the Rails configuration, such
# as setting the $LOAD_PATH, requiring the right frameworks, initializing
# logging, and more. It can be run either as a single command that'll just
Expand Down

0 comments on commit dc1166d

Please sign in to comment.