lib/taskmaster/henchman.rb
# Declares the cron job using `whenever` syntax.
#
# @param [Integer, #to_s] frequency any frequency defined as valid for `whenever` (e.g., 600 (seconds), 1.day, :sunday, '0 12 * * *')
# @param [Hash] options configuration options
# @option options [Symbol] :run (:run) the class method to call in the cron job
# @option options [Symbol] :with (:runner) the `whenever` job type to use when defining the cron job
# @option options [Integer, #to_s] :at a specific time to start the cron job (e.g., `every :hour, :at => 6' runs a job 6 minutes after every hour; `every :day, :at => '4:30 am' runs a job at 4:30 am every day.)
Declares the cron job using `whenever` syntax.
Declares the cron job using ` whenever ` syntax .
def every(frequency, options = {})
        @scheduled_jobs ||= []
        method  = options.delete(:run) || :run
        command = options.delete(:with) || :runner
        @scheduled_jobs << "every #{frequency.to_s}, #{options.inspect} do
  #{command.to_s} \'#{self.name}.#{method.to_s}\'
end"
      end
def every ( frequency , options = { } ) @scheduled_jobs ||= [ ] method = options . delete ( :run ) || :run command = options . delete ( :with ) || :runner @scheduled_jobs << "every #{frequency.to_s}, #{options.inspect} do
  #{command.to_s} \'#{self.name}.#{method.to_s}\'
end" end
Declares the cron job using `whenever` syntax.
Declares the cron job using ` whenever ` syntax .
frequency
<not_specific>
options
:at a specific time to start the cron job
: at a specific time to start the cron job
<not_specific>
options configuration options
options configuration options