Skip to content

Dan2552/process_output_wrapper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ProcessOutputWrapper

Installation

Add this line to your application's Gemfile:

gem 'process_output_wrapper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install process_output_wrapper

Usage

Here's an example:

include ProcessOutputWrapper::DSL

run_this "echo hello; echo hi; echo hey" do
  whenever { line.start_with?("he") }
    .do { puts(line + " world") }
end

Which outputs the following:

hello world
hey world

Within the do block, you can toggle state on whether output should be filtered using print_normally! and print_wrapped!.

If the Ruby process is run with the environment variable VERBOSE=true, the output of the process would print as normal.

License

The gem is available as open source under the terms of the MIT License.

About

Ruby gem - Process wrapper which customizes output of the given command

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors