Permalink
Browse files

Merge pull request #5617 from Empact/paths

Spring cleaning in Rails::Paths
  • Loading branch information...
2 parents e51322a + cec170b commit 1555023973d2f60050f16b055335abc4e038e20f @tenderlove tenderlove committed Mar 29, 2012
Showing with 1 addition and 9 deletions.
  1. +1 −5 railties/lib/rails/paths.rb
  2. +0 −4 railties/test/paths_test.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 @@ class Root
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={})
@@ -91,10 +91,6 @@ def setup
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!

0 comments on commit 1555023

Please sign in to comment.