I’m needing some help with OptionParser. I’m wanting to use it to parse
a
string rather than ARGV, but when I pass the parse method a string of
options, i get the following error:
undefined method `shift’ for “–help”:String (NoMethodError)
Is there a way I can format the string of options so OptionParser can
use
it?
I’m needing some help with OptionParser. I’m wanting to use it to parse a
string rather than ARGV, but when I pass the parse method a string of
options, i get the following error:
undefined method `shift’ for “–help”:String (NoMethodError)
Is there a way I can format the string of options so OptionParser can use
it?
AFAIK the easiest solution is to give it an array which contains just
one string.