Module: RightGit::Shell::Interface
- Included in:
- Default
- Defined in:
- lib/right_git/shell/interface.rb
Overview
Interface for a shell intended to work with RightGit.
Instance Method Summary collapse
-
#default_logger ⇒ Logger
Provides a default logger object (overridable).
-
#execute(cmd, options = {}) ⇒ Integer
Run the given command and print the output to stdout.
-
#output_for(cmd, options = {}) ⇒ Object
Invoke a shell command and return its output as a string, similar to backtick but defaulting to raising exception on failure.
Instance Method Details
#default_logger ⇒ Logger
Provides a default logger object (overridable).
37 38 39 |
# File 'lib/right_git/shell/interface.rb', line 37 def default_logger @default_logger ||= ::Logger.new(STDOUT) end |
#execute(cmd, options = {}) ⇒ Integer
Run the given command and print the output to stdout.
Must be overridden.
57 58 59 |
# File 'lib/right_git/shell/interface.rb', line 57 def execute(cmd, = {}) raise NotImplementedError end |
#output_for(cmd, options = {}) ⇒ Object
Invoke a shell command and return its output as a string, similar to backtick but defaulting to raising exception on failure.
Must be overridden.
70 71 72 |
# File 'lib/right_git/shell/interface.rb', line 70 def output_for(cmd, = {}) raise NotImplementedError end |