[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

crontab.rb:117: warning: tried to create Proc object without a block

pere.noel

8/2/2006 7:26:00 AM

with crontab.rb:117:

i get a warning: tried to create Proc object without a block

line 117 being :
job = proc if iterator?

what could I change to avoid this warning ???
--
une bévue
2 Answers

ts

8/2/2006 12:40:00 PM

0

>>>>> "Y" == Yvon Thoraval <yvonthoraval@free.fr> writes:

Y> the file i've found "crontab.rb" is of 2001, may be that's the reason...=

yes,

svg% ./ruby -ve 'def a() j = proc if iterator?; p j end; a {}'
ruby 1.6.8 (2002-12-24) [i686-linux]
#<Proc:0xb7cb293c>
svg%

svg% ./ruby -ve 'def a() j = proc if iterator?; p j end; a {}'
ruby 1.8.0 (2003-08-04) [i686-linux]
-e:1: warning: tried to create Proc object without a block
#<Proc:0xb7d542b8@-e:1>
svg%

svg% ./ruby -ve 'def a() j = Proc.new if iterator?; p j end; a {}'
ruby 1.8.0 (2003-08-04) [i686-linux]
#<Proc:0xb7def2a4@-e:1>
svg%



Guy Decoux

pere.noel

8/2/2006 12:58:00 PM

0

ts <decoux@moulon.inra.fr> wrote:

>
> svg% ./ruby -ve 'def a() j = proc if iterator?; p j end; a {}'
> ruby 1.6.8 (2002-12-24) [i686-linux]
> #<Proc:0xb7cb293c>
> svg%
>
> svg% ./ruby -ve 'def a() j = proc if iterator?; p j end; a {}'
> ruby 1.8.0 (2003-08-04) [i686-linux]
> -e:1: warning: tried to create Proc object without a block
> #<Proc:0xb7d542b8@-e:1>
> svg%
>
> svg% ./ruby -ve 'def a() j = Proc.new if iterator?; p j end; a {}'
> ruby 1.8.0 (2003-08-04) [i686-linux]
> #<Proc:0xb7def2a4@-e:1>
> svg%

fine, thanks !
--
une bévue