Class: KUtil::Open3Helper

Inherits:
Object
  • Object
show all
Defined in:
lib/k_util/open3_helper.rb

Overview

Helper methods attached to the namespace to run Open3 commands

Instance Method Summary collapse

Instance Method Details

#capture2(cmd, **opts) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/k_util/open3_helper.rb', line 7

def capture2(cmd, **opts)
  output, status = Open3.capture2(cmd, **opts)

  unless status.success?
    puts "failed to run command: #{cmd}"
    # bxxxinding.pry
  end

  raise Open3Error unless status.success?

  output
end