diff options
author | José Valim <jose.valim@gmail.com> | 2009-06-26 19:14:55 +0200 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2009-06-26 19:14:55 +0200 |
commit | 5ef1d9706bfca6362a6eb29820affb98af17e400 (patch) | |
tree | a9b8a4dc1ecdd38e2ba9d03e897fd2161f8b553b /railties/bin/gen | |
parent | 3a0619f1bbd44763a827f9f13bccecb597a855db (diff) | |
download | rails-5ef1d9706bfca6362a6eb29820affb98af17e400.tar.gz rails-5ef1d9706bfca6362a6eb29820affb98af17e400.tar.bz2 rails-5ef1d9706bfca6362a6eb29820affb98af17e400.zip |
Added Rails::Generators.find_by_namespace.
Diffstat (limited to 'railties/bin/gen')
-rwxr-xr-x | railties/bin/gen | 10 |
1 files changed, 2 insertions, 8 deletions
diff --git a/railties/bin/gen b/railties/bin/gen index 036b1d8275..a6363edd54 100755 --- a/railties/bin/gen +++ b/railties/bin/gen @@ -34,15 +34,9 @@ Rails::Generators.builtin.each do |group, name| require "generators/#{group}/#{name}/#{name}_generator" end -name = ARGV.shift -middle = name.sub(':', ':generators:') if name.count(':') == 1 -full = "rails:generators:#{name}" if name.count(':') == 0 +name = ARGV.shift -if full && klass = Thor::Util.find_by_namespace(full) - klass.start -elsif middle && klass = Thor::Util.find_by_namespace(middle) - klass.start -elsif klass = Thor::Util.find_by_namespace(name) +if klass = Rails::Generators.find_by_namespace(name, "rails") klass.start else puts "Could not find generator #{name}." |