Sha256: 3b2d1b0244a00e4627353acb29398dc4aecc6f72205631a4c93f8f9c473d7b29

Contents?: true

Size: 1.36 KB

Versions: 33

Compression:

Stored size: 1.36 KB

Contents

require_relative './build.rb'
require_relative './test.rb'
require_relative './add.rb'
require_relative './commit.rb'
require_relative './publish.rb'
require_relative './pull.rb'
require_relative './push.rb'
require_relative './setup.rb'
require_relative './upgrade.rb'
require_relative './timer.rb'
require_relative './verify.rb'

class Commands < Hash
  attr_accessor :build

  def initialize
    self[:pull] = Pull.new if(Environment.scm=='git' && Environment.scm_origin.length > 0)
    self[:upgrade] = Upgrade.new
	self[:setup] = Setup.new
    self[:build] = Build.new
	self[:test] = Test.new
	self[:add] = Add.new
	self[:commit] = Commit.new
	self[:push] = Push.new
	self[:verify] = Verify.new
	self[:publish] = Publish.new
  end

  def update
    self[:upgrade].update
	self[:setup].update
	self[:build].update
	self[:verify].update
	self[:publish].update
  end

  def execute_task task
    sym_task = task.to_sym
    if(self.has_key?(sym_task))
		self[sym_task].update
		if(self[sym_task].length>0)
			Logger.start_task task 
			self[sym_task].execute
			Logger.end_task task
		else
			self.delete sym_task
		end
    end	
  end


  def show
    self.each do |key,array|
	  if(array.length > 0)
	    puts key
	    array.each {|v|
	      puts "  " + Color.green + v + Color.clear + " "
	    }
	  end
	end
	puts " "
  end
end

Version data entries

33 entries across 33 versions & 1 rubygems

Version Path
dev_tasks-1.0.29 lib/commands.rb
dev_tasks-1.0.28 lib/commands.rb
dev_tasks-1.0.27 lib/commands.rb
dev_tasks-1.0.26 lib/commands.rb
dev_tasks-1.0.25 lib/commands.rb
dev_tasks-1.0.24 lib/commands.rb
dev_tasks-1.0.23 lib/commands.rb
dev_tasks-1.0.22 lib/commands.rb
dev_tasks-1.0.21 lib/commands.rb
dev_tasks-1.0.20 lib/commands.rb
dev_tasks-1.0.19 lib/commands.rb
dev_tasks-1.0.18 lib/commands.rb
dev_tasks-1.0.17 lib/commands.rb
dev_tasks-1.0.16 lib/commands.rb
dev_tasks-1.0.15 lib/commands.rb
dev_tasks-1.0.14 lib/commands.rb
dev_tasks-1.0.13 lib/commands.rb
dev_tasks-1.0.12 lib/commands.rb
dev_tasks-1.0.11 lib/commands.rb
dev_tasks-1.0.10 lib/commands.rb