lib/percy/capybara/loaders/base_loader.rb in percy-capybara-3.0.1 vs lib/percy/capybara/loaders/base_loader.rb in percy-capybara-3.0.2
- old
+ new
@@ -142,20 +142,13 @@
resources
end
# A simplified version of Find.find that only returns files and follows symlinks.
def _find_files(*paths)
- paths.flatten!
- paths.map! { |p| Pathname.new(p) }
- files = []
- paths.each do |path|
- if path.file?
- files << path.to_s
- else
- files = files.concat(_find_files(path.children))
- end
- end
- files
+ paths.flatten.map do |path|
+ path = Pathname.new(path)
+ path.file? ? [path.to_s] : _find_files(path.children)
+ end.flatten
end
def _uri_join(*paths)
# We must swap File::SEPARATOR for '/' here because on Windows File.join
# will use backslashes and this is a URL.