Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Make TemplateRunner#generate accept any number of arguments

  • Loading branch information...
commit ef0b1cbb1b8e328fb3ac3b82ac5654bb95dbb2d6 1 parent 7c0dfa3
@lifo lifo authored
View
6 railties/lib/rails_generator/generators/applications/app/template_runner.rb
@@ -233,11 +233,11 @@ def initializer(filename, data = nil, &block)
#
# 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
Please sign in to comment.
Something went wrong with that request. Please try again.