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 +4 -4
- data/.github/workflows/changelog-check.yml +47 -0
- data/.github/workflows/release.yml +46 -0
- data/CHANGELOG.md +5 -0
- data/README.md +4 -8
- data/holidays.gemspec +1 -1
- data/lib/generated_definitions/au.rb +6 -10
- data/lib/holidays/version.rb +1 -1
- data/test/holidays/definition/context/test_generator.rb +2 -2
- metadata +6 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c423e457490bf307e7fabdfc2744e0e8621eb6f0a783e593023f562dccd8ad68
|
|
4
|
+
data.tar.gz: a6ce029fecfb730da6d6b6a0a75f4c7b718937d5a95d0d03fc407df58083ecb7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
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', '~>
|
|
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
|
-
|
|
85
|
-
|
|
86
|
-
when
|
|
87
|
-
Date.civil(
|
|
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
|
|
data/lib/holidays/version.rb
CHANGED
|
@@ -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.
|
|
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: '
|
|
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: '
|
|
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:
|
|
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:
|