diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-09 08:00:17 -0800 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2013-01-09 08:00:17 -0800 |
commit | 2d33d7393d328b757190c5d4a74f64eaaa665f52 (patch) | |
tree | 74b2a3a59eef15705376df70a9de1a3d10d1003e /railties/lib/rails/paths.rb | |
parent | 66c8740b98a988fe8959782ca1158a9dcce6b4c6 (diff) | |
parent | 68ad9e39064d50261cfd0e26036400a552dfca39 (diff) | |
download | rails-2d33d7393d328b757190c5d4a74f64eaaa665f52.tar.gz rails-2d33d7393d328b757190c5d4a74f64eaaa665f52.tar.bz2 rails-2d33d7393d328b757190c5d4a74f64eaaa665f52.zip |
Merge pull request #8839 from mattdbridges/clarify_chdir
Clarify Dir.chdir definition
Diffstat (limited to 'railties/lib/rails/paths.rb')
-rw-r--r-- | railties/lib/rails/paths.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index e52d1a8b90..de6795eda2 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -55,8 +55,8 @@ module Rails 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 @@ 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 |