Permalink
Browse files

use multiline do-end blocks and rearrange definition for clarity

  • Loading branch information...
mdespuits committed Jan 9, 2013
1 parent 5d0d829 commit 68ad9e39064d50261cfd0e26036400a552dfca39
Showing with 5 additions and 5 deletions.
  1. +5 −5 railties/lib/rails/paths.rb
@@ -55,8 +55,8 @@ def []=(path, value)
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 @@ def expanded
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

0 comments on commit 68ad9e3

Please sign in to comment.