Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add backwards compatibility to Ruby 2.6 #562

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
strategy:
matrix:
rails: ['6.1', '7.0', '7.1']
ruby: ['3.1', '3.2', '3.3']
ruby: ['2.6', '2.7', '3.0', '3.1', '3.2', '3.3']
runs-on: ubuntu-latest
env:
RAILS_VERSION: ${{ matrix.rails }}
Expand Down
8 changes: 4 additions & 4 deletions lib/ice_cube/input_alignment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,16 @@ def initialize(rule, value, rule_part)

attr_reader :rule, :value, :rule_part

def verify(freq, options = {}, &)
def verify(freq, options = {}, &block)
@rule.validations[:interval] or return

case @rule
when DailyRule
verify_wday_alignment(freq, &)
verify_wday_alignment(freq, &block)
when MonthlyRule
verify_month_alignment(freq, &)
verify_month_alignment(freq, &block)
else
verify_freq_alignment(freq, &)
verify_freq_alignment(freq, &block)
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/ice_cube/schedule.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ def all_occurrences_enumerator
end

# Iterate forever
def each_occurrence(&)
enumerate_occurrences(start_time, &).to_a
def each_occurrence(&block)
enumerate_occurrences(start_time, &block).to_a
self
end

Expand Down