In whenever
's README, there is an example like this,
set :whenever_environment, defer { stage }
require "whenever/capistrano"
I probably understand what defer
means, but I want to know how it works, and how it is implemented.
Where can I find the source code of defer
?
defer
used to be part of the capistrano v2 gem. It is nothing more than an alias to the rubylambda
and is used only for readability purposes.As you might know in capistrano you can
set
many variables. Their values are calculated upon initialization of the capistrano script unless a value is a block. In that contextdefer
makes more sense as a keyword since evaluation is defered until the variable is accessed.