Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

IRB analogue of python -i

Tags:

ruby

irb

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
like image 283
Colonel Panic Avatar asked Jan 22 '11 11:01

Colonel Panic


1 Answers

irb -r xy.rb

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

like image 60
Ashley Williams Avatar answered Nov 06 '22 05:11

Ashley Williams