Module: FPM::Fry::Exec
- Defined in:
- lib/fpm/fry/exec.rb
Defined Under Namespace
Classes: Failed
Class Method Summary collapse
-
.[](*cmd, options = {}) ⇒ String
(also: exec)
Stdout.
-
.popen(*cmd, options = {}) ⇒ IO
Stdout.
Class Method Details
.[](*cmd, options = {}) ⇒ String Also known as: exec
Returns stdout.
30 31 32 33 34 35 36 37 |
# File 'lib/fpm/fry/exec.rb', line 30 def [](*args) cmd, , description = (args) stdout, stderr, status = Open3.capture3(*cmd, ) if status.exitstatus != 0 raise Exec.const_get("ExitCode#{status.exitstatus}").new("#{description} failed", exitstatus: status.exitstatus, stderr: stderr, stdout: stdout, command: cmd) end return stdout end |
.popen(*cmd, options = {}) ⇒ IO
Returns stdout.
48 49 50 51 |
# File 'lib/fpm/fry/exec.rb', line 48 def popen(*args) cmd, , _description = (args) return IO.popen(cmd, ) end |