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

Raises:



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

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

  unless success?
    binding.pry
  end

  raise Open3Error unless status.success?

  output
end