aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJohn Hawthorn <john@hawthorn.email>2019-07-20 22:59:00 -0700
committerJohn Hawthorn <john@hawthorn.email>2019-07-22 14:40:51 -0700
commit13b2ca2031147ed2af6689c4a896aec0156582a8 (patch)
tree3f369a3b41e215599dda1444c4a830fddf08c18f /railties
parent2ee75971ef52a0c8faedf32f28b66bf64efa6a49 (diff)
downloadrails-13b2ca2031147ed2af6689c4a896aec0156582a8.tar.gz
rails-13b2ca2031147ed2af6689c4a896aec0156582a8.tar.bz2
rails-13b2ca2031147ed2af6689c4a896aec0156582a8.zip
Use Dir.glob(base: ...) to avoid chdir
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/paths.rb10
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