holidays 9.0.0 → 9.1.1
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 +9 -0
- data/Makefile +1 -1
- data/README.md +4 -8
- data/doc/MAINTAINERS.md +2 -4
- data/holidays.gemspec +1 -1
- data/lib/generated_definitions/au.rb +6 -10
- data/lib/generated_definitions/bg.rb +3 -2
- data/lib/generated_definitions/cy.rb +2 -1
- data/lib/generated_definitions/europe.rb +2 -1
- 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: 48de71e88e1ad86816570c37ed6758acb2cbfa7cdd7572c6d7f887db8ab1e97c
|
|
4
|
+
data.tar.gz: fd1ad6a19f5dded4fc5b9bcee63d67049229f51047c20d1e629dddee2bf27810
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: bf87b687e2927731071a1bae0e128a19cd484a5ce919a7e9d5de6041be63fe4b23e8c7089d94fae37132d322ca206dc32b5c3f3cba59242aac5190e1289550f4
|
|
7
|
+
data.tar.gz: 3f4a6fb07d8ee2e6546ab25d311bf7f0307c2c94e80da6ae24ba53d0dba1d009a1fdcd651d23c1b69fdbb7d285040f88c01fe0dcbee68d44a67974b94334a63e
|
|
@@ -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,14 @@
|
|
|
1
1
|
# Ruby Holidays Gem CHANGELOG
|
|
2
2
|
|
|
3
|
+
## 9.1.1
|
|
4
|
+
|
|
5
|
+
* Update to [v6.0.1 definitions](https://github.com/holidays/definitions/releases/tag/v6.0.1). Please see the changelog for the definition details.
|
|
6
|
+
|
|
7
|
+
## 9.1.0
|
|
8
|
+
|
|
9
|
+
* Update to [v6.0.0 definitions](https://github.com/holidays/definitions/releases/tag/v6.0.0). Please see the changelog for the definition details.
|
|
10
|
+
* Update mocha from 1.x to 2.x for Ruby 4.0 compatibility. Fixes warning about removed CGI library.
|
|
11
|
+
|
|
3
12
|
## 9.0.0
|
|
4
13
|
|
|
5
14
|
* Drop support for Ruby < 3.2. Supported versions are now 3.2, 3.3, 3.4, and ruby-head.
|
data/Makefile
CHANGED
|
@@ -27,7 +27,7 @@ update-defs: definitions/
|
|
|
27
27
|
definitions: point-to-defs-master
|
|
28
28
|
|
|
29
29
|
point-to-defs-branch:
|
|
30
|
-
git submodule add -b $(BRANCH)
|
|
30
|
+
git submodule add -b $(BRANCH) https://github.com/$(USER)/definitions.git ./definitions/
|
|
31
31
|
|
|
32
32
|
point-to-defs-master:
|
|
33
33
|
git submodule add https://github.com/holidays/definitions definitions/
|
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/doc/MAINTAINERS.md
CHANGED
|
@@ -55,15 +55,13 @@ sections below.
|
|
|
55
55
|
* If all of the tests pass, update the `lib/holidays/version.rb` file to the new version. Reference the above [semver](http://semver.org/) rules for how to update versions.
|
|
56
56
|
* Make a branch on your fork and update the [CHANGELOG](../CHANGELOG.md) to reflect the latest changes. You do not need to put in all of the definition changes in this update, you can simply reference the other repository. See other entries in the CHANGELOG for examples.
|
|
57
57
|
* Open a PR against the new branch and merge it (another maintainer will need to review before you can merge)
|
|
58
|
-
* Once the branch is merged,
|
|
59
|
-
* If the build was successful then you can run the following to push up to rubygems.org: `GEM=<gem> make push`. Example: `GEM=holidays-6.2.0.gem make push`
|
|
58
|
+
* Once the branch is merged, the release GitHub Actions workflow will automatically build the gem and push it to rubygems.org. No local steps are required.
|
|
60
59
|
* Does this update require functionality additions or bug fixes? If YES, then:
|
|
61
60
|
* Run `make test` and ensure that all of the tests pass. If any tests fail then do *not* merge and contact a [core member](https://github.com/orgs/holidays/teams/core/members) for assistance.
|
|
62
61
|
* If all of the tests pass, make a branch on your fork and update the [CHANGELOG](../CHANGELOG.md) to reflect the latest changes.
|
|
63
62
|
* Update the `lib/holidays/version.rb` file to the new version. Reference the above [semver](http://semver.org/) rules for how to update versions.
|
|
64
63
|
* Open a PR against the new branch and merge it (another maintainer will need to review before you can merge)
|
|
65
|
-
* Once the branch is merged,
|
|
66
|
-
* If the build was successful then you can run the following to push up to rubygems.org: `GEM=<gem> make push`. Example: `GEM=holidays-6.2.0.gem make push`
|
|
64
|
+
* Once the branch is merged, the release GitHub Actions workflow will automatically build the gem and push it to rubygems.org. No local steps are required.
|
|
67
65
|
|
|
68
66
|
You are done! The latest version should be uploaded to rubygems.org. You can go to view the [holidays page](https://rubygems.org/gems/holidays) to verify that the latest version is available.
|
|
69
67
|
|
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
|
|
|
@@ -17,8 +17,9 @@ module Holidays
|
|
|
17
17
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Holy Saturday", :regions => [:bg_en]},
|
|
18
18
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Велика събота", :regions => [:bg_bg]},
|
|
19
19
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Easter Sunday", :regions => [:bg_en]},
|
|
20
|
-
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Възкресение Христово. Великден", :regions => [:bg_bg
|
|
21
|
-
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:bg_en]}
|
|
20
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Възкресение Христово. Великден", :regions => [:bg_bg]},
|
|
21
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:bg_en]},
|
|
22
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Великденски понеделник", :regions => [:bg_bg]}],
|
|
22
23
|
1 => [{:mday => 1, :name => "New Year's Day", :regions => [:bg_en]},
|
|
23
24
|
{:mday => 1, :name => "Нова година", :regions => [:bg_bg]}],
|
|
24
25
|
3 => [{:mday => 3, :name => "Liberation Day", :regions => [:bg_en]},
|
|
@@ -25,7 +25,8 @@ module Holidays
|
|
|
25
25
|
4 => [{:mday => 1, :name => "Εθνική Ημέρα Κύπρου", :regions => [:cy]}],
|
|
26
26
|
5 => [{:mday => 1, :name => "Πρωτομαγιά", :regions => [:cy]}],
|
|
27
27
|
8 => [{:mday => 15, :name => "Κοίμηση της Θεοτόκου", :regions => [:cy]}],
|
|
28
|
-
10 => [{:mday =>
|
|
28
|
+
10 => [{:mday => 1, :name => "Ημέρα Ανεξαρτησίας της Κύπρου", :regions => [:cy]},
|
|
29
|
+
{:mday => 28, :name => "Επέτειος του Όχι", :regions => [:cy]}],
|
|
29
30
|
12 => [{:mday => 25, :name => "Χριστούγεννα", :regions => [:cy]},
|
|
30
31
|
{:mday => 26, :name => "Δεύτερη ημέρα των Χριστουγέννων", :regions => [:cy]}]
|
|
31
32
|
}
|
|
@@ -154,8 +154,9 @@ module Holidays
|
|
|
154
154
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Holy Saturday", :regions => [:bg_en]},
|
|
155
155
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => -1, :name => "Велика събота", :regions => [:bg_bg]},
|
|
156
156
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Easter Sunday", :regions => [:bg_en]},
|
|
157
|
-
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Възкресение Христово. Великден", :regions => [:bg_bg
|
|
157
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :name => "Възкресение Христово. Великден", :regions => [:bg_bg]},
|
|
158
158
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Easter Monday", :regions => [:bg_en]},
|
|
159
|
+
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 1, :name => "Великденски понеделник", :regions => [:bg_bg]},
|
|
159
160
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Великдень", :regions => [:ua]},
|
|
160
161
|
{:function => "orthodox_easter(year)", :function_arguments => [:year], :function_modifier => 49, :observed => "to_monday_if_weekend(date)", :observed_arguments => [:date], :name => "Трійця", :regions => [:ua]}],
|
|
161
162
|
1 => [{:mday => 1, :name => "Neujahrstag", :regions => [:at]},
|
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.1
|
|
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.6
|
|
409
411
|
specification_version: 4
|
|
410
412
|
summary: A collection of Ruby methods to deal with statutory and other holidays.
|
|
411
413
|
test_files:
|