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

Discussion in 'Ruby' started by Une bévue, Aug 2, 2006.

  1. Une bévue

    Une bévue Guest

    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
    Une bévue, Aug 2, 2006
    #1
    1. Advertising

  2. Une bévue

    ts Guest

    >>>>> "Y" == Yvon Thoraval <> 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
    ts, Aug 2, 2006
    #2
    1. Advertising

  3. Une bévue

    Une bévue Guest

    ts <> 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
    Une bévue, Aug 2, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lozzi
    Replies:
    3
    Views:
    1,917
    David Lozzi
    Jun 1, 2005
  2. NevilleDNZ
    Replies:
    9
    Views:
    423
    NevilleDNZ
    Aug 16, 2006
  3. Ruby Quiz

    [QUIZ] SimFrost (#117)

    Ruby Quiz, Mar 9, 2007, in forum: Ruby
    Replies:
    60
    Views:
    565
    Josef 'Jupp' Schugt
    Mar 15, 2007
  4. Ruby Quiz

    [SUMMARY] SimFrost (#117)

    Ruby Quiz, Mar 15, 2007, in forum: Ruby
    Replies:
    0
    Views:
    83
    Ruby Quiz
    Mar 15, 2007
  5. Wolfgang Nádasi-Donner
    Replies:
    0
    Views:
    110
    Wolfgang Nádasi-Donner
    May 31, 2007
Loading...

Share This Page