lib/straight_line/common/configure.rb in straight_line-0.1.2.0 vs lib/straight_line/common/configure.rb in straight_line-0.1.3.0

- old
+ new

@@ -1,16 +1,21 @@ require 'rake' require 'straight_line/common/command' +require 'straight_line/common/util' # Configuration class to add tasks to the straightline rake config class Configure def add(name, type, command, opts = {}) Rake.application.in_namespace StraightLine::TASK_NAMESPACE do Rake::Task.define_task name => opts[:before] do if type == :shell cmd = Command.new command + Util.logger.puts "executing command #{command}. Error results will be + displayed if any ocur" cmd.run elsif !name.nil? + Util.logger.puts "executing task #{command}. Error results will be + displayed if any ocur" Rake::Task[command].invoke end run_after_commands(opts) end end