verified_holidays 0.1.1 → 0.1.3
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 +15 -0
- 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 +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3c4b96d4d17e79668560eeb7802ba564d832a9ea991048509be14b38c3e990aa
|
|
4
|
+
data.tar.gz: e4da942e6a8407669184e28b1ec9a6f85a470ae902201a34c298e7e84b922770
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 807e383ef6bc891b24fab822a118360c15ac68ee9e87ab209616defb576d1344e4e7b4d8edaaa5941022efd6633cf67b580ba88fa3f1ddfa71e6d4b0e442e502
|
|
7
|
+
data.tar.gz: cd3945ab06bdfc181a7fa58a858f697c6816519848f9175415eae388336e6b597d6b2f2d455245518e74442e7e39e94963bef10670ec6b99a04d80b552d02f2a
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## [0.1.3] - 2026-03-29
|
|
4
|
+
|
|
5
|
+
- Replace numeric index access with header name access in `CabinetOffice.parse`
|
|
6
|
+
- Add Auto Release workflow
|
|
7
|
+
- Add auto-labeler workflows (file path labeler + branch prefix labeler)
|
|
8
|
+
|
|
9
|
+
## [0.1.2] - 2026-03-29
|
|
10
|
+
|
|
11
|
+
- Add SimpleCov with 90% minimum coverage threshold (line and branch)
|
|
12
|
+
- Add edge case tests for CSV parsing, Holiday model, Verifier, and main API
|
|
13
|
+
- Inline `CabinetOffice.parse_date` using `Date.strptime`
|
|
14
|
+
- Add `CabinetOffice.presence` to handle blank CSV fields
|
|
15
|
+
- Use `minmax` in `Verifier.filter_local_data`
|
|
16
|
+
- Simplify `Dataset#name` to one-liner
|
|
17
|
+
|
|
3
18
|
## [0.1.1] - 2026-03-23
|
|
4
19
|
|
|
5
20
|
- Move repository to GitHub Organization: `verified-holidays/verified_holidays`
|
|
@@ -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[
|
|
30
|
-
name = row[
|
|
34
|
+
date_str = presence(row['国民の祝日・休日月日'])
|
|
35
|
+
name = presence(row['国民の祝日・休日名称'])
|
|
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
|