Sha256: faa7feeeb67a2911c994600031100373b21195c653cd8e9a1bdf1e54b8a30e46

Contents?: true

Size: 1.86 KB

Versions: 43

Compression:

Stored size: 1.86 KB

Contents

require 'rake'
require 'rake/clean'

class Tasks
	#@@commands=nil
	@@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

43 entries across 43 versions & 1 rubygems

Version Path
dev-2.0.139 lib/tasks.rb
dev-2.0.138 lib/tasks.rb
dev-2.0.137 lib/tasks.rb
dev-2.0.136 lib/tasks.rb
dev-2.0.135 lib/tasks.rb
dev-2.0.134 lib/tasks.rb
dev-2.0.133 lib/tasks.rb
dev-2.0.132 lib/tasks.rb
dev-2.0.131 lib/tasks.rb
dev-2.0.130 lib/tasks.rb
dev-2.0.129 lib/tasks.rb
dev-2.0.128 lib/tasks.rb
dev-2.0.127 lib/tasks.rb
dev-2.0.126 lib/tasks.rb
dev-2.0.124 lib/tasks.rb
dev-2.0.123 lib/tasks.rb
dev-2.0.122 lib/tasks.rb
dev-2.0.121 lib/tasks.rb
dev-2.0.119 lib/tasks.rb
dev-2.0.118 lib/tasks.rb