diff options
author | John Hawthorn <john@hawthorn.email> | 2019-07-25 16:31:08 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-07-25 16:31:08 -0700 |
commit | d45507b931d055c016ccf80185469730f034860b (patch) | |
tree | de3d6f2030a8151065fc6e74ac2e78929ee4bc18 /railties | |
parent | ec7aa03c984a0daeead4f71c7189d241139a6770 (diff) | |
parent | 13b2ca2031147ed2af6689c4a896aec0156582a8 (diff) | |
download | rails-d45507b931d055c016ccf80185469730f034860b.tar.gz rails-d45507b931d055c016ccf80185469730f034860b.tar.bz2 rails-d45507b931d055c016ccf80185469730f034860b.zip |
Merge pull request #36731 from jhawthorn/dir_glob_base_instead_of_chdir
Use Dir.glob(base: ...) to avoid chdir
Diffstat (limited to 'railties')
-rw-r--r-- | railties/lib/rails/paths.rb | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/railties/lib/rails/paths.rb b/railties/lib/rails/paths.rb index 838fe55acc..0664338e0b 100644 --- a/railties/lib/rails/paths.rb +++ b/railties/lib/rails/paths.rb @@ -223,12 +223,10 @@ module Rails private def files_in(path) - Dir.chdir(path) do - files = Dir.glob(@glob) - files -= @exclude if @exclude - files.map! { |file| File.join(path, file) } - files.sort - end + files = Dir.glob(@glob, base: path) + files -= @exclude if @exclude + files.map! { |file| File.join(path, file) } + files.sort end end end |