Sha256: 3018d56459a591482e4036fcc8d1db7a2c7e1edd62d12de3b4bf1db7afe147cf
Contents?: true
Size: 1.17 KB
Versions: 1
Compression:
Stored size: 1.17 KB
Contents
using RubyClock::DSL on_error do |job, error| case job when String puts "#{job}: #{error.class}: #{error.message}" else puts "An error has occurred with job #{job.identifier}: #{error.class}: #{error.message}" end end # on_error do |job, error| # raise error # end around_action do |job_proc, job_info| puts "before1 #{job_info.class}" job_proc.call puts "after1" end around_action do |job_proc| puts "before2" job_proc.call puts "after2" end every('2 seconds') do puts "hello from a ruby-clock job" end every('2 seconds') do RubyClock::Runners.shell 'say hello' end every('2 seconds') do raise "🐈️ this error is expected, to test the error catcher" end cron('*/10 * * * * *') do puts "cron running on every 10th second #{Time.now}" end every('2 seconds') do if defined?(schedule) raise "💥 we do not expect the ruby-clock DSL to be available inside a job, but it is" end end every('2 seconds') do if defined?(shell) || defined?(rake) puts "💥 we do not expect runners to be available inside a job, but it is" end end # def schedule.around_trigger(job_info, &job_proc) # puts "ruby-clock 1-style around trigger!" # end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
ruby-clock-2.0.0.beta5 | example-app/Clockfile |