From roland.swingler at gmail.com Tue Jun 13 11:06:00 2006 From: roland.swingler at gmail.com (Roland Swingler) Date: Tue, 13 Jun 2006 16:06:00 +0100 Subject: [Rake-devel] Bug with "gets" in Rake? Message-ID: Hi, First off apologies if this isn't the right place to be sending these sort of bug reports, I couldn't see anything on the rubyforge project page for them. I'm currently having a problem using gets with tasks named on the command line. Here is my example rakefile: task :getting do x = gets puts x end task :default => [:getting] The problem - running just "rake" on the command line works fine, waiting for input - running "rake getting" gives me the following error: rake aborted! No such file or directory - getting /home/rolands/tests/rakefile.rb:2:in `gets' (See full trace by running task with --trace) Doing the trace I get: /home/rolands/tests/rakefile.rb:2:in `gets' /home/rolands/tests/rakefile.rb:2 /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 /usr/local/bin/rake:18 Having had a quick look through the Rake source I can't see anything obvious as to why this is going wrong. Any help would be much appreciated! Thanks in advance, Roland From roland.swingler at gmail.com Tue Jun 13 11:19:08 2006 From: roland.swingler at gmail.com (Roland Swingler) Date: Tue, 13 Jun 2006 16:19:08 +0100 Subject: [Rake-devel] Bug with "gets" in Rake? In-Reply-To: References: Message-ID: Someone else has answered the problem for me - specifically using STDIN.gets instead of just gets solves the problem. Cheers, Roland On 6/13/06, Roland Swingler wrote: > Hi, > > First off apologies if this isn't the right place to be sending these > sort of bug reports, I couldn't see anything on the rubyforge project > page for them. I'm currently having a problem using gets with tasks > named on the command line. > > Here is my example rakefile: > > task :getting do > x = gets > puts x > end > > task :default => [:getting] > > The problem - running just "rake" on the command line works fine, > waiting for input - running "rake getting" gives me the following > error: > > rake aborted! > No such file or directory - getting > /home/rolands/tests/rakefile.rb:2:in `gets' > (See full trace by running task with --trace) > > Doing the trace I get: > > /home/rolands/tests/rakefile.rb:2:in `gets' > /home/rolands/tests/rakefile.rb:2 > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:387:in `execute' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:357:in `invoke' > /usr/local/lib/ruby/1.8/thread.rb:135:in `synchronize' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:350:in `invoke' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/lib/rake.rb:1906:in `run' > /usr/local/lib/ruby/gems/1.8/gems/rake-0.7.1/bin/rake:7 > /usr/local/bin/rake:18 > > Having had a quick look through the Rake source I can't see anything > obvious as to why this is going wrong. > > Any help would be much appreciated! > > Thanks in advance, > Roland > From jim at weirichhouse.org Tue Jun 13 11:24:12 2006 From: jim at weirichhouse.org (Jim Weirich) Date: Tue, 13 Jun 2006 11:24:12 -0400 Subject: [Rake-devel] Bug with "gets" in Rake? In-Reply-To: References: Message-ID: <448ED89C.9090608@weirichhouse.org> Roland Swingler wrote: > Someone else has answered the problem for me - specifically using > STDIN.gets instead of just gets solves the problem. That's funny. It works as is for me. I don't see why using STDIN would make a difference to that particular error. Looks like you are running on a Linux (or some Unix) platform, so that shouldn't be an issue. I'm confused. -- Jim Weirich