1
votes

I'm trying to start IRB and run a file, foo.rb, in one command,

irb foo.rb

When foo.rb is done I want another IRB prompt. Instead, it prints an IRB prompt, then exits.

I checked the IRB docs and I changed IRB.conf[:IGNORE_EOF] = true. I confirmed that hash value inside IRB. Is the behavior I want set by this hash? If so, what else could I be doing wrong?

1

1 Answers

1
votes

The docs for irb say about that configuration:

**conf.ignore_eof = true/false**
   Whether ^D (control-d) will be ignored or not.  If false is set, ^D means quit.

So, no that setting isn't meant to do what you're looking for. As far as I can tell, there isn't a way to do what you want with irb. The closest would be to start irb without an argument, then use require './foo.rb' to run that file.