verified_holidays 0.1.0 → 0.1.2
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 +14 -0
- data/README.md +3 -3
- data/lib/verified_holidays/cabinet_office.rb +8 -9
- data/lib/verified_holidays/dataset.rb +1 -2
- data/lib/verified_holidays/verifier.rb +1 -3
- data/lib/verified_holidays/version.rb +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 944420c7b9c7c781545fd7cba415430d2f1120cd9ee546a7b7d78ae9724847f0
|
|
4
|
+
data.tar.gz: 59b34d3f385a68881d8d33c93c9332ca3cf034f282c3a606a50e4bc752240d2d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 9471bd8cbafe922cd5f878f755e8ca1e289c2097dedd2336828ca1492ad6f74a9a21f75d27b221238f40da65461eb6dd88ea9ae360d0e8126c8ad742158920b2
|
|
7
|
+
data.tar.gz: f9b8c96b9df0d1163668ecff3b6de041513fc89397a33527c46be009e0f29ca5780765ddee5f8dc37127005d2ee1ff60943518665c7fe9a4f7e36220b8b1d540
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.2] - 2026-03-29
|
|
4
|
+
|
|
5
|
+
- Add SimpleCov with 90% minimum coverage threshold (line and branch)
|
|
6
|
+
- Add edge case tests for CSV parsing, Holiday model, Verifier, and main API
|
|
7
|
+
- Inline `CabinetOffice.parse_date` using `Date.strptime`
|
|
8
|
+
- Add `CabinetOffice.presence` to handle blank CSV fields
|
|
9
|
+
- Use `minmax` in `Verifier.filter_local_data`
|
|
10
|
+
- Simplify `Dataset#name` to one-liner
|
|
11
|
+
|
|
12
|
+
## [0.1.1] - 2026-03-23
|
|
13
|
+
|
|
14
|
+
- Move repository to GitHub Organization: `verified-holidays/verified_holidays`
|
|
15
|
+
- Update all repository URLs in gemspec, README badges, and contributing link
|
|
16
|
+
|
|
3
17
|
## [0.1.0] - 2026-03-20
|
|
4
18
|
|
|
5
19
|
- Initial release as `verified_holidays` (previously developed as `shukujitsu`)
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# VerifiedHolidays
|
|
2
2
|
|
|
3
|
-
[](https://github.com/verified-holidays/verified_holidays/actions/workflows/test.yml)
|
|
4
|
+
[](https://github.com/verified-holidays/verified_holidays/actions/workflows/verify.yml)
|
|
5
5
|
[](https://badge.fury.io/rb/verified_holidays)
|
|
6
6
|
|
|
7
7
|
Japanese national holiday gem with **weekly verification against the Cabinet Office official data**.
|
|
@@ -103,7 +103,7 @@ The data is provided under the terms of the [Government of Japan Standard Terms
|
|
|
103
103
|
|
|
104
104
|
## Contributing
|
|
105
105
|
|
|
106
|
-
Bug reports and pull requests are welcome on GitHub at https://github.com/
|
|
106
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/verified-holidays/verified_holidays.
|
|
107
107
|
|
|
108
108
|
## License
|
|
109
109
|
|
|
@@ -23,22 +23,21 @@ module VerifiedHolidays
|
|
|
23
23
|
parse(utf8)
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
def self.presence(str)
|
|
27
|
+
str&.strip&.then { |s| s unless s.empty? }
|
|
28
|
+
end
|
|
29
|
+
private_class_method :presence
|
|
30
|
+
|
|
26
31
|
def self.parse(csv_string)
|
|
27
32
|
holidays = {}
|
|
28
33
|
CSV.parse(csv_string, headers: true) do |row|
|
|
29
|
-
date_str = row[0]
|
|
30
|
-
name = row[1]
|
|
34
|
+
date_str = presence(row[0])
|
|
35
|
+
name = presence(row[1])
|
|
31
36
|
next if date_str.nil? || name.nil?
|
|
32
37
|
|
|
33
|
-
holidays[
|
|
38
|
+
holidays[Date.strptime(date_str, '%Y/%m/%d')] = name
|
|
34
39
|
end
|
|
35
40
|
holidays
|
|
36
41
|
end
|
|
37
|
-
|
|
38
|
-
def self.parse_date(date_str)
|
|
39
|
-
parts = date_str.split('/')
|
|
40
|
-
Date.new(parts[0].to_i, parts[1].to_i, parts[2].to_i)
|
|
41
|
-
end
|
|
42
|
-
private_class_method :parse_date
|
|
43
42
|
end
|
|
44
43
|
end
|
|
@@ -27,9 +27,7 @@ module VerifiedHolidays
|
|
|
27
27
|
end
|
|
28
28
|
|
|
29
29
|
def self.filter_local_data(cabinet_data)
|
|
30
|
-
|
|
31
|
-
min_date = cabinet_dates.min
|
|
32
|
-
max_date = cabinet_dates.max
|
|
30
|
+
min_date, max_date = cabinet_data.keys.minmax
|
|
33
31
|
|
|
34
32
|
Dataset.instance.all.select { |date, _| date.between?(min_date, max_date) }
|
|
35
33
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: verified_holidays
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.2
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Kenta Ishizaki
|
|
@@ -43,13 +43,13 @@ files:
|
|
|
43
43
|
- lib/verified_holidays/holiday_jp_compat.rb
|
|
44
44
|
- lib/verified_holidays/verifier.rb
|
|
45
45
|
- lib/verified_holidays/version.rb
|
|
46
|
-
homepage: https://github.com/
|
|
46
|
+
homepage: https://github.com/verified-holidays/verified_holidays
|
|
47
47
|
licenses:
|
|
48
48
|
- MIT
|
|
49
49
|
metadata:
|
|
50
|
-
homepage_uri: https://github.com/
|
|
51
|
-
source_code_uri: https://github.com/
|
|
52
|
-
changelog_uri: https://github.com/
|
|
50
|
+
homepage_uri: https://github.com/verified-holidays/verified_holidays
|
|
51
|
+
source_code_uri: https://github.com/verified-holidays/verified_holidays
|
|
52
|
+
changelog_uri: https://github.com/verified-holidays/verified_holidays/blob/main/CHANGELOG.md
|
|
53
53
|
rubygems_mfa_required: 'true'
|
|
54
54
|
rdoc_options: []
|
|
55
55
|
require_paths:
|