Velocity Reviews

Velocity Reviews (http://www.velocityreviews.com/forums/index.php)
-   Ruby (http://www.velocityreviews.com/forums/f66-ruby.html)
-   -   crontab.rb:117: warning: tried to create Proc object without a block (http://www.velocityreviews.com/forums/t831996-crontab-rb-117-warning-tried-to-create-proc-object-without-a-block.html)

Une bévue 08-02-2006 07:26 AM

crontab.rb:117: warning: tried to create Proc object without a block
 
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

ts 08-02-2006 12:40 PM

Re: crontab.rb:117: warning: tried to create Proc object without a block
 
>>>>> "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


Une bévue 08-02-2006 12:57 PM

Re: crontab.rb:117: warning: tried to create Proc object without a block
 
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


All times are GMT. The time now is 09:30 AM.

Powered by vBulletin®. Copyright ©2000 - 2014, vBulletin Solutions, Inc.
SEO by vBSEO ©2010, Crawlability, Inc.