lib/dummier/app_generator.rb in dummier-0.2.4 vs lib/dummier/app_generator.rb in dummier-0.3.0

- old
+ new

@@ -19,11 +19,11 @@ def initialize(root, options={}) @behavior = :invoke @root_path = File.expand_path(root) @destination_stack = [] @options = defaults.merge(options) - self.source_paths << File.join(root_path, "test", "dummy_hooks", "templates") + self.source_paths << File.join(root_path, "test/dummy_hooks/templates") self.destination_root = File.join(test_path, name) raise "Invalid directory!" unless File.directory?(@root_path) end # The name of the rails application @@ -78,10 +78,13 @@ file = File.join(root_path, "test/dummy_hooks/#{hook_name}.rb") say_status "hook", hook_name, File.exists?(file) ? :cyan : :red eval File.read(file) if File.exists?(file) rescue Exception => e say_status "failed", "#{hook_name} raised an exception", :red + say "*" * 60, :red say e.message.strip + "\n", :red + say e.backtrace.join("\n"), :red + raise ::Dummier::HookException, "Quitting, #{hook_name} raised an exception." end end # Runs the generator def run! \ No newline at end of file