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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8bf224234d064575a5e2d60e74f9aac823e62e71fd28389ea0b1be39e380fa6c
4
- data.tar.gz: 1e3f31e88cbec4989403d3078541e272f18a0da9f3ade17268ffc4ab748f099a
3
+ metadata.gz: 944420c7b9c7c781545fd7cba415430d2f1120cd9ee546a7b7d78ae9724847f0
4
+ data.tar.gz: 59b34d3f385a68881d8d33c93c9332ca3cf034f282c3a606a50e4bc752240d2d
5
5
  SHA512:
6
- metadata.gz: f2a5466e749d0bb1b4a53cfe37750a6769eb8aa7aafa81f3849c6fdad67bde357f11ea6a83a4bdcbf8dd314dd065e5993680419c0b708e50c43e17cdae1ec066
7
- data.tar.gz: 0e914bc27a8658f5e545faec361560fda9326c8bbedfcd90555ab324137b3f5886e37e7a3c35782f6a8edbdc3006e559dbc420dfc4daf83b372e4f571fc6dbb2
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
- [![Test](https://github.com/55728/verified_holidays/actions/workflows/test.yml/badge.svg)](https://github.com/55728/verified_holidays/actions/workflows/test.yml)
4
- [![Weekly Verification](https://github.com/55728/verified_holidays/actions/workflows/verify.yml/badge.svg)](https://github.com/55728/verified_holidays/actions/workflows/verify.yml)
3
+ [![Test](https://github.com/verified-holidays/verified_holidays/actions/workflows/test.yml/badge.svg)](https://github.com/verified-holidays/verified_holidays/actions/workflows/test.yml)
4
+ [![Weekly Verification](https://github.com/verified-holidays/verified_holidays/actions/workflows/verify.yml/badge.svg)](https://github.com/verified-holidays/verified_holidays/actions/workflows/verify.yml)
5
5
  [![Gem Version](https://badge.fury.io/rb/verified_holidays.svg)](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/55728/verified_holidays.
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]&.strip
30
- name = row[1]&.strip
34
+ date_str = presence(row[0])
35
+ name = presence(row[1])
31
36
  next if date_str.nil? || name.nil?
32
37
 
33
- holidays[parse_date(date_str)] = name
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
@@ -29,8 +29,7 @@ module VerifiedHolidays
29
29
  end
30
30
 
31
31
  def name(date)
32
- holiday = @holidays[to_date(date)]
33
- holiday&.name
32
+ @holidays[to_date(date)]&.name
34
33
  end
35
34
 
36
35
  def year(year)
@@ -27,9 +27,7 @@ module VerifiedHolidays
27
27
  end
28
28
 
29
29
  def self.filter_local_data(cabinet_data)
30
- cabinet_dates = cabinet_data.keys
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module VerifiedHolidays
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.2'
5
5
  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.0
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/55728/verified_holidays
46
+ homepage: https://github.com/verified-holidays/verified_holidays
47
47
  licenses:
48
48
  - MIT
49
49
  metadata:
50
- homepage_uri: https://github.com/55728/verified_holidays
51
- source_code_uri: https://github.com/55728/verified_holidays
52
- changelog_uri: https://github.com/55728/verified_holidays/blob/main/CHANGELOG.md
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: