Class: GitCommander::System Abstract
- Inherits:
-
Object
- Object
- GitCommander::System
- Includes:
- Singleton
- Defined in:
- lib/git_commander/system.rb
Overview
This class is abstract.
A wrapper for system calls
Defined Under Namespace
Constant Summary collapse
- DEFAULT_RUN_OPTIONS =
{ silent: false }.freeze
Class Method Summary collapse
-
.run(command_with_arguments, options = {}) ⇒ Object
Runs a system command.
-
.say(new_output) ⇒ Object
Appends to the output stream.
Class Method Details
.run(command_with_arguments, options = {}) ⇒ Object
Runs a system command
56 57 58 59 60 61 62 63 64 65 66 67 |
# File 'lib/git_commander/system.rb', line 56 def self.run(command_with_arguments, = {}) command = Command.new(command_with_arguments, ) command.run unless command.status.success? || command.[:blocking] == false raise RunError, "\"#{command.error}\" \"#{command.name}\" failed to run." end puts command.output if command.[:silent] == false command.output.strip end |
.say(new_output) ⇒ Object
Appends to the output stream
71 72 73 74 |
# File 'lib/git_commander/system.rb', line 71 def self.say(new_output) GitCommander.logger.info "[System#say] #{new_output}" puts new_output end |