Generator is anything what provides #generate method.
This commit is contained in:
parent
7cca9306a8
commit
dc07c46577
1 changed files with 6 additions and 6 deletions
12
bin/ace
12
bin/ace
|
@ -52,14 +52,14 @@ end
|
||||||
|
|
||||||
puts
|
puts
|
||||||
|
|
||||||
rules.generators.each do |generator_klass|
|
# Generator is anything what provides #generate method.
|
||||||
puts "~ Running #{generator_klass}"
|
rules.generators.each do |generator|
|
||||||
generator = generator_klass.new
|
puts "~ Running generator #{generator}"
|
||||||
begin
|
begin
|
||||||
if generator.respond_to?(:run)
|
if generator.respond_to?(:generate)
|
||||||
generator.run
|
generator.generate
|
||||||
else
|
else
|
||||||
abort "Generator #{generator.inspect} doesn't respond to the #run method!"
|
abort "Generator #{generator.inspect} doesn't respond to the #generate method!"
|
||||||
end
|
end
|
||||||
rescue Exception => exception
|
rescue Exception => exception
|
||||||
puts "Error in generator #{generator.inspect}: #{exception.message}"
|
puts "Error in generator #{generator.inspect}: #{exception.message}"
|
||||||
|
|
Loading…
Reference in a new issue