Sha256: 0b173215cfc5acb7b0597eb2511fd8850cba34e6df613037aed9d879e1e69279

Contents?: true

Size: 690 Bytes

Versions: 1

Compression:

Stored size: 690 Bytes

Contents

# frozen_string_literal: true

module TasksScheduler
  module CronParserPatch
    class TasksSchedulerTimeSource
      class << self
        def local(year, month, day, hour, min, second) # rubocop:disable Metrics/ParameterLists
          Time.utc(year, month, day, hour, min, second)
        end

        def now
          Time.now.utc
        end
      end
    end

    def self.included(base)
      base.class_eval do
        def self.new(source, time_source = TasksSchedulerTimeSource)
          super
        end
      end
    end
  end
end

unless ::CronParser.included_modules.include?(::TasksScheduler::CronParserPatch)
  ::CronParser.include(::TasksScheduler::CronParserPatch)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
tasks_scheduler-0.4.0 lib/tasks_scheduler/cron_parser_patch.rb