public
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/rails/rails.git
Changed Rails.root to return a Pathname object (allows for 
Rails.root.join("app", "controllers") => "#{RAILS_ROOT}/app/controllers") 
[#1482]
dhh (author)
Sun Nov 30 13:59:30 -0800 2008
commit  be140e8c6be966349c6fa35a87f84d5a73995b9a
tree    9c64dcd3e01e7c3e093eaa971217aad7c8e5ae2a
parent  668872efd85291895d3e68f3a5af312973a1be74
...
1
2
3
 
4
5
6
...
1
2
 
3
4
5
6
0
@@ -1,6 +1,6 @@
0
 *2.3.0 [Edge]*
0
 
0
-* Enhanced Rails.root to take parameters that'll be join with the root, like Rails.root('app', 'controllers') => File.join(Rails.root, 'app', 'controllers') #1482 [Damian Janowski]
0
+* Changed Rails.root to return a Pathname object (allows for Rails.root.join('app', 'controllers') => "#{RAILS_ROOT}/app/controllers") #1482 [Damian Janowski/?]
0
 
0
 * Added view path support for engines [DHH]
0
 
...
48
49
50
51
52
 
 
53
54
55
...
48
49
50
 
 
51
52
53
54
55
0
@@ -48,8 +48,8 @@ module Rails
0
       end
0
     end
0
 
0
-    def root(*args)
0
-      File.join(RAILS_ROOT, *args.compact) if defined?(RAILS_ROOT)
0
+    def root
0
+      Pathname.new(RAILS_ROOT) if defined?(RAILS_ROOT)
0
     end
0
 
0
     def env
...
317
318
319
320
321
 
 
322
323
324
...
317
318
319
 
 
320
321
322
323
324
0
@@ -317,7 +317,7 @@ class RailsRootTest < Test::Unit::TestCase
0
     assert_equal RAILS_ROOT, Rails.root
0
   end
0
 
0
-  def test_rails_dot_root_accepts_arguments_for_file_dot_join
0
-    assert_equal File.join(RAILS_ROOT, 'app', 'controllers'), Rails.root('app', 'controllers')
0
+  def test_rails_dot_root_should_be_a_pathname
0
+    assert_equal File.join(RAILS_ROOT, 'app', 'controllers'), Rails.root.join('app', 'controllers')
0
   end
0
 end
0
\ No newline at end of file

Comments

anildigital Sun Dec 07 06:02:24 -0800 2008

Simple change with more profit.