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.72 lib/tasks.rb
dev-2.1.71 lib/tasks.rb
dev-2.1.70 lib/tasks.rb
dev-2.1.69 lib/tasks.rb
dev-2.1.68 lib/tasks.rb
dev-2.1.67 lib/tasks.rb
dev-2.1.66 lib/tasks.rb
dev-2.1.65 lib/tasks.rb
dev-2.1.64 lib/tasks.rb
dev-2.1.63 lib/tasks.rb
dev-2.1.62 lib/tasks.rb
dev-2.1.61 lib/tasks.rb
dev-2.1.60 lib/tasks.rb
dev-2.1.59 lib/tasks.rb