IRB Console with history and logging

I spend most of my time working with IRB or Rails/console. I have settled on these settings over time as they provide basic logging and IRB history. To use them, simply add the following lines to the ~/.irbrc file (create the file if it doesn’t already exist):



, , ,



4 responses to “IRB Console with history and logging”

  1. Justin Avatar

    Do these settings go in the irb settings file? The post isn’t clear about what to *do* with all that text.

    1. Shishir Sharma 'criss' Avatar

      Thanks for pointing out. These goes in ~/.irbrc

  2. Arindam Chakraborty Avatar

    On line 17 of the code preview your logic is:

    result = !condition_a && !condition_b

    From boolean algebra,
    a’.b’ = (a + b)’

    Reducing it in terms of boolean algebra, a more correct, and understandable statement could be

    result = ! (condition_a || condition_b)

    The statement would become:
    irb_console_running = (rails_running or script_console_running) ‘

    This is also more intuitive. 🙂

    1. Shishir Sharma Avatar

      That is one way. If you like it you can change it in your.irbrc 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.