Class: TasteTester::LocalLink

Inherits:
Object
  • Object
show all
Includes:
BetweenMeals::Util, Logging
Defined in:
lib/taste_tester/locallink.rb

Overview

Wrapper for running commands on local system

Instance Method Summary collapse

Methods included from Logging

#formatter, formatterproc=, logger, #logger, use_log_formatter=, verbosity=

Constructor Details

#initializeLocalLink

Returns a new instance of LocalLink.



25
26
27
28
# File 'lib/taste_tester/locallink.rb', line 25

def initialize
  @host = 'localhost'
  @cmds = []
end

Instance Method Details

#add(string) ⇒ Object Also known as: <<



30
31
32
# File 'lib/taste_tester/locallink.rb', line 30

def add(string)
  @cmds << string
end

#error!Object



47
48
49
# File 'lib/taste_tester/locallink.rb', line 47

def error!
  fail TasteTester::Exceptions::LocalLinkError
end

#runObject



36
37
38
# File 'lib/taste_tester/locallink.rb', line 36

def run
  exec(cmd, logger)
end

#run!Object



40
41
42
43
44
45
# File 'lib/taste_tester/locallink.rb', line 40

def run!
  exec!(cmd, logger)
rescue StandardError => e
  logger.error(e.message)
  error!
end