module PrComet::CommandLine

To execute command line. You should inherit this class to use.

Attributes

verbose[R]

Private Instance Methods

execute(command) click to toggle source

Execute a command

@param command [String] The command you want to execute @return [String] The result in the execution

# File lib/pr_comet/command_line.rb, line 14
def execute(command)
  puts "$ #{command}" if verbose
  `#{command}`.chomp.tap do |result|
    color = $CHILD_STATUS.success? ? :green : :red
    puts Rainbow(result).color(color) if verbose
  end
end