aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Kemper <jeremy@bitsweat.net>2005-11-10 16:14:25 +0000
committerJeremy Kemper <jeremy@bitsweat.net>2005-11-10 16:14:25 +0000
commitdfda57af8547798ebedd7f79603431137b9e5904 (patch)
treee380fedd0879d441202dab7646ca2a4fa91ea09c
parentdf5c74cc7c9c061d6c08b0c398990d295ba35717 (diff)
downloadrails-dfda57af8547798ebedd7f79603431137b9e5904.tar.gz
rails-dfda57af8547798ebedd7f79603431137b9e5904.tar.bz2
rails-dfda57af8547798ebedd7f79603431137b9e5904.zip
Better svn status matching for generators. Closes #2814.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@2972 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--railties/CHANGELOG2
-rw-r--r--railties/lib/rails_generator/options.rb7
2 files changed, 8 insertions, 1 deletions
diff --git a/railties/CHANGELOG b/railties/CHANGELOG
index b16432da18..55b1a4d7ae 100644
--- a/railties/CHANGELOG
+++ b/railties/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*
+* Better svn status matching for generators. #2814 [François Beausoleil <francois.beausoleil@gmail.com>, Blair Zajac <blair@orcaware.com>]
+
* Don't reload routes until plugins have been loaded so they have a chance to extend the routing capabilities [DHH]
* Don't detach or fork for script/server tailing [Nicholas Seckar]
diff --git a/railties/lib/rails_generator/options.rb b/railties/lib/rails_generator/options.rb
index 5a0aa9f59c..df9737f13f 100644
--- a/railties/lib/rails_generator/options.rb
+++ b/railties/lib/rails_generator/options.rb
@@ -127,7 +127,12 @@ module Rails
opt.on('-q', '--quiet', 'Suppress normal output.') { |options[:quiet]| }
opt.on('-t', '--backtrace', 'Debugging: show backtrace on errors.') { |options[:backtrace]| }
opt.on('-h', '--help', 'Show this help message.') { |options[:help]| }
- opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') { options[:svn] = Hash[*`svn status`.collect { |e| e.chop.split.reverse unless e.chop.split.size != 2 }.flatten] }
+ opt.on('-c', '--svn', 'Modify files with subversion. (Note: svn must be in path)') do
+ options[:svn] = `svn status`.inject({}) do |opt, e|
+ opt[e.chomp[7..-1]] = true
+ opt
+ end
+ end
end
end