Class: HereOrThere::Local

Inherits:
Object
  • Object
show all
Defined in:
lib/here_or_there/local.rb

Instance Method Summary collapse

Instance Method Details

#run(command) {|response| ... } ⇒ Object

Yields:

  • (response)


4
5
6
7
8
9
10
11
# File 'lib/here_or_there/local.rb', line 4

def run command, &block
  stdout, stderr, status = Open3.capture3(command)
  response = Response.new( stdout, stderr, status.success? )

  yield response if block_given?

  return response
end