diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2008-12-03 22:05:35 +0100 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2008-12-03 22:05:54 +0100 |
commit | ef0b1cbb1b8e328fb3ac3b82ac5654bb95dbb2d6 (patch) | |
tree | fabfe4ea2f3fe8adad8c2198b7c386a9605bc106 /railties/lib/rails_generator | |
parent | 7c0dfa35dbcfdb60f4cbd07b55f194a04e1b48c1 (diff) | |
download | rails-ef0b1cbb1b8e328fb3ac3b82ac5654bb95dbb2d6.tar.gz rails-ef0b1cbb1b8e328fb3ac3b82ac5654bb95dbb2d6.tar.bz2 rails-ef0b1cbb1b8e328fb3ac3b82ac5654bb95dbb2d6.zip |
Make TemplateRunner#generate accept any number of arguments
Diffstat (limited to 'railties/lib/rails_generator')
-rw-r--r-- | railties/lib/rails_generator/generators/applications/app/template_runner.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/railties/lib/rails_generator/generators/applications/app/template_runner.rb b/railties/lib/rails_generator/generators/applications/app/template_runner.rb index 0083e0d5a5..d9261ebe8f 100644 --- a/railties/lib/rails_generator/generators/applications/app/template_runner.rb +++ b/railties/lib/rails_generator/generators/applications/app/template_runner.rb @@ -233,11 +233,11 @@ module Rails # # generate(:authenticated, "user session") # - def generate(what, args = nil) + def generate(what, *args) puts "generating #{what}" - args = args.join(" ") if args.class == Array + argument = args.map(&:to_s).flatten.join(" ") - in_root { `#{root}/script/generate #{what} #{args}` } + in_root { `#{root}/script/generate #{what} #{argument}` } end # Executes a command |