From 68ad9e39064d50261cfd0e26036400a552dfca39 Mon Sep 17 00:00:00 2001 From: Matt Bridges Date: Tue, 8 Jan 2013 22:22:18 -0600 Subject: use multiline do-end blocks and rearrange definition for clarity --- railties/lib/rails/paths.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'railties/lib/rails/paths.rb') 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 -- cgit v1.2.3