Skip to content

Instantly share code, notes, and snippets.

@msroot
Created August 2, 2018 06:01
Show Gist options
  • Save msroot/b8bbf053de3d4cede8ffe1f750ebcaf2 to your computer and use it in GitHub Desktop.
Save msroot/b8bbf053de3d4cede8ffe1f750ebcaf2 to your computer and use it in GitHub Desktop.
require 'clockwork'
#View clockwork's jobs
Clockwork.manager.instance_variable_get("@events").map { |job|
a = [:hour, :min, :wday].map { |e|
if job.instance_variable_get("@at").try(e)
"#{e}: #{job.instance_variable_get("@at").send(e)}"
end
}.join(" ")
[job.to_s, a]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment