From: Jano Svitok Date: 2007-11-28T20:06:25+09:00 Subject: Re: Equivalent for unix "read" command in rake tasks? On Nov 28, 2007 11:44 AM, Rob Lucas wrote: > Hi, > > Perhaps I'm missing something, but I can't find information anywhere > about adding any level of interaction with the user into rake tasks. > What I want really is something equivalent to the unix/ linux command > "read" so that the task can vary conditionally depending on responses > from the user. The point would be to replace various shell scripts that > I have with a single, more elegant Rakefile. File.read ? Kernel#gets ? Readline ? Rakefile is a normal ruby file, so you can do anything you can do in ruby. You can event call IRB to get more interactivity, although I'm not sure if that's the intent of rake ;-) Other than that, you can parametrize rake tasks through environment variables: either by really setting the env, or passing on command line: rake task_name var1=abcd var2=efgh then in your rakefile you can reference them as ENV['var1'] and ENV['var2'] J.