Skip to content

Commit

Permalink
1.9 compat: let -g option work with Ruby 1.9
Browse files Browse the repository at this point in the history
[#3105 state:committed milestone:2.3.5]

Signed-off-by: Jeremy Kemper <jeremy@bitsweat.net>
  • Loading branch information
amatsuda authored and jeremy committed Sep 12, 2009
1 parent 5de7539 commit 028d449
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions railties/lib/rails_generator/options.rb
Expand Up @@ -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
Expand Down

0 comments on commit 028d449

Please sign in to comment.