Permalink
Browse files

Changed all references of deprecated constant RAILS_ROOT to Rails.root

  • Loading branch information...
1 parent f4d7c7e commit d0de221f75d6696d38feab6dc395b23f08183143 @JoelJuliano-duplicate JoelJuliano-duplicate committed Oct 31, 2011
Showing with 8 additions and 8 deletions.
  1. +1 −1 lib/bundle_fu/file_list.rb
  2. +2 −2 test/functional/file_list_test.rb
  3. +4 −4 test/mock_view.rb
  4. +1 −1 test/test_helper.rb
@@ -59,6 +59,6 @@ def save_as(filename)
end
protected
def abs_location(filename)
- File.join(RAILS_ROOT, "public", filename)
+ File.join(Rails.root, "public", filename)
end
end
@@ -13,11 +13,11 @@ def test__new_files__should_get_mtimes
filename = "/javascripts/js_1.js"
filelist = BundleFu::FileList.new([filename])
- assert_equal(File.mtime(File.join(RAILS_ROOT, "public", filename)).to_i,filelist.filelist[0][1])
+ assert_equal(File.mtime(File.join(Rails.root, "public", filename)).to_i,filelist.filelist[0][1])
end
def test__serialization
- filelist_filename = File.join(RAILS_ROOT, "public", "temp")
+ filelist_filename = File.join(Rails.root, "public", "temp")
filelist = BundleFu::FileList.new("/javascripts/js_1.js")
filelist.save_as(filelist_filename)
View
@@ -1,7 +1,7 @@
class MockView
- # set RAILS_ROOT to fixtures dir so we use those files
+ # set Rails.root to fixtures dir so we use those files
include BundleFu::InstanceMethods
- ::RAILS_ROOT = File.join(File.dirname(__FILE__), 'fixtures')
+ ::Rails.root = File.join(File.dirname(__FILE__), 'fixtures')
attr_accessor :output
attr_accessor :session
@@ -21,11 +21,11 @@ def concat(output, *args)
end
def stylesheet_link_tag(*args)
- args.collect{|arg| "<link href=\"#{arg}?#{File.mtime(File.join(RAILS_ROOT, 'public', arg)).to_i}\" media=\"screen\" rel=\"Stylesheet\" type=\"text/css\" />" } * "\n"
+ args.collect{|arg| "<link href=\"#{arg}?#{File.mtime(File.join(Rails.root, 'public', arg)).to_i}\" media=\"screen\" rel=\"Stylesheet\" type=\"text/css\" />" } * "\n"
end
def javascript_include_tag(*args)
- args.collect{|arg| "<script src=\"#{arg}?#{File.mtime(File.join(RAILS_ROOT, 'public', arg)).to_i}\" type=\"text/javascript\"></script>" } * "\n"
+ args.collect{|arg| "<script src=\"#{arg}?#{File.mtime(File.join(Rails.root, 'public', arg)).to_i}\" type=\"text/javascript\"></script>" } * "\n"
end
end
View
@@ -33,6 +33,6 @@ class Test::Unit::TestCase
EOF
def public_file(filename)
- File.join(::RAILS_ROOT, "public", filename)
+ File.join(::Rails.root, "public", filename)
end
end

0 comments on commit d0de221

Please sign in to comment.