Sha256: 97e62dad7abc9adef88e2c5ab5602da4aa0c9dd7d921a39c81cdb271811ba6cf
Contents?: true
Size: 999 Bytes
Versions: 3
Compression:
Stored size: 999 Bytes
Contents
require_relative './build.rb' require_relative './test.rb' require_relative './add.rb' require_relative './commit.rb' require_relative './publish.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 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
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
dev_tasks-0.0.22 | lib/commands.rb |
dev_tasks-0.0.21 | lib/commands.rb |
dev_tasks-0.0.20 | lib/commands.rb |