Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
stop using *args in order to simplify our constructor
  • Loading branch information
tenderlove committed Mar 26, 2012
1 parent a2126ab commit 47db156
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions railties/lib/rails/paths.rb
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 47db156

Please sign in to comment.