aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2012-03-29 14:54:03 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2012-03-29 14:54:03 -0700
commit1555023973d2f60050f16b055335abc4e038e20f (patch)
treedc162d6951dfed9384642ec2146a3801742a6ad5
parente51322a34b740a4ad3b651345e2420912fe2a15f (diff)
parentcec170b9634b4028681eb227a36664e930aed4ca (diff)
downloadrails-1555023973d2f60050f16b055335abc4e038e20f.tar.gz
rails-1555023973d2f60050f16b055335abc4e038e20f.tar.bz2
rails-1555023973d2f60050f16b055335abc4e038e20f.zip
Merge pull request #5617 from Empact/paths
Spring cleaning in Rails::Paths
-rw-r--r--railties/lib/rails/paths.rb6
-rw-r--r--railties/test/paths_test.rb4
2 files changed, 1 insertions, 9 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb
index 9730ed16e9..e9bd0f181e 100644
--- a/railties/lib/rails/paths.rb
+++ b/railties/lib/rails/paths.rb
@@ -1,5 +1,3 @@
-require 'set'
-
module Rails
module Paths
# This object is an extended hash that behaves as root of the <tt>Rails::Paths</tt> system.
@@ -47,15 +45,13 @@ module Rails
attr_accessor :path
def initialize(path)
- raise "Argument should be a String of the physical root path" if path.is_a?(Array)
@current = nil
@path = path
@root = {}
end
def []=(path, value)
- value = Path.new(self, path, [value].flatten) unless value.is_a?(Path)
- @root[path] = value
+ add(path, :with => value)
end
def add(path, options={})
diff --git a/railties/test/paths_test.rb b/railties/test/paths_test.rb
index f30bbbc6f5..d334034e7d 100644
--- a/railties/test/paths_test.rb
+++ b/railties/test/paths_test.rb
@@ -91,10 +91,6 @@ class PathsTest < ActiveSupport::TestCase
assert_equal ["/foo/bar/app2", "/foo/bar/app"], @root["app"].to_a
end
- test "the root can only have one physical path" do
- assert_raise(RuntimeError) { Rails::Paths::Root.new(["/fiz", "/biz"]) }
- end
-
test "it is possible to add a path that should be autoloaded only once" do
@root.add "app", :with => "/app"
@root["app"].autoload_once!