From b0b4b176b0e061a4f03ddce669637b7d6c37aa33 Mon Sep 17 00:00:00 2001
From: Travis Yoder <trayoda@gmail.com>
Date: Thu, 7 May 2015 10:54:26 -0600
Subject: better docs for Rails.root and Rails.public_path

---
 railties/lib/rails.rb | 10 ++++++++++
 1 file changed, 10 insertions(+)

(limited to 'railties/lib')

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
-- 
cgit v1.2.3