Permalink
Browse files

Merge pull request #8839 from mattdbridges/clarify_chdir

Clarify Dir.chdir definition
  • Loading branch information...
2 parents 66c8740 + 68ad9e3 commit 2d33d7393d328b757190c5d4a74f64eaaa665f52 @rafaelfranca rafaelfranca committed Jan 9, 2013
Showing with 5 additions and 5 deletions.
  1. +5 −5 railties/lib/rails/paths.rb
@@ -55,8 +55,8 @@ def []=(path, value)
add(path, with: value, glob: glob)
end
- def add(path, options={})
- with = Array(options[:with] || path)
+ def add(path, options = {})
+ with = Array(options.fetch(:with, path))
@root[path] = Path.new(self, path, with, options)
end
@@ -189,9 +189,9 @@ def expanded
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

0 comments on commit 2d33d73

Please sign in to comment.