diff options
author | Travis Yoder <trayoda@gmail.com> | 2015-05-07 10:54:26 -0600 |
---|---|---|
committer | Travis Yoder <trayoda@gmail.com> | 2015-05-07 10:54:26 -0600 |
commit | b0b4b176b0e061a4f03ddce669637b7d6c37aa33 (patch) | |
tree | dec97a2775d1d429d30fc7ccc07c3d3352f501ca | |
parent | 5a06bbc712713c94766fd3acd18defde51c94da8 (diff) | |
download | rails-b0b4b176b0e061a4f03ddce669637b7d6c37aa33.tar.gz rails-b0b4b176b0e061a4f03ddce669637b7d6c37aa33.tar.bz2 rails-b0b4b176b0e061a4f03ddce669637b7d6c37aa33.zip |
better docs for Rails.root and Rails.public_path
-rw-r--r-- | railties/lib/rails.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/railties/lib/rails.rb b/railties/lib/rails.rb index b1f7c29b5a..fe789f3c2a 100644 --- a/railties/lib/rails.rb +++ b/railties/lib/rails.rb @@ -52,6 +52,11 @@ module Rails end end + # Returns a Pathname object of the current rails project, + # otherwise it returns nil if there is no project: + # + # Rails.root + # # => #<Pathname:/Users/someuser/some/path/project> def root application && application.config.root end @@ -94,6 +99,11 @@ module Rails groups end + # Returns a Pathname object of the public folder of the current + # rails project, otherwise it returns nil if there is no project: + # + # Rails.public_path + # # => #<Pathname:/Users/someuser/some/path/project/public> def public_path application && Pathname.new(application.paths["public"].first) end |