holiday_jp 0.8.0 → 0.8.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/ci.yml +13 -2
- data/holiday_jp.gemspec +1 -1
- data/lib/holiday_jp/holidays.rb +7 -1
- data/lib/holiday_jp/version.rb +1 -1
- data/test/test_holiday_jp_yaml.rb +14 -2
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0523a366e362391427a6198272efe83400eb96b6bf7acf288e235d18af3c07c2
|
4
|
+
data.tar.gz: a02c07d0ce33167223fbc27f06665ece51319a498b8fd2ae0392cebe369f30bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0ced4474b85335737692bdbae6e968af8c2d7a1869bbd3b25e5775449f729df1e00da162543b650b3bd682b1b1d3a63b5daaf8f87a519abae2aedb673f1f193
|
7
|
+
data.tar.gz: a5223092d0050d0e6d4e11ba0e0a0764580782664306f6f93b08902b6748d2a8e2289f464f645a9757cab9b4e80394ac259052624a3f0905041ad1d523ef25e2
|
data/.github/workflows/ci.yml
CHANGED
@@ -3,6 +3,9 @@ name: test
|
|
3
3
|
|
4
4
|
on:
|
5
5
|
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
pull_request:
|
6
9
|
schedule:
|
7
10
|
- cron: '0 1 * * *'
|
8
11
|
|
@@ -12,9 +15,17 @@ jobs:
|
|
12
15
|
runs-on: ubuntu-latest
|
13
16
|
strategy:
|
14
17
|
matrix:
|
15
|
-
ruby-version: [
|
18
|
+
ruby-version: ['2.4', '2.5', '2.6', '2.7']
|
19
|
+
experimental: [false]
|
20
|
+
include:
|
21
|
+
- ruby-version: '3.0'
|
22
|
+
experimental: true
|
23
|
+
- ruby-version: '3.1'
|
24
|
+
experimental: true
|
25
|
+
continue-on-error: ${{ matrix.experimental }}
|
26
|
+
|
16
27
|
steps:
|
17
|
-
- uses:
|
28
|
+
- uses: ruby/setup-ruby@v1
|
18
29
|
with:
|
19
30
|
ruby-version: ${{ matrix.ruby-version }}
|
20
31
|
|
data/holiday_jp.gemspec
CHANGED
data/lib/holiday_jp/holidays.rb
CHANGED
@@ -6,7 +6,13 @@ module HolidayJp
|
|
6
6
|
|
7
7
|
def initialize
|
8
8
|
@holidays = {}
|
9
|
-
yaml =
|
9
|
+
yaml = {}
|
10
|
+
file = File.expand_path("../../../holidays.yml", __FILE__)
|
11
|
+
if YAML.respond_to?(:unsafe_load_file)
|
12
|
+
yaml = YAML.unsafe_load_file(file)
|
13
|
+
else
|
14
|
+
yaml = YAML.load_file(file)
|
15
|
+
end
|
10
16
|
yaml.map do |key, value|
|
11
17
|
@holidays[key] = Holiday.new(key, value)
|
12
18
|
end
|
data/lib/holiday_jp/version.rb
CHANGED
@@ -5,11 +5,23 @@ require 'yaml'
|
|
5
5
|
|
6
6
|
class TestHolidayJpYaml < Test::Unit::TestCase
|
7
7
|
def test_yaml
|
8
|
-
yaml =
|
8
|
+
yaml = {}
|
9
|
+
file = File.expand_path("../../holidays.yml", __FILE__)
|
10
|
+
if YAML.respond_to?(:unsafe_load_file)
|
11
|
+
yaml = YAML.unsafe_load_file(file)
|
12
|
+
else
|
13
|
+
yaml = YAML.load_file(file)
|
14
|
+
end
|
15
|
+
holiday_jp_yaml = {}
|
9
16
|
uri = URI.parse('https://raw.githubusercontent.com/holiday-jp/holiday_jp/v0.x/holidays.yml')
|
10
17
|
http = Net::HTTP.new(uri.host, uri.port)
|
11
18
|
http.use_ssl = true
|
12
|
-
|
19
|
+
response_body = http.get(uri.request_uri).body
|
20
|
+
if YAML.respond_to?(:unsafe_load)
|
21
|
+
holiday_jp_yaml = YAML.unsafe_load(response_body)
|
22
|
+
else
|
23
|
+
holiday_jp_yaml = YAML.load(response_body)
|
24
|
+
end
|
13
25
|
yaml.map do |date, name|
|
14
26
|
assert_equal holiday_jp_yaml[date], name
|
15
27
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holiday_jp
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Komagata
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-01-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -42,16 +42,16 @@ dependencies:
|
|
42
42
|
name: test-unit
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- -
|
45
|
+
- - "<"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version:
|
47
|
+
version: '4.0'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- -
|
52
|
+
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version:
|
54
|
+
version: '4.0'
|
55
55
|
description: Japanese Holidays from 1970 to 2050.
|
56
56
|
email:
|
57
57
|
- komagata@gmail.com
|
@@ -81,7 +81,7 @@ files:
|
|
81
81
|
homepage: http://github.com/komagata/holiday_jp
|
82
82
|
licenses: []
|
83
83
|
metadata: {}
|
84
|
-
post_install_message:
|
84
|
+
post_install_message:
|
85
85
|
rdoc_options: []
|
86
86
|
require_paths:
|
87
87
|
- lib
|
@@ -96,8 +96,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
requirements: []
|
99
|
-
rubygems_version: 3.
|
100
|
-
signing_key:
|
99
|
+
rubygems_version: 3.3.5
|
100
|
+
signing_key:
|
101
101
|
specification_version: 4
|
102
102
|
summary: Japanese Holidays.
|
103
103
|
test_files:
|