Skip to content

Commit

Permalink
Fix on Ruby 2.2.6 thanks to @aunghtain, gh-93
Browse files Browse the repository at this point in the history
  • Loading branch information
jmettraux committed Feb 28, 2024
1 parent 4c12b61 commit 491ab78
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@

## fugit 1.10.1 not yet released

* Fix on Ruby 2.2.6 thanks to @aunghtain, gh-93


## fugit 1.10.0 released 2024-02-22

Expand Down
9 changes: 8 additions & 1 deletion lib/fugit/cron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -320,16 +320,23 @@ def previous_time(from=::EtOrbi::EoTime.now)

# Used by Fugit::Cron#next and Fugit::Cron#prev
#
class CronIterator include Enumerable
class CronIterator
include ::Enumerable

attr_reader :cron, :start, :current, :direction

def initialize(cron, direction, start)

@cron = cron
@start = start
@current = start.dup
@direction = direction
end

def each

loop do

yield(@current = @cron.send(@direction, @current))
end
end
Expand Down

0 comments on commit 491ab78

Please sign in to comment.