Skip to content

Commit

Permalink
Make TemplateRunner#generate accept any number of arguments
Browse files Browse the repository at this point in the history
  • Loading branch information
lifo committed Dec 3, 2008
1 parent 7c0dfa3 commit ef0b1cb
Showing 1 changed file with 3 additions and 3 deletions.
Expand Up @@ -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
Expand Down

0 comments on commit ef0b1cb

Please sign in to comment.