No commit activity in last 3 years
No release in over 3 years
Process wrapper which customizes output of the given command
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.17
~> 10.0
 Project Readme

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.