Customization Programming Ruby Web

IRB Console with history and logging

I spend most time with IRB or Rails/console. These are good settings on which I have settled with over the time. These will allow you to have basic logging and IRB history. Just put these in the ~/.irbrc file (If file doesn’t exist then create one).

By Shishir Sharma

Shishir Sharma is a husband, hacker, biker. Bachelor of electronics & communication engineering by training. He is a visionary, mentor, problem solver, technology enthusiast. He can speak in Javascript, Ruby, Python, PHP; Fluent in C, C++. He is a moderator at LUG-Jaipur. He loves action movies and FPS games.

4 replies on “IRB Console with history and logging”

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. 🙂

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.