All Projects → square → Build_execution

square / Build_execution

Licence: apache-2.0
Execution primitives that force explicit error handling and never call the shell.

Programming Languages

ruby
36898 projects - #4 most used programming language

build_execution gem

Execution primitives that force explicit error handling and never call the shell.

How to use

The interface is similar to Open3.capture2e. We print the command to stdout before running it (unless :quiet=> true). By default the command process shares the calling process's stdout, but this can be changed. Options passed to fail_on_error are passed through to popen2e.

> require 'build_execution'
> fail_on_error('/bin/echo', '-n', 'asdf')
Running Command:
"/bin/echo" "-n" "asdf"
asdf => "asdf"
> fail_on_error('/bin/echo', '-n', 'asdf', :quiet=>true)
 => "asdf"
 >

fail_pipe_on_error has a similar interface, but it takes lists of commands similar to Open3.pipeline. Any additional options are passed to Open3.pipeline_r under the hood.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].