class GitCommander::System

@abstract A wrapper for system calls

Constants

DEFAULT_RUN_OPTIONS

Public Class Methods

run(command_with_arguments, options = {}) click to toggle source

Runs a system command @param [String] command_with_arguments the command string (with args, flags and switches) to run @param [Hash] options the options to run the command with @option options [Boolean] :silent Supress the output of the command @option options [Boolean] :blocking Supress errors running the command

# File lib/git_commander/system.rb, line 56
def self.run(command_with_arguments, options = {})
  command = Command.new(command_with_arguments, options)

  command.run

  unless command.status.success? || command.options[:blocking] == false
    raise RunError, "\"#{command.error}\" \"#{command.name}\" failed to run."
  end

  puts command.output if command.options[:silent] == false
  command.output.strip
end
say(new_output) click to toggle source

Appends to the output stream @param [String] new_output the string to add to the output stream

# File lib/git_commander/system.rb, line 71
def self.say(new_output)
  GitCommander.logger.info "[System#say] #{new_output}"
  puts new_output
end