diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-26 15:58:03 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-03-26 15:58:25 -0700 |
commit | 47db156d4273fbc79d20b7461e8419e13a796445 (patch) | |
tree | cf47354a0d4afdc24da0c4ad5acf9f3801e20e12 /railties/lib/rails | |
parent | a2126abc112187baa34c52dba8cbcdf47a9fc9aa (diff) | |
download | rails-47db156d4273fbc79d20b7461e8419e13a796445.tar.gz rails-47db156d4273fbc79d20b7461e8419e13a796445.tar.bz2 rails-47db156d4273fbc79d20b7461e8419e13a796445.zip |
stop using *args in order to simplify our constructor
Diffstat (limited to 'railties/lib/rails')
-rw-r--r-- | railties/lib/rails/paths.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 95229e35c1..f849d8bfc3 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -55,13 +55,13 @@ module Rails end def []=(path, value) - value = Path.new(self, path, value) unless value.is_a?(Path) + value = Path.new(self, path, [value].flatten) unless value.is_a?(Path) super(path, value) end def add(path, options={}) with = options[:with] || path - self[path] = Path.new(self, path, with, options) + self[path] = Path.new(self, path, [with].flatten, options) end def all_paths @@ -104,9 +104,8 @@ module Rails attr_reader :path attr_accessor :glob - def initialize(root, current, *paths) - options = paths.last.is_a?(::Hash) ? paths.pop : {} - super(paths.flatten) + def initialize(root, current, paths, options = {}) + super(paths) @current = current @root = root |