Sha256: 6b4e5fe59b0c85af17d85d52807a832289c1545511cb3ee9edabc72cda718d56
Contents?: true
Size: 1.2 KB
Versions: 4
Compression:
Stored size: 1.2 KB
Contents
require_relative './build.rb' require_relative './test.rb' require_relative './add.rb' require_relative './commit.rb' require_relative './publish.rb' require_relative './upgrade.rb' require_relative './timer.rb' class Commands < Hash attr_accessor :build def initialize self["build"] = Build.new self["test"] = Test.new self["add"] = Add.new self["commit"] = Commit.new self["publish"] = Publish.new self["upgrade"] = Upgrade.new end def update self["upgrade"].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 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
4 entries across 4 versions & 1 rubygems
Version | Path |
---|---|
dev_tasks-0.0.48 | lib/commands.rb |
dev_tasks-0.0.47 | lib/commands.rb |
dev_tasks-0.0.46 | lib/commands.rb |
dev_tasks-0.0.45 | lib/commands.rb |