Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

1.9 compat: let -g option work with Ruby 1.9

[#3105 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information...
commit 028d449fe9d727650ca47318d5e8615dfc7bc7a8 1 parent 5de7539
@amatsuda amatsuda authored jeremy committed
Showing with 4 additions and 4 deletions.
  1. +4 −4 railties/lib/rails_generator/options.rb
View
8 railties/lib/rails_generator/options.rb
@@ -137,10 +137,10 @@ def add_general_options!(opt)
end
end
opt.on('-g', '--git', 'Modify files with git. (Note: git must be in path)') do
- options[:git] = `git status`.inject({:new => {}, :modified => {}}) do |opt, e|
- opt[:new][e.chomp[14..-1]] = true if e =~ /new file:/
- opt[:modified][e.chomp[14..-1]] = true if e =~ /modified:/
- opt
+ options[:git] = {:new => {}, :modified => {}}
+ `git status`.each_line do |line|
+ options[:git][:new][line.chomp[14..-1]] = true if line =~ /new file:/
+ options[:git][:modified][line.chomp[14..-1]] = true if line =~ /modified:/
end
end
end
Please sign in to comment.
Something went wrong with that request. Please try again.