Crontab.rb:117: warning: tried to create Proc object without

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 ???

On 02/08/06, Une bévue [email protected] wrote:

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 ???

Don’t use proc as a variable name.

Paul.

On 8/2/06, Une bévue [email protected] wrote:

une bévue

Do you want the proc object of the given block?
In that case I know only one method

def whatever(*args, &blk)
job = blk if blk
# Do something with job
end

Hope that helps
Robert

Deux choses sont infinies : l’univers et la bêtise humaine ; en ce qui
concerne l’univers, je n’en ai pas acquis la certitude absolue.

  • Albert Einstein

Le 2 août 06 à 14:05, Paul B. a écrit :

Don’t use proc as a variable name.

the file i’ve found “crontab.rb” is of 2001, may be that’s the reason…

ts [email protected] wrote:

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:[email protected]:1
svg%

fine, thanks !

“Y” == Yvon T. [email protected] 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:[email protected]: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:[email protected]:1
svg%

Guy Decoux