Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

stop using *args in order to simplify our constructor

  • Loading branch information...
commit 47db156d4273fbc79d20b7461e8419e13a796445 1 parent a2126ab
@tenderlove tenderlove authored
Showing with 4 additions and 5 deletions.
  1. +4 −5 railties/lib/rails/paths.rb
View
9 railties/lib/rails/paths.rb
@@ -55,13 +55,13 @@ def initialize(path)
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 @@ class Path < Array
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
Please sign in to comment.
Something went wrong with that request. Please try again.