Sha256: e6bc2234d9b6d8045b4f57f6af39e18d3b795f5d6f5f4b26359e11b1a17dc082
Contents?: true
Size: 1.04 KB
Versions: 13
Compression:
Stored size: 1.04 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' 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 execute_command command puts Color.yellow + command + Color.clear puts " " if command.include?('<%') && command.include?('%>') ruby = command.gsub("<%","").gsub("%>","") eval(ruby) else puts `#{command}` if $? != 0 raise Color.bright_yellow + "`" + Color.green + command + Color.bright_yellow + "`" + Color.clear + " has exit code " + $?.to_s 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
13 entries across 13 versions & 1 rubygems