Class: AutoTagger::Commander
- Inherits:
-
Object
- Object
- AutoTagger::Commander
- Defined in:
- lib/auto_tagger/commander.rb
Instance Method Summary collapse
- #execute(cmd) ⇒ Object
-
#initialize(path, verbose) ⇒ Commander
constructor
A new instance of Commander.
- #print(cmd) ⇒ Object
- #read(cmd) ⇒ Object
Constructor Details
#initialize(path, verbose) ⇒ Commander
Returns a new instance of Commander.
4 5 6 7 |
# File 'lib/auto_tagger/commander.rb', line 4 def initialize(path, verbose) @path = path @verbose = verbose end |
Instance Method Details
#execute(cmd) ⇒ Object
18 19 20 21 |
# File 'lib/auto_tagger/commander.rb', line 18 def execute(cmd) puts command_in_context(cmd) if @verbose system command_in_context(cmd) end |
#print(cmd) ⇒ Object
9 10 11 |
# File 'lib/auto_tagger/commander.rb', line 9 def print(cmd) puts command_in_context(cmd) end |
#read(cmd) ⇒ Object
13 14 15 16 |
# File 'lib/auto_tagger/commander.rb', line 13 def read(cmd) puts command_in_context(cmd) if @verbose `#{command_in_context(cmd)}` end |