holidays_from_google_calendar 0.4.7 → 1.0.0
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 +44 -0
- data/.rubocop.yml +1 -0
- data/README.md +2 -2
- data/Rakefile +2 -0
- data/holidays_from_google_calendar.gemspec +4 -3
- data/lib/holidays_from_google_calendar/client.rb +1 -1
- data/lib/holidays_from_google_calendar/version.rb +1 -1
- data/lib/holidays_from_google_calendar.rb +3 -0
- metadata +34 -20
- data/.travis.yml +0 -21
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 98ffb5d178e22fa195401b11f470d050452618e08b54d777c65a61c7f07c3ead
|
4
|
+
data.tar.gz: 8b1f8f362ecc9951248fe3f3ca5111591555db63c85f1777713e836abf2df6c0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92dbb171814dce93210969fe7bea8d0eafbc2cd9ec554bd7a87e706ae6f864d21a0b57edcc6aba25a8948151462a3f4c2bcd630e19ca3d1f3d72480c5f90adec
|
7
|
+
data.tar.gz: 1cb498335614a96d26d6752d1f30e38b2e694208acda0c91afc1bc1474c9cc6423b8b6478434a70deac69d3c92f17c64c037385643d9225cb231698435c905e3
|
@@ -0,0 +1,44 @@
|
|
1
|
+
name: CI
|
2
|
+
|
3
|
+
on:
|
4
|
+
workflow_dispatch:
|
5
|
+
push:
|
6
|
+
branches:
|
7
|
+
- master
|
8
|
+
pull_request_target:
|
9
|
+
branches:
|
10
|
+
- master
|
11
|
+
|
12
|
+
permissions:
|
13
|
+
contents: read
|
14
|
+
|
15
|
+
jobs:
|
16
|
+
test:
|
17
|
+
runs-on: ubuntu-latest
|
18
|
+
strategy:
|
19
|
+
matrix:
|
20
|
+
ruby-version:
|
21
|
+
- '2.6'
|
22
|
+
- '2.7'
|
23
|
+
- '3.0'
|
24
|
+
- '3.1'
|
25
|
+
|
26
|
+
steps:
|
27
|
+
- name: Checkout
|
28
|
+
uses: actions/checkout@v3
|
29
|
+
|
30
|
+
- name: Set up Ruby
|
31
|
+
uses: ruby/setup-ruby@v1
|
32
|
+
with:
|
33
|
+
ruby-version: ${{ matrix.ruby-version }}
|
34
|
+
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
|
35
|
+
|
36
|
+
- name: Run tests
|
37
|
+
run: bundle exec rake
|
38
|
+
env:
|
39
|
+
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
|
40
|
+
|
41
|
+
- name: Send test coverage report to Coveralls
|
42
|
+
uses: coverallsapp/github-action@master
|
43
|
+
with:
|
44
|
+
github-token: ${{ secrets.GITHUB_TOKEN }}
|
data/.rubocop.yml
CHANGED
data/README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1
1
|
# HolidaysFromGoogleCalendar
|
2
2
|
|
3
|
-
[](https://github.com/necojackarc/holidays_from_google_calendar/actions/workflows/ci.yml)
|
4
|
+
[](https://coveralls.io/github/necojackarc/holidays_from_google_calendar?branch=master)
|
4
5
|
[](https://codeclimate.com/github/necojackarc/holidays_from_google_calendar)
|
5
|
-
[](https://codeclimate.com/github/necojackarc/holidays_from_google_calendar/coverage)
|
6
6
|
|
7
7
|
HolidaysFromGoogleCalendar can retrieve national holidays from Google Calendar with very simple interface.
|
8
8
|
|
data/Rakefile
CHANGED
@@ -19,13 +19,14 @@ Gem::Specification.new do |spec|
|
|
19
19
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
20
20
|
spec.require_paths = ["lib"]
|
21
21
|
|
22
|
-
spec.add_dependency "google-api-client", "~> 0.9"
|
23
22
|
spec.add_dependency "activesupport"
|
23
|
+
spec.add_dependency "google-apis-calendar_v3"
|
24
24
|
|
25
|
-
spec.add_development_dependency "bundler"
|
26
|
-
spec.add_development_dependency "rake", "~> 10.0"
|
25
|
+
spec.add_development_dependency "bundler"
|
27
26
|
spec.add_development_dependency "pry"
|
27
|
+
spec.add_development_dependency "rake"
|
28
28
|
spec.add_development_dependency "rspec"
|
29
29
|
spec.add_development_dependency "rspec-its"
|
30
30
|
spec.add_development_dependency "simplecov"
|
31
|
+
spec.add_development_dependency "simplecov-lcov"
|
31
32
|
end
|
@@ -4,7 +4,7 @@ module HolidaysFromGoogleCalendar
|
|
4
4
|
@nation = configuration.calendar[:nation]
|
5
5
|
@language = configuration.calendar[:language]
|
6
6
|
@api_key = configuration.credential[:api_key]
|
7
|
-
@cache = Cache.new(configuration.cache)
|
7
|
+
@cache = Cache.new(**configuration.cache)
|
8
8
|
|
9
9
|
return unless configuration.preload[:enable]
|
10
10
|
preload(configuration.preload[:date_range])
|
@@ -1,3 +1,5 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
1
3
|
require "active_support"
|
2
4
|
require "active_support/core_ext"
|
3
5
|
require "google/apis/calendar_v3"
|
@@ -33,6 +35,7 @@ module HolidaysFromGoogleCalendar
|
|
33
35
|
|
34
36
|
def holiday?(date)
|
35
37
|
return true if date.wday.in?([0, 6]) # If Sunday or Saturday
|
38
|
+
|
36
39
|
@client.retrieve(date_min: date, date_max: date).size > 0
|
37
40
|
end
|
38
41
|
end
|
metadata
CHANGED
@@ -1,31 +1,31 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: holidays_from_google_calendar
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- necojackarc
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-09-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: activesupport
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - "
|
17
|
+
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0
|
19
|
+
version: '0'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - "
|
24
|
+
- - ">="
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0
|
26
|
+
version: '0'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: google-apis-calendar_v3
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
@@ -42,32 +42,32 @@ dependencies:
|
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - "
|
45
|
+
- - ">="
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '
|
47
|
+
version: '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: '0'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
|
-
name:
|
56
|
+
name: pry
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
58
58
|
requirements:
|
59
|
-
- - "
|
59
|
+
- - ">="
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: '
|
61
|
+
version: '0'
|
62
62
|
type: :development
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
|
-
- - "
|
66
|
+
- - ">="
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: '
|
68
|
+
version: '0'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: rake
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - ">="
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: simplecov-lcov
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
125
139
|
description: Retriving national holidays from Google Calendar.
|
126
140
|
email:
|
127
141
|
- necojackarc@gmail.com
|
@@ -129,10 +143,10 @@ executables: []
|
|
129
143
|
extensions: []
|
130
144
|
extra_rdoc_files: []
|
131
145
|
files:
|
146
|
+
- ".github/workflows/ci.yml"
|
132
147
|
- ".gitignore"
|
133
148
|
- ".rspec"
|
134
149
|
- ".rubocop.yml"
|
135
|
-
- ".travis.yml"
|
136
150
|
- CODE_OF_CONDUCT.md
|
137
151
|
- Gemfile
|
138
152
|
- LICENSE.txt
|
@@ -167,7 +181,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
167
181
|
- !ruby/object:Gem::Version
|
168
182
|
version: '0'
|
169
183
|
requirements: []
|
170
|
-
rubygems_version: 3.
|
184
|
+
rubygems_version: 3.3.22
|
171
185
|
signing_key:
|
172
186
|
specification_version: 4
|
173
187
|
summary: Holidays from Google Calendar.
|
data/.travis.yml
DELETED
@@ -1,21 +0,0 @@
|
|
1
|
-
env:
|
2
|
-
global:
|
3
|
-
- CC_TEST_REPORTER_ID=a5c4305696a06c12d5071d9c5bbda7d604be0495ad47c6199389f633fcbdaf86
|
4
|
-
language: ruby
|
5
|
-
rvm:
|
6
|
-
- 2.0
|
7
|
-
- 2.1
|
8
|
-
- 2.2
|
9
|
-
- 2.3
|
10
|
-
- 2.4
|
11
|
-
- 2.5
|
12
|
-
before_install:
|
13
|
-
- gem update --system --no-document
|
14
|
-
before_script:
|
15
|
-
- curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
16
|
-
- chmod +x ./cc-test-reporter
|
17
|
-
- ./cc-test-reporter before-build
|
18
|
-
after_script:
|
19
|
-
- ./cc-test-reporter after-build --exit-code $TRAVIS_TEST_RESULT
|
20
|
-
notifications:
|
21
|
-
email: false
|