|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
[Note: parts of this message were removed to make it a legal post.]
Hello all, I'm needing some 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 "--":String (NoMethodError) Is there a way I can format the string of options so OptionParser can use it? Thanks! -- BTR |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
> I'm needing some 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 "--":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. -- Giles Bowkett Podcast: http://hollywoodgrit.blogspot.com Blog: http://gilesbowkett.blogspot.com Portfolio: http://www.gilesgoatboy.org Tumblelog: http://giles.tumblr.com |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
[Note: parts of this message were removed to make it a legal post.]
Sweet! Thanks. On Jan 7, 2008 12:26 PM, Giles Bowkett <gilesb@gmail.com> wrote: > > I'm needing some 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 "--":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. > > -- > Giles Bowkett > > Podcast: http://hollywoodgrit.blogspot.com > Blog: http://gilesbowkett.blogspot.com > Portfolio: http://www.gilesgoatboy.org > Tumblelog: http://giles.tumblr.com > > |
|
![]() |
| Outils de la discussion | |
|
|