Sha256: 0e298306ada88c5aa38dc163b5f4c75519cf23eba10454b5e539e331851575f6
Contents?: true
Size: 1.51 KB
Versions: 27
Compression:
Stored size: 1.51 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 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[:verify].update self[:publish].update end def execute_command command print " " + Color.green + command + Color.clear timer=Timer.new if command.include?('<%') && command.include?('%>') ruby = command.gsub("<%","").gsub("%>","") eval(ruby) puts " " + timer.elapsed_str else out = `#{command}` if $? != 0 puts out raise Color.yellow + "`" + Color.green + command + Color.yellow + "`" + Color.clear + " has exit code " + $?.to_s + " " + out else puts " " + timer.elapsed_str 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
27 entries across 27 versions & 1 rubygems