Project

quietly

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
Quietly aims to make dealing with IO redirection easy. It originally started as a simple function to silence output to stdout within a certain block, cleaning up and abstracting away the process of dealing with the IO pointers. Eventually, it expanded into a simple but effective tool for dealing with any instance where you need to redirect, split, or silence output.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies
 Project Readme

Quietly aims to make dealing with IO redirection easy. It originally started as a simple function to silence output to stdout within a certain block, cleaning up and abstracting away the process of dealing with the IO pointers. Eventually, it expanded into a simple but effective tool for dealing with any instance where you need to redirect, split, or silence output.

Quietly doesn’t namespace it’s functions. This increases the risk of conflict, but makes it much cleaner to use. All of Quietly’s functions will automatically be added to the global namespace as soon as you require the gem.

You can silence stdout output with

quietly do ... end

You can silence both stdout and stderr with

silently do ... end

You can split output between multiple IO streams with

converse io1, io2, io3, ... do ... end

You can redirect all output to a specific IO stream with

whisper io do ... end

Quietly also defines a simple Quietly::JointIO class that can take an arbitrary number of IOs and write to them all whenever it is written to. It’s likely not the most robust or reliable implementation, but it does it’s job. You shouldn’t generally need to use it manually - it’s mainly used by the converse function - but it’s available for manual use as well.