From dc07c46577793a718a8ef90f23505caa9bb15b86 Mon Sep 17 00:00:00 2001 From: Jakub Stastny aka botanicus Date: Thu, 3 Mar 2011 16:13:55 +0000 Subject: [PATCH] Generator is anything what provides #generate method. --- bin/ace | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/ace b/bin/ace index 6de2f57..691e64b 100755 --- a/bin/ace +++ b/bin/ace @@ -52,14 +52,14 @@ end puts -rules.generators.each do |generator_klass| - puts "~ Running #{generator_klass}" - generator = generator_klass.new +# Generator is anything what provides #generate method. +rules.generators.each do |generator| + puts "~ Running generator #{generator}" begin - if generator.respond_to?(:run) - generator.run + if generator.respond_to?(:generate) + generator.generate else - abort "Generator #{generator.inspect} doesn't respond to the #run method!" + abort "Generator #{generator.inspect} doesn't respond to the #generate method!" end rescue Exception => exception puts "Error in generator #{generator.inspect}: #{exception.message}"