lib/rufus/scheduler.rb in rufus-scheduler-3.5.0 vs lib/rufus/scheduler.rb in rufus-scheduler-3.5.1

- old
+ new

@@ -9,11 +9,11 @@ module Rufus class Scheduler - VERSION = '3.5.0' + VERSION = '3.5.1' EoTime = ::EtOrbi::EoTime require 'rufus/scheduler/util' require 'rufus/scheduler/jobs' @@ -395,19 +395,16 @@ # main scheduler thread, that thread will get returned when :active or # :all. # def work_threads(query=:all) - ts = - threads.select { |t| - t[:rufus_scheduler_job] || t[:rufus_scheduler_work_thread] - } + ts = threads.select { |t| t[:rufus_scheduler_work_thread] } case query - when :active then ts.select { |t| t[:rufus_scheduler_job] } - when :vacant then ts.reject { |t| t[:rufus_scheduler_job] } - else ts + when :active then ts.select { |t| t[:rufus_scheduler_job] } + when :vacant then ts.reject { |t| t[:rufus_scheduler_job] } + else ts end end def running_jobs(opts={}) @@ -604,18 +601,18 @@ return_job_instance ||= opts[:job] job_class = case job_type - when :once - opts[:_t] ||= Rufus::Scheduler.parse(t, opts) - opts[:_t].is_a?(Numeric) ? InJob : AtJob - when :every - EveryJob - when :interval - IntervalJob - when :cron - CronJob + when :once + opts[:_t] ||= Rufus::Scheduler.parse(t, opts) + opts[:_t].is_a?(Numeric) ? InJob : AtJob + when :every + EveryJob + when :interval + IntervalJob + when :cron + CronJob end job = job_class.new(self, t, opts, block || callable) #fail ArgumentError.new(