Search code examples
rubyirb

IRB analogue of python -i


I want to use IRB to run a script then give me an interactive prompt. I do this with python -i xy.py in Python, however irb xy.rb exits after execution.

> python --help

-i    When a script is passed as first argument or the -c option is
      used, enter interactive mode after executing the script or the
      command

Solution

  • irb -r xy.rb
    

    It simply requires the file mentioned before giving you a normal IRB prompt.