verified_holidays 0.3.4 → 0.3.6
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/CHANGELOG.md +64 -27
- data/README.md +16 -1
- data/lib/verified_holidays/dataset.rb +3 -0
- data/lib/verified_holidays/version.rb +1 -1
- data/lib/verified_holidays.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d23810579aff92a44d860f690e7b078c55e8e2713db540cc3d074797dd672340
|
|
4
|
+
data.tar.gz: 8df69458dac1c3a7c1c93b38af6ca3e065a095c82ca1f1b4a215a5c77186daa9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c44adf4591ca95717f8fbb221478a4bcada3686943c2da9b3c9b33323374ef4e8a23ae849166415ab0583c2f0f7f68dee12efb3edfc9d052df8265a7551d661e
|
|
7
|
+
data.tar.gz: a948ded58d31e38ebc5aea06fe29a5394cf3742bd81e2de45ecc128e0d087e996f881d47d59ff23460061978c9dff9aeb7a7262468e1258db2881dc8f7a08157
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.3.6](https://github.com/verified-holidays/verified_holidays/compare/verified_holidays/v0.3.5...verified_holidays/v0.3.6) (2026-08-23)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* complete the holiday_jp drop-in compatibility ([#43](https://github.com/verified-holidays/verified_holidays/issues/43)) ([a09a5ee](https://github.com/verified-holidays/verified_holidays/commit/a09a5eeb14e526571e8252b321ecb9c1a1e20ae1))
|
|
9
|
+
|
|
10
|
+
## [0.3.5](https://github.com/verified-holidays/verified_holidays/compare/verified_holidays/v0.3.4...verified_holidays/v0.3.5) (2026-08-23)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Miscellaneous
|
|
14
|
+
|
|
15
|
+
* stop opening a new issue for every failed weekly verification ([#41](https://github.com/verified-holidays/verified_holidays/issues/41)) ([85e0c0a](https://github.com/verified-holidays/verified_holidays/commit/85e0c0a63ab55e473a4174d2b83ea3a57150d163))
|
|
16
|
+
|
|
3
17
|
## [0.3.4](https://github.com/verified-holidays/verified_holidays/compare/verified_holidays/v0.3.3...verified_holidays/v0.3.4) (2026-08-22)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -91,39 +105,62 @@
|
|
|
91
105
|
* add auto-assign workflow for pull requests ([#14](https://github.com/verified-holidays/verified_holidays/issues/14)) ([a09ac2e](https://github.com/verified-holidays/verified_holidays/commit/a09ac2e7b432c56fad6899ba0d32f24a86a91feb))
|
|
92
106
|
* introduce release-please for automated releases ([#12](https://github.com/verified-holidays/verified_holidays/issues/12)) ([6690b1b](https://github.com/verified-holidays/verified_holidays/commit/6690b1b355504ca794a950e1b8841b68f4e880fb))
|
|
93
107
|
|
|
94
|
-
## [0.1.4]
|
|
108
|
+
## [0.1.4](https://github.com/verified-holidays/verified_holidays/compare/v0.1.3...v0.1.4) (2026-03-29)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
### Bug Fixes
|
|
112
|
+
|
|
113
|
+
* fix file path labeler removing branch-based labels (sync-labels: false) ([#10](https://github.com/verified-holidays/verified_holidays/issues/10)) ([d3068c7](https://github.com/verified-holidays/verified_holidays/commit/d3068c7c82e08924ee386367829029f3b7ebba59))
|
|
95
114
|
|
|
96
|
-
|
|
115
|
+
## [0.1.3](https://github.com/verified-holidays/verified_holidays/compare/v0.1.2...v0.1.3) (2026-03-29)
|
|
97
116
|
|
|
98
|
-
## [0.1.3] - 2026-03-29
|
|
99
117
|
|
|
100
|
-
|
|
101
|
-
- Add Auto Release workflow
|
|
102
|
-
- Add auto-labeler workflows (file path labeler + branch prefix labeler)
|
|
118
|
+
### Refactoring
|
|
103
119
|
|
|
104
|
-
|
|
120
|
+
* replace numeric index access with header name access in `CabinetOffice.parse` ([#6](https://github.com/verified-holidays/verified_holidays/issues/6)) ([1feb3b7](https://github.com/verified-holidays/verified_holidays/commit/1feb3b725d8f6e134ac2dcfe5de5d0171dc7f96f))
|
|
105
121
|
|
|
106
|
-
- Add SimpleCov with 90% minimum coverage threshold (line and branch)
|
|
107
|
-
- Add edge case tests for CSV parsing, Holiday model, Verifier, and main API
|
|
108
|
-
- Inline `CabinetOffice.parse_date` using `Date.strptime`
|
|
109
|
-
- Add `CabinetOffice.presence` to handle blank CSV fields
|
|
110
|
-
- Use `minmax` in `Verifier.filter_local_data`
|
|
111
|
-
- Simplify `Dataset#name` to one-liner
|
|
112
122
|
|
|
113
|
-
|
|
123
|
+
### Miscellaneous
|
|
124
|
+
|
|
125
|
+
* add Auto Release workflow ([#7](https://github.com/verified-holidays/verified_holidays/issues/7)) ([86531e3](https://github.com/verified-holidays/verified_holidays/commit/86531e3ba11712a25b2278fe81e52ed130df99c2))
|
|
126
|
+
* add auto-labeler workflows (file path labeler + branch prefix labeler) ([#8](https://github.com/verified-holidays/verified_holidays/issues/8)) ([7e3edc9](https://github.com/verified-holidays/verified_holidays/commit/7e3edc950daa7e665713da587820c7c6723ff172))
|
|
114
127
|
|
|
115
|
-
|
|
116
|
-
- Update all repository URLs in gemspec, README badges, and contributing link
|
|
128
|
+
## [0.1.2](https://github.com/verified-holidays/verified_holidays/compare/v0.1.1...v0.1.2) (2026-03-29)
|
|
117
129
|
|
|
118
|
-
## [0.1.0] - 2026-03-20
|
|
119
130
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
131
|
+
### Refactoring
|
|
132
|
+
|
|
133
|
+
* add `CabinetOffice.presence` to handle blank CSV fields ([#4](https://github.com/verified-holidays/verified_holidays/issues/4)) ([eadc150](https://github.com/verified-holidays/verified_holidays/commit/eadc150ea1f202a5974b2fb5d0539610feedb1f9))
|
|
134
|
+
* inline `CabinetOffice.parse_date` using `Date.strptime` ([#3](https://github.com/verified-holidays/verified_holidays/issues/3)) ([f31d1f9](https://github.com/verified-holidays/verified_holidays/commit/f31d1f91514b0182b941d22925b4698f3af927d2))
|
|
135
|
+
* simplify `Dataset#name` to one-liner ([#4](https://github.com/verified-holidays/verified_holidays/issues/4)) ([eadc150](https://github.com/verified-holidays/verified_holidays/commit/eadc150ea1f202a5974b2fb5d0539610feedb1f9))
|
|
136
|
+
* use `minmax` in `Verifier.filter_local_data` ([#4](https://github.com/verified-holidays/verified_holidays/issues/4)) ([eadc150](https://github.com/verified-holidays/verified_holidays/commit/eadc150ea1f202a5974b2fb5d0539610feedb1f9))
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
### Miscellaneous
|
|
140
|
+
|
|
141
|
+
* add edge case tests for CSV parsing, Holiday model, Verifier, and main API ([#2](https://github.com/verified-holidays/verified_holidays/issues/2)) ([1b54b72](https://github.com/verified-holidays/verified_holidays/commit/1b54b729206c4ccd719357d4e2c95a3ea66ba4b5))
|
|
142
|
+
* add SimpleCov with 90% minimum coverage threshold (line and branch) ([#2](https://github.com/verified-holidays/verified_holidays/issues/2)) ([1b54b72](https://github.com/verified-holidays/verified_holidays/commit/1b54b729206c4ccd719357d4e2c95a3ea66ba4b5))
|
|
143
|
+
|
|
144
|
+
## [0.1.1](https://github.com/verified-holidays/verified_holidays/compare/v0.1.0...v0.1.1) (2026-03-23)
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
### Miscellaneous
|
|
148
|
+
|
|
149
|
+
* move repository to GitHub Organization: `verified-holidays/verified_holidays` ([#1](https://github.com/verified-holidays/verified_holidays/issues/1)) ([ef5ef60](https://github.com/verified-holidays/verified_holidays/commit/ef5ef60f08a6aa81c33ee92082f59e7241226cca))
|
|
150
|
+
* update all repository URLs in gemspec, README badges, and contributing link ([#1](https://github.com/verified-holidays/verified_holidays/issues/1)) ([ef5ef60](https://github.com/verified-holidays/verified_holidays/commit/ef5ef60f08a6aa81c33ee92082f59e7241226cca))
|
|
151
|
+
|
|
152
|
+
## 0.1.0 (2026-03-20)
|
|
153
|
+
|
|
154
|
+
|
|
155
|
+
### Features
|
|
156
|
+
|
|
157
|
+
* initial release as `verified_holidays` (previously developed as `shukujitsu`) ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
158
|
+
* `VerifiedHolidays.holiday?` — check if a date is a Japanese national holiday ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
159
|
+
* `VerifiedHolidays.between` — list holidays in a date range ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
160
|
+
* `VerifiedHolidays.name` — get the holiday name for a date ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
161
|
+
* `VerifiedHolidays.year` — list all holidays for a given year ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
162
|
+
* `VerifiedHolidays.verify!` — verify built-in data against Cabinet Office CSV ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
163
|
+
* `VerifiedHolidays::Holiday` — holiday data class with `name_en`, `wday_name` ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
164
|
+
* holiday_jp drop-in compatibility via `require 'verified_holidays/holiday_jp_compat'` ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
165
|
+
* weekly CI verification against Cabinet Office official data ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
|
166
|
+
* holiday data from 1955 to 2027 (sourced from Cabinet Office CSV) ([c75225d](https://github.com/verified-holidays/verified_holidays/commit/c75225d5add7eb6790da43d00bcf6f3154132196))
|
data/README.md
CHANGED
|
@@ -32,7 +32,7 @@ require "verified_holidays"
|
|
|
32
32
|
VerifiedHolidays.holiday?(Date.new(2026, 1, 1)) # => true
|
|
33
33
|
VerifiedHolidays.holiday?(Date.new(2026, 3, 19)) # => false
|
|
34
34
|
|
|
35
|
-
# Date, DateTime, Time are all accepted
|
|
35
|
+
# Date, DateTime, Time (or anything responding to #to_date) are all accepted
|
|
36
36
|
VerifiedHolidays.holiday?(Time.new(2026, 1, 1)) # => true
|
|
37
37
|
|
|
38
38
|
# Get holidays in a date range
|
|
@@ -50,6 +50,21 @@ VerifiedHolidays.year(2026)
|
|
|
50
50
|
# => [#<VerifiedHolidays::Holiday>, ...]
|
|
51
51
|
```
|
|
52
52
|
|
|
53
|
+
### Time zones
|
|
54
|
+
|
|
55
|
+
A `Time` (or `DateTime`) is converted to a date using its own UTC offset, not
|
|
56
|
+
Japan Standard Time. A UTC time that already falls on a holiday in Japan may
|
|
57
|
+
therefore not be recognised as one:
|
|
58
|
+
|
|
59
|
+
```ruby
|
|
60
|
+
VerifiedHolidays.holiday?(Time.utc(2025, 12, 31, 15)) # => false (it is 2026-01-01 00:00 JST)
|
|
61
|
+
VerifiedHolidays.holiday?(Time.utc(2025, 12, 31, 15).getlocal("+09:00")) # => true
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
If your process does not run in JST, convert the time first (for example
|
|
65
|
+
`time.getlocal("+09:00")` or `time.in_time_zone("Tokyo")` with ActiveSupport).
|
|
66
|
+
This matches the behaviour of holiday_jp.
|
|
67
|
+
|
|
53
68
|
### Holiday object
|
|
54
69
|
|
|
55
70
|
```ruby
|
|
@@ -15,6 +15,7 @@ module VerifiedHolidays
|
|
|
15
15
|
def all
|
|
16
16
|
@holidays
|
|
17
17
|
end
|
|
18
|
+
alias holidays all
|
|
18
19
|
|
|
19
20
|
def between(start_date, last_date)
|
|
20
21
|
start_date = to_date(start_date)
|
|
@@ -44,6 +45,8 @@ module VerifiedHolidays
|
|
|
44
45
|
# DateTime is a subclass of Date, so convert it explicitly with .to_date.
|
|
45
46
|
return value.to_date if value.is_a?(DateTime) || value.is_a?(Time)
|
|
46
47
|
return value if value.is_a?(Date)
|
|
48
|
+
# Anything else that knows how to become a Date (holiday_jp accepts these too).
|
|
49
|
+
return value.to_date if value.respond_to?(:to_date)
|
|
47
50
|
|
|
48
51
|
raise ArgumentError, "expected Date, DateTime, or Time, got #{value.class}"
|
|
49
52
|
end
|
data/lib/verified_holidays.rb
CHANGED