holidays 9.0.0 → 9.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3c970bf0b9b26a077f9902bc3729390c606b9354149ee024910689dfedcf4831
4
- data.tar.gz: f21f303f0d7bcf522620f64fb1c35c36d84ba70a4de2aecc3c048b24a2be0e65
3
+ metadata.gz: c423e457490bf307e7fabdfc2744e0e8621eb6f0a783e593023f562dccd8ad68
4
+ data.tar.gz: a6ce029fecfb730da6d6b6a0a75f4c7b718937d5a95d0d03fc407df58083ecb7
5
5
  SHA512:
6
- metadata.gz: cf01eea6da4b4847aa8760dddc281b9c7f661ca8bb2fe7e36d09f9737ba2bb4cd0a1785910dcc7df567565c6ad86f1eb695ded055991b7f890d49303b71dd3e3
7
- data.tar.gz: be38f100fd9ff3ba4b8aa8621226574c9f699ed5c8e1340c595586e4ea538a415c3685ef94b8471fb1b15830d9b9ff7840f32f930a4ac40578460ec8c2563b30
6
+ metadata.gz: 9f2885529f2b22865d406bd38bafa8f169c94df37c4f7c6b51eef95d5aa2085cd29c0d4f9b9c8f3d2d2cb2ac887f984ba5521ecf279c548ec755b8a44ccb007a
7
+ data.tar.gz: 9c1aeaf7d210fe849d1977f931e625b895e8bced4924a26643a47e3edaca75451743ca036e864e8772901df92738fb612251195bfdf62b494ad01a3935c5eb91
@@ -0,0 +1,47 @@
1
+ name: Changelog Check
2
+ on:
3
+ pull_request:
4
+ branches: ["master"]
5
+ paths:
6
+ - 'lib/holidays/version.rb'
7
+ - 'CHANGELOG.md'
8
+ jobs:
9
+ check:
10
+ runs-on: ubuntu-latest
11
+ steps:
12
+ - uses: actions/checkout@v3
13
+ - name: Extract version from version.rb
14
+ id: version
15
+ run: |
16
+ VERSION=$(grep -oP "VERSION = '\K[^']+" lib/holidays/version.rb)
17
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
18
+ echo "version.rb declares: $VERSION"
19
+ - name: Extract latest version from CHANGELOG
20
+ id: changelog
21
+ run: |
22
+ CHANGELOG_VERSION=$(grep -oP "^## \K[0-9]+\.[0-9]+\.[0-9]+" CHANGELOG.md | head -1)
23
+ echo "changelog_version=$CHANGELOG_VERSION" >> $GITHUB_OUTPUT
24
+ echo "CHANGELOG latest entry: $CHANGELOG_VERSION"
25
+ - name: Verify version.rb and CHANGELOG agree
26
+ run: |
27
+ VERSION="${{ steps.version.outputs.version }}"
28
+ CHANGELOG_VERSION="${{ steps.changelog.outputs.changelog_version }}"
29
+ FAILED=false
30
+
31
+ if ! grep -q "^## ${VERSION}$" CHANGELOG.md; then
32
+ echo "ERROR: version.rb declares ${VERSION} but no matching '## ${VERSION}' section found in CHANGELOG.md"
33
+ FAILED=true
34
+ fi
35
+
36
+ if [ "${CHANGELOG_VERSION}" != "${VERSION}" ]; then
37
+ echo "ERROR: CHANGELOG.md latest entry is ${CHANGELOG_VERSION} but version.rb declares ${VERSION}"
38
+ FAILED=true
39
+ fi
40
+
41
+ if [ "$FAILED" = "true" ]; then
42
+ echo ""
43
+ echo "Both version.rb and CHANGELOG.md must be updated together and must agree on the version."
44
+ exit 1
45
+ fi
46
+
47
+ echo "OK: version.rb and CHANGELOG.md both declare ${VERSION}"
@@ -0,0 +1,46 @@
1
+ name: Release
2
+ on:
3
+ push:
4
+ branches: ["master"]
5
+ permissions:
6
+ contents: read
7
+ jobs:
8
+ publish:
9
+ runs-on: ubuntu-latest
10
+ env:
11
+ BUNDLER_NO_OLD_RUBYGEMS_WARNING: true
12
+ steps:
13
+ - uses: actions/checkout@v3
14
+ - name: Set up Ruby
15
+ uses: ruby/setup-ruby@3ff19f5e2baf30647122352b96108b1fbe250c64 #v1.299.0
16
+ with:
17
+ ruby-version: 'ruby'
18
+ bundler-cache: true
19
+ - name: Extract version from version.rb
20
+ id: version
21
+ run: |
22
+ VERSION=$(grep -oP "VERSION = '\K[^']+" lib/holidays/version.rb)
23
+ echo "version=$VERSION" >> $GITHUB_OUTPUT
24
+ echo "Detected version: $VERSION"
25
+ - name: Check if version already exists on RubyGems
26
+ id: rubygems
27
+ run: |
28
+ VERSION="${{ steps.version.outputs.version }}"
29
+ HTTP_STATUS=$(curl -s -o /dev/null -w "%{http_code}" \
30
+ "https://rubygems.org/api/v2/rubygems/holidays/versions/${VERSION}.json")
31
+ if [ "$HTTP_STATUS" = "200" ]; then
32
+ echo "exists=true" >> $GITHUB_OUTPUT
33
+ echo "Version ${VERSION} already exists on RubyGems, skipping publish"
34
+ else
35
+ echo "exists=false" >> $GITHUB_OUTPUT
36
+ echo "Version ${VERSION} not found on RubyGems (HTTP ${HTTP_STATUS})"
37
+ fi
38
+ - name: Build and publish gem
39
+ if: steps.rubygems.outputs.exists == 'false'
40
+ env:
41
+ GEM_HOST_API_KEY: ${{ secrets.RUBYGEMS_API_KEY }}
42
+ run: |
43
+ VERSION="${{ steps.version.outputs.version }}"
44
+ gem build holidays.gemspec
45
+ gem push "holidays-${VERSION}.gem"
46
+ echo "Successfully published holidays ${VERSION} to RubyGems"
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Ruby Holidays Gem CHANGELOG
2
2
 
3
+ ## 9.1.0
4
+
5
+ * Update to [v6.0.0 definitions](https://github.com/holidays/definitions/releases/tag/v6.0.0). Please see the changelog for the definition details.
6
+ * Update mocha from 1.x to 2.x for Ruby 4.0 compatibility. Fixes warning about removed CGI library.
7
+
3
8
  ## 9.0.0
4
9
 
5
10
  * Drop support for Ruby < 3.2. Supported versions are now 3.2, 3.3, 3.4, and ruby-head.
data/README.md CHANGED
@@ -14,14 +14,10 @@ gem install holidays
14
14
 
15
15
  This gem is tested with the following ruby versions:
16
16
 
17
- * 2.4.5
18
- * 2.5.3
19
- * 2.6.1
20
- * 2.7.7
21
- * 3.0.6
22
- * 3.1.4
23
- * 3.2.2
24
- * 3.3.0
17
+ * 3.2
18
+ * 3.3
19
+ * 3.4
20
+ * 4.0
25
21
  * JRuby 9.2.21.0
26
22
  * JRuby 9.4.2.0
27
23
 
data/holidays.gemspec CHANGED
@@ -26,6 +26,6 @@ Gem::Specification.new do |gem|
26
26
  gem.add_development_dependency 'rake', '~> 13'
27
27
  gem.add_development_dependency 'simplecov', '~> 0.16'
28
28
  gem.add_development_dependency 'test-unit', '~> 3'
29
- gem.add_development_dependency 'mocha', '~> 1'
29
+ gem.add_development_dependency 'mocha', '~> 2'
30
30
  gem.add_development_dependency 'pry', '~> 0.12'
31
31
  end
@@ -71,20 +71,16 @@ when 2016
71
71
  Date.civil(2016, 9, 30)
72
72
  when 2017
73
73
  Date.civil(2017, 9, 29)
74
- when 2018
75
- Date.civil(2018, 9, 28)
76
- when 2019
77
- Date.civil(2019, 9, 27)
78
74
  when 2020
79
75
  Date.civil(2020, 10, 23)
80
- when 2021
81
- Date.civil(2021, 9, 24)
82
76
  when 2022
83
77
  Date.civil(2022, 9, 23)
84
- when 2023
85
- Date.civil(2023, 9, 29)
86
- when 2024
87
- Date.civil(2024, 9, 27)
78
+ else
79
+ # Friday before AFL Grand Final typically falls on the last Friday in September
80
+ # Override when falls on a different date
81
+ last_day = Date.civil(year, 9, -1)
82
+ last_friday = last_day - ((last_day.wday - 5) % 7)
83
+ last_friday
88
84
  end
89
85
  },
90
86
 
@@ -1,3 +1,3 @@
1
1
  module Holidays
2
- VERSION = '9.0.0'
2
+ VERSION = '9.1.0'
3
3
  end
@@ -189,7 +189,7 @@ class GeneratorTests < Test::Unit::TestCase
189
189
  def test_generate_definition_source_correctly_generate_module_src_with_custom_methods
190
190
  files = ['test/data/test_single_custom_holiday_with_custom_procs.yaml']
191
191
 
192
- @custom_method_parser.expects(:call).with('custom_method' => {'arguments' => 'year, month', 'source' => "d = Date.civil(year, month, 1)\nd + 2\n"}).returns({"custom_method(year, month)" => @parsed_custom_method})
192
+ @custom_method_parser.expects(:call).with(equals({'custom_method' => {'arguments' => 'year, month', 'source' => "d = Date.civil(year, month, 1)\nd + 2\n"}})).returns({"custom_method(year, month)" => @parsed_custom_method})
193
193
  @custom_methods_repository.expects(:find).twice.with('custom_method(year, month)').returns(nil)
194
194
  @custom_method_source_decorator.expects(:call).once.with(@parsed_custom_method).returns("\"custom_method(year, month)\" => Proc.new { |year, month|\nsource_stuff\n}")
195
195
 
@@ -209,7 +209,7 @@ class GeneratorTests < Test::Unit::TestCase
209
209
  def test_generate_definition_source_correctly_generate_test_src_with_custom_methods
210
210
  files = ['test/data/test_single_custom_holiday_with_custom_procs.yaml']
211
211
 
212
- @custom_method_parser.expects(:call).with('custom_method' => {'arguments' => 'year, month', 'source' => "d = Date.civil(year, month, 1)\nd + 2\n"}).returns({"custom_method(year, month)" => @parsed_custom_method})
212
+ @custom_method_parser.expects(:call).with(equals({'custom_method' => {'arguments' => 'year, month', 'source' => "d = Date.civil(year, month, 1)\nd + 2\n"}})).returns({"custom_method(year, month)" => @parsed_custom_method})
213
213
  @custom_methods_repository.expects(:find).twice.with('custom_method(year, month)').returns(nil)
214
214
  @custom_method_source_decorator.expects(:call).once.with(@parsed_custom_method).returns("\"custom_method(year, month)\" => Proc.new { |year, month|\nsource_stuff\n}")
215
215
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: holidays
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.0.0
4
+ version: 9.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alex Dunae
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '1'
75
+ version: '2'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '1'
82
+ version: '2'
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: pry
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -102,6 +102,8 @@ executables: []
102
102
  extensions: []
103
103
  extra_rdoc_files: []
104
104
  files:
105
+ - ".github/workflows/changelog-check.yml"
106
+ - ".github/workflows/release.yml"
105
107
  - ".github/workflows/ruby.yml"
106
108
  - ".gitmodules"
107
109
  - CHANGELOG.md
@@ -405,7 +407,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
405
407
  - !ruby/object:Gem::Version
406
408
  version: '0'
407
409
  requirements: []
408
- rubygems_version: 3.6.9
410
+ rubygems_version: 4.0.9
409
411
  specification_version: 4
410
412
  summary: A collection of Ruby methods to deal with statutory and other holidays.
411
413
  test_files: