Sha256: f8292f48ef5dead8672df4dcd6db4c9c9ba55842158910d174a95f35a2db70ac

Contents?: true

Size: 1.08 KB

Versions: 94

Compression:

Stored size: 1.08 KB

Contents

class Tasks
	attr_accessor :env
	@@default=nil

	def initialize env=nil
		@@default=self
		@env=env
		@env=Environment.new if @env.nil?
	end

    def 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 execute_task task
		if(defined?(COMMANDS))
			if(COMMANDS.has_key?(task))
				puts DELIMITER if defined?(DEBUG)
				puts ":#{task}" if !@env.colorize?
				if @env.colorize?
					require 'ansi/code'
				   puts  ANSI.white + ANSI.bold + ":#{task}" + ANSI.reset if @env.colorize?
			    end
		  		execute(COMMANDS[task])
		    end
		end
	end

	def self.execute_task task
		@@default=Tasks.new if @@default.nil?
		@@default.execute_task task
	end
end

['add','analyze','build','clobber','commit',
 'doc','info','package','publish','pull','push','setup','test',
 'update'].each{|name| require_relative("tasks/#{name}.rb")}

Version data entries

94 entries across 94 versions & 1 rubygems

Version Path
dev-2.1.132 lib/tasks.rb
dev-2.1.131 lib/tasks.rb
dev-2.1.130 lib/tasks.rb
dev-2.1.129 lib/tasks.rb
dev-2.1.128 lib/tasks.rb
dev-2.1.127 lib/tasks.rb
dev-2.1.126 lib/tasks.rb
dev-2.1.125 lib/tasks.rb
dev-2.1.124 lib/tasks.rb
dev-2.1.123 lib/tasks.rb
dev-2.1.122 lib/tasks.rb
dev-2.1.121 lib/tasks.rb
dev-2.1.120 lib/tasks.rb
dev-2.1.119 lib/tasks.rb
dev-2.1.118 lib/tasks.rb
dev-2.1.117 lib/tasks.rb
dev-2.1.116 lib/tasks.rb
dev-2.1.115 lib/tasks.rb
dev-2.1.114 lib/tasks.rb
dev-2.1.113 lib/tasks.rb