0
votes

Im using inf-ruby mode in emacs, I really live it. But anyone know how to run a ruby script with arguments by inf-ruby? for instance, I need to pass argument arg0 and arg1 to test.rb

test.rb -arg0 -arg1
1

1 Answers

1
votes

The short answer: instead of M-x run-ruby, call it with a prefix arg like so: C-u M-x run-ruby. This will allow you to edit the command line.

The long answer: don't. Instead re-structure your code so that you can test / call all the functionality without relying on parsing the command line arguments. Then do some simple tests from the command line whether your argument parsing works out okay.