aboutsummaryrefslogtreecommitdiffstats
path: root/railties/lib/rails/paths.rb
diff options
context:
space:
mode:
authorMatt Bridges <mbridges.91@gmail.com>2013-01-08 22:22:18 -0600
committerMatt Bridges <mbridges.91@gmail.com>2013-01-09 09:53:29 -0600
commit68ad9e39064d50261cfd0e26036400a552dfca39 (patch)
treea11d1c2017067edc26c18a9d4d148a487937bdb6 /railties/lib/rails/paths.rb
parent5d0d82957ae2658a576f5785506a52cfe03d0758 (diff)
downloadrails-68ad9e39064d50261cfd0e26036400a552dfca39.tar.gz
rails-68ad9e39064d50261cfd0e26036400a552dfca39.tar.bz2
rails-68ad9e39064d50261cfd0e26036400a552dfca39.zip
use multiline do-end blocks and rearrange definition for clarity
Diffstat (limited to 'railties/lib/rails/paths.rb')
-rw-r--r--railties/lib/rails/paths.rb10
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