Class: AutoTagger::Commander

Inherits:
Object
  • Object
show all
Defined in:
lib/auto_tagger/commander.rb

Instance Method Summary collapse

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


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