Hi all,
I could solve the problem myself. For whomever it might be useful, the
problem was that "gets" tried to read a file named after the first
input
parameter to the generator script. Therefore $stdin.gets must be used.
Cheers
Bernd
Bernd Burnt wrote:> Hi,
> I am currently writing a rails generator. However it will be a little
> bit more complex than the standard generators (e.g. model). Therefore I
> do not want, that the user has to give all arguments as parameters to
> the generator script.
> I thought about an interactive generator, that asks the user to enter
> different parameters and reads them with "gets".
> When I have a "gets" in the manifest method of my generator, it
raises
> an error "no such file or directory - <args[0]>
> Does anyone have an idea how I can read user input in a generator
> script?
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---