using curly braces for 'every' block?

16 views
Skip to first unread message

dor...@est.org

unread,
Mar 30, 2016, 8:18:29 AM3/30/16
to Whenever Gem
Would someone explain either how to use curly braces with every, or why it's not valid?

I don't understand why this:

every %w(tue wed thu fri sat), :at => '4:30am' { cron_runner "direct:fidelity JOB=1" }

is not equivalent to this:

every %w(tue wed thu fri sat), :at => '4:30am' do; cron_runner "direct:fidelity JOB=1"; end

Thanks!
Avram

Ben Langfeld

unread,
Jun 12, 2016, 4:55:43 PM6/12/16
to Whenever Gem, dor...@est.org
Because the former is not valid Ruby syntax. The following would be equivalent:

every(%w(tue wed thu fri sat), :at => '4:30am') { cron_runner "direct:fidelity JOB=1" }
Reply all
Reply to author
Forward
0 new messages