lib/tasks.rb in dev_tasks-1.0.41 vs lib/tasks.rb in dev_tasks-1.0.42

- old
+ new

@@ -1,74 +1,82 @@ -require 'rake' -require 'rake/clean' - -class Tasks - #@@commands=nil - @@quiet=false - - def self.quiet - @@quiet - end - - def self.execute value - if(value.respond_to?(:execute)) - value.update if value.respond_to?(:update) - value.execute - else - if(value.is_a?(String)) - puts `#{value}` - else - if(value.is_a?(Array)) - value.each{|e| execute(e)} - end - end - end - end - - def self.execute_task task - if(defined?(COMMANDS)) - if(COMMANDS.has_key?(task)) - puts "[:#{task}]" if(!Tasks.quiet) - Tasks.execute(COMMANDS[task]) - end - end - end -end - -desc 'performs a git pull' -task :pull do Tasks.execute_task :pull; end - -desc 'performs svn update' -task :update do Tasks.execute_task :update; end - -desc 'performs setup commands' -task :setup do Tasks.execute_task :setup;end - -desc 'performs build commands' -task :build do Tasks.execute_task :build;end - -desc 'performs test commands' -task :test => [:build] do Tasks.execute_task :test;end - -desc 'performs analyze commands' -task :analyze do Tasks.execute_task :analyze;end - -desc 'performs documentation commands' -task :doc do Tasks.execute_task :doc;end - -desc 'performs clean commands' -task :clean do Tasks.execute_task :clean;end - -desc 'performs publish commands' -task :publish do Tasks.execute_task :publish; end - -desc 'performs clobber commands' -task :clobber => [:clean] do Tasks.execute_task :clobber;end - -desc 'adds source files to git or subversion' -task :add do Tasks.execute_task :add;end - -desc 'commits source files to git or subversion' -task :commit do Tasks.execute_task :commit;end - -desc 'performs a git push' -task :push do Tasks.execute_task :push;end +require 'rake' +require 'rake/clean' + +class Tasks + #@@commands=nil + @@quiet=false + + def self.quiet + @@quiet + end + + def self.execute value + if(value.respond_to?(:execute)) + value.update if value.respond_to?(:update) + value.execute + else + if(value.is_a?(String)) + puts `#{value}` + else + if(value.is_a?(Array)) + value.each{|e| execute(e)} + end + end + end + end + + def self.execute_task task + if(defined?(COMMANDS)) + if(COMMANDS.has_key?(task)) + puts "[:#{task}]" if(!Tasks.quiet) + Tasks.execute(COMMANDS[task]) + end + end + end +end + +desc 'performs a git pull' +task :pull do Tasks.execute_task :pull; end + +desc 'performs svn update' +task :update do Tasks.execute_task :update; end + +desc 'performs setup commands' +task :setup do Tasks.execute_task :setup;end + +desc 'performs build commands' +task :build do Tasks.execute_task :build;end + +desc 'performs test commands' +task :test => [:build] do Tasks.execute_task :test;end + +desc 'performs analyze commands' +task :analyze do Tasks.execute_task :analyze;end + +desc 'performs documentation commands' +task :doc do Tasks.execute_task :doc;end + +desc 'performs clean commands' +task :clean do Tasks.execute_task :clean;end + +desc 'performs publish commands' +task :publish do Tasks.execute_task :publish; end + +desc 'performs clobber commands' +task :clobber => [:clean] do Tasks.execute_task :clobber;end + +desc 'adds source files to git or subversion' +task :add do Tasks.execute_task :add;end + +desc 'commits source files to git or subversion' +task :commit do Tasks.execute_task :commit;end + +desc 'performs a git push' +task :push do Tasks.execute_task :push;end + +desc 'displays project info' +task :info do + if(defined?(INFO)) + puts "[:#{task}]" if(!Tasks.quiet) + INFO.each{|l|puts l} + end +end \ No newline at end of file