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

- old
+ new

@@ -1,27 +1,12 @@ require 'rake' require 'rake/clean' class Tasks - @@commands=nil + #@@commands=nil @@quiet=false - def self.commands - if(@@commands.nil?) - @@commands=Hash.new - [:pull,:update,:build,:test,:analyze,:doc,:clean,:publish,:clobber,:add,:commit,:push].each{|k| @@commands[k]=[]} - end - @@commands - end - - def self.initialize commands - @@commands=commands - [:pull,:update,:build,:test,:analyze,:doc,:clean,:publish,:clobber,:add,:commit,:push].each{|k| - @@commands[k]=[] if(!@@commands.has_key?(k)) - } - end - def self.quiet @@quiet end def self.execute value @@ -38,13 +23,15 @@ end end end def self.execute_task task - if(Tasks.commands.has_key?(task)) - puts "[:#{task}]" if(!Tasks.quiet) - Tasks.execute(Tasks.commands[task]) - end + 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 \ No newline at end of file