Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add description above for each task. #641

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion lib/whenever/job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@

module Whenever
class Job
attr_reader :at, :roles
attr_reader :at, :roles, :description

def initialize(options = {})
@options = options
@at = options.delete(:at)
@template = options.delete(:template)
@job_template = options.delete(:job_template) || ":job"
@roles = Array(options.delete(:roles))
@description = options.delete(:description)
@options[:output] = options.has_key?(:output) ? Whenever::Output::Redirection.new(options[:output]).to_s : ''
@options[:environment_variable] ||= "RAILS_ENV"
@options[:environment] ||= :production
Expand Down
1 change: 1 addition & 0 deletions lib/whenever/job_list.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def cron_jobs
job.has_role?(r)
end
Whenever::Output::Cron.output(time, job) do |cron|
cron.prepend "##{job.description}\n" unless job.description.to_s.empty?
cron << "\n\n"

if cron[0,1] == "@"
Expand Down