Skip to content

Instantly share code, notes, and snippets.

@miyucy
Created July 23, 2009 10:06
Show Gist options
  • Save miyucy/152644 to your computer and use it in GitHub Desktop.
Save miyucy/152644 to your computer and use it in GitHub Desktop.
generator ruby19 compat
--- /ruby/ruby187/lib/ruby/gems/1.8/gems/rails-2.3.3/lib/rails_generator/options.rb 2009-07-23 18:56:58.000000000 +0900
+++ /ruby/ruby191/lib/ruby/gems/1.9.1/gems/rails-2.3.3/lib/rails_generator/options.rb 2009-07-23 12:00:58.000000000 +0900
@@ -137,7 +137,7 @@
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|
+ options[:git] = `git status`.split($/).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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment