Created
January 26, 2011 16:07
-
-
Save lusis/796928 to your computer and use it in GitHub Desktop.
Add this to disable irb echo
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# via http://tagaholic.me/2009/05/29/exploring-how-to-configure-irb.html#echo | |
def irb_verbosity_toggle | |
irb_context.echo ? irb_context.echo = false : irb_context.echo = true | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A much more concise version, but the first line below can throw an exception if echo is set to a non-boolean class
Do an XOR with true to toggle the value
irb_context.echo ^= true
Or not itself
irb_context.echo = !irb_context.echo