diff options
Diffstat (limited to 'railties/lib/rails/paths.rb')
| -rw-r--r-- | railties/lib/rails/paths.rb | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 8af4130e87..de6795eda2 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -55,9 +55,9 @@ module Rails add(path, with: value, glob: glob) end - def add(path, options={}) - with = options[:with] || path - @root[path] = Path.new(self, path, [with].flatten, options) + def add(path, options = {}) + with = Array(options.fetch(:with, path)) + @root[path] = Path.new(self, path, with, options) end def [](path) @@ -189,9 +189,9 @@ module Rails path = File.expand_path(p, @root.path) if @glob && File.directory?(path) - result.concat Dir.chdir(path) { - Dir.glob(@glob).map { |file| File.join path, file }.sort - } + Dir.chdir(path) do + result.concat(Dir.glob(@glob).map { |file| File.join path, file }.sort) + end else result << path end |
