Sha256: d9d5cb2382a5471003b8b09c97cf36fd41e44d0b1286f04368e0c530abc43f96

Contents?: true

Size: 1.84 KB

Versions: 2

Compression:

Stored size: 1.84 KB

Contents

require 'rake'
require 'rake/clean'

class Tasks
	@@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) && INFO.length > 0)
		puts "[:info]" if(!Tasks.quiet)
		INFO.each{|l|puts l}
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dev-2.0.141 lib/tasks.rb
dev-2.0.140 lib/tasks.rb