syobocalite 1.1.1 → 1.2.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/dependabot.yml +2 -0
- data/.github/workflows/pages.yml +6 -6
- data/.github/workflows/release_gem.yml +41 -0
- data/.github/workflows/test.yml +7 -6
- data/CHANGELOG.md +14 -1
- data/README.md +1 -1
- data/lib/syobocalite/db_client.rb +3 -1
- data/lib/syobocalite/version.rb +1 -1
- data/lib/syobocalite.rb +23 -1
- data/syobocalite.gemspec +1 -1
- metadata +18 -20
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 16dcb33d89c4e004b4a0cd199f661bcd8d1571e1f1e2315672829b73c18b3166
|
|
4
|
+
data.tar.gz: a45d70ba1da31245c8b158f84084e080b81ff47264dde5c57c949d8c04e63c06
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0a5840389cc0a86c512ba360ae1cf662785a1a287d35ea0157142bd8e0a3c260f21a6b416c5aceb7612f1d2948188fc2539dedf715d9bdc49688e017c499f369
|
|
7
|
+
data.tar.gz: b487d090bba9d5aaf5716676416d3b817b3144812b4be875c2d9568fc9221feb5c4af24f75e50bdcbfee13a9b1ec31e45682b540251c16c8037e37621f5d57bc
|
data/.github/dependabot.yml
CHANGED
data/.github/workflows/pages.yml
CHANGED
|
@@ -30,9 +30,9 @@ jobs:
|
|
|
30
30
|
runs-on: ubuntu-latest
|
|
31
31
|
steps:
|
|
32
32
|
- name: Checkout
|
|
33
|
-
uses: actions/checkout@
|
|
33
|
+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
34
34
|
|
|
35
|
-
- uses: ruby/setup-ruby@v1
|
|
35
|
+
- uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
|
36
36
|
with:
|
|
37
37
|
ruby-version: ruby
|
|
38
38
|
bundler-cache: true
|
|
@@ -40,18 +40,18 @@ jobs:
|
|
|
40
40
|
- run: bundle exec yard
|
|
41
41
|
|
|
42
42
|
- name: Setup Pages
|
|
43
|
-
uses: actions/configure-pages@v5
|
|
43
|
+
uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5.0.0
|
|
44
44
|
- name: Upload artifact
|
|
45
|
-
uses: actions/upload-pages-artifact@
|
|
45
|
+
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
|
|
46
46
|
with:
|
|
47
47
|
# Upload entire repository
|
|
48
48
|
path: './doc'
|
|
49
49
|
- name: Deploy to GitHub Pages
|
|
50
50
|
id: deployment
|
|
51
|
-
uses: actions/deploy-pages@
|
|
51
|
+
uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
|
|
52
52
|
|
|
53
53
|
- name: Slack Notification (not success)
|
|
54
|
-
uses: act10ns/slack@v2
|
|
54
|
+
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
|
|
55
55
|
if: "! success()"
|
|
56
56
|
continue-on-error: true
|
|
57
57
|
with:
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
name: Publish gem to rubygems.org
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
|
|
6
|
+
jobs:
|
|
7
|
+
release:
|
|
8
|
+
if: github.repository == 'sue445/syobocalite'
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
environment:
|
|
12
|
+
name: rubygems.org
|
|
13
|
+
url: https://rubygems.org/gems/syobocalite
|
|
14
|
+
|
|
15
|
+
permissions:
|
|
16
|
+
contents: write
|
|
17
|
+
id-token: write
|
|
18
|
+
|
|
19
|
+
steps:
|
|
20
|
+
- name: Harden Runner
|
|
21
|
+
uses: step-security/harden-runner@ec9f2d5744a09debf3a187a3f4f675c53b671911 # v2.13.0
|
|
22
|
+
with:
|
|
23
|
+
egress-policy: audit
|
|
24
|
+
|
|
25
|
+
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0
|
|
26
|
+
|
|
27
|
+
- name: Set up Ruby
|
|
28
|
+
uses: ruby/setup-ruby@eaecf785f6a34567a6d97f686bbb7bccc1ac1e5c # v1.237.0
|
|
29
|
+
with:
|
|
30
|
+
bundler-cache: true
|
|
31
|
+
ruby-version: ruby
|
|
32
|
+
|
|
33
|
+
- name: Publish to RubyGems
|
|
34
|
+
uses: rubygems/release-gem@a25424ba2ba8b387abc8ef40807c2c85b96cbe32 # v1.1.1
|
|
35
|
+
|
|
36
|
+
- name: Create GitHub release
|
|
37
|
+
run: |
|
|
38
|
+
tag_name="$(git describe --tags --abbrev=0)"
|
|
39
|
+
gh release create "${tag_name}" --verify-tag --generate-notes
|
|
40
|
+
env:
|
|
41
|
+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/test.yml
CHANGED
|
@@ -28,11 +28,12 @@ jobs:
|
|
|
28
28
|
- "3.1"
|
|
29
29
|
- "3.2"
|
|
30
30
|
- "3.3"
|
|
31
|
+
- "3.4"
|
|
31
32
|
|
|
32
33
|
steps:
|
|
33
|
-
- uses: actions/checkout@
|
|
34
|
+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
34
35
|
|
|
35
|
-
- uses: ruby/setup-ruby@v1
|
|
36
|
+
- uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
|
36
37
|
with:
|
|
37
38
|
ruby-version: ${{ matrix.ruby }}
|
|
38
39
|
bundler-cache: true
|
|
@@ -41,7 +42,7 @@ jobs:
|
|
|
41
42
|
- run: bundle update --jobs $(nproc) --retry 3
|
|
42
43
|
|
|
43
44
|
- name: Setup Code Climate Test Reporter
|
|
44
|
-
uses: aktions/codeclimate-test-reporter@v1
|
|
45
|
+
uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
|
|
45
46
|
with:
|
|
46
47
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
47
48
|
command: before-build
|
|
@@ -50,7 +51,7 @@ jobs:
|
|
|
50
51
|
- run: bundle exec rspec
|
|
51
52
|
|
|
52
53
|
- name: Teardown Code Climate Test Reporter
|
|
53
|
-
uses: aktions/codeclimate-test-reporter@v1
|
|
54
|
+
uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
|
|
54
55
|
with:
|
|
55
56
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
56
57
|
command: after-build
|
|
@@ -58,7 +59,7 @@ jobs:
|
|
|
58
59
|
continue-on-error: true
|
|
59
60
|
|
|
60
61
|
- name: Slack Notification (not success)
|
|
61
|
-
uses: act10ns/slack@v2
|
|
62
|
+
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
|
|
62
63
|
if: "! success()"
|
|
63
64
|
continue-on-error: true
|
|
64
65
|
with:
|
|
@@ -74,7 +75,7 @@ jobs:
|
|
|
74
75
|
|
|
75
76
|
steps:
|
|
76
77
|
- name: Slack Notification (success)
|
|
77
|
-
uses: act10ns/slack@v2
|
|
78
|
+
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
|
|
78
79
|
if: always()
|
|
79
80
|
continue-on-error: true
|
|
80
81
|
with:
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
## master
|
|
2
|
-
[full changelog](https://github.com/sue445/syobocalite/compare/v1.
|
|
2
|
+
[full changelog](https://github.com/sue445/syobocalite/compare/v1.2.1...master)
|
|
3
|
+
|
|
4
|
+
## [1.2.1](https://github.com/sue445/syobocalite/releases/tag/v1.2.1)
|
|
5
|
+
[full changelog](https://github.com/sue445/syobocalite/compare/v1.2.0...v1.2.1)
|
|
6
|
+
|
|
7
|
+
* Release gem from GitHub Actions
|
|
8
|
+
* https://github.com/sue445/syobocalite/pull/55
|
|
9
|
+
|
|
10
|
+
## [1.2.0](https://github.com/sue445/syobocalite/releases/tag/v1.2.0)
|
|
11
|
+
[full changelog](https://github.com/sue445/syobocalite/compare/v1.1.1...v1.2.0)
|
|
12
|
+
|
|
13
|
+
* Retry when 429 error
|
|
14
|
+
* https://github.com/sue445/syobocalite/pull/53
|
|
15
|
+
* https://github.com/sue445/syobocalite/issues/52
|
|
3
16
|
|
|
4
17
|
## 1.1.1
|
|
5
18
|
[full changelog](https://github.com/sue445/syobocalite/compare/v1.1.0...v1.1.1)
|
data/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Lite client for [Syoboi calendar](http://cal.syoboi.jp/) API.
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/rb/syobocalite)
|
|
6
|
-
[](https://github.com/sue445/syobocalite/actions/workflows/test.yml)
|
|
7
7
|
[](https://coveralls.io/github/sue445/syobocalite?branch=master)
|
|
8
8
|
[](https://codeclimate.com/github/sue445/syobocalite/maintainability)
|
|
9
9
|
|
|
@@ -19,7 +19,9 @@ module Syobocalite
|
|
|
19
19
|
"User-Agent" => Syobocalite.user_agent,
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
-
xml =
|
|
22
|
+
xml = Syobocalite.with_retry do
|
|
23
|
+
URI.open("https://cal.syoboi.jp/db.php?#{params.to_param}", headers).read
|
|
24
|
+
end
|
|
23
25
|
response = MultiXml.parse(xml)
|
|
24
26
|
response["ProgLookupResponse"]["ProgItems"]["ProgItem"]["Flag"].to_i
|
|
25
27
|
end
|
data/lib/syobocalite/version.rb
CHANGED
data/lib/syobocalite.rb
CHANGED
|
@@ -47,7 +47,29 @@ module Syobocalite
|
|
|
47
47
|
"User-Agent" => user_agent,
|
|
48
48
|
}
|
|
49
49
|
|
|
50
|
-
|
|
50
|
+
with_retry do
|
|
51
|
+
URI.open("https://cal.syoboi.jp/cal_chk.php?#{params.to_param}", headers).read
|
|
52
|
+
end
|
|
51
53
|
end
|
|
52
54
|
private_class_method :fetch
|
|
55
|
+
|
|
56
|
+
MAX_RETRY_COUNT = 10
|
|
57
|
+
|
|
58
|
+
def self.with_retry
|
|
59
|
+
retry_count ||= 0
|
|
60
|
+
yield
|
|
61
|
+
rescue OpenURI::HTTPError => error
|
|
62
|
+
status_code = error.io.status[0].to_i
|
|
63
|
+
raise error unless status_code == 429
|
|
64
|
+
|
|
65
|
+
retry_count += 1
|
|
66
|
+
raise error if retry_count > MAX_RETRY_COUNT
|
|
67
|
+
|
|
68
|
+
# 1, 2, 4, 8, 16 ...
|
|
69
|
+
sleep_time = 2 ** (retry_count - 1)
|
|
70
|
+
|
|
71
|
+
sleep sleep_time
|
|
72
|
+
|
|
73
|
+
retry
|
|
74
|
+
end
|
|
53
75
|
end
|
data/syobocalite.gemspec
CHANGED
|
@@ -36,10 +36,10 @@ Gem::Specification.new do |spec|
|
|
|
36
36
|
|
|
37
37
|
spec.add_development_dependency "bundler", ">= 1.16"
|
|
38
38
|
spec.add_development_dependency "coveralls_reborn"
|
|
39
|
-
spec.add_development_dependency "pry-byebug"
|
|
40
39
|
spec.add_development_dependency "rake", ">= 10.0"
|
|
41
40
|
spec.add_development_dependency "rspec", "~> 3.0"
|
|
42
41
|
spec.add_development_dependency "rspec-its"
|
|
42
|
+
spec.add_development_dependency "term-ansicolor", "!= 1.11.1" # ref. https://github.com/flori/term-ansicolor/issues/41
|
|
43
43
|
spec.add_development_dependency "webmock"
|
|
44
44
|
spec.add_development_dependency "yard"
|
|
45
45
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: syobocalite
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.2.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- sue445
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: activesupport
|
|
@@ -66,20 +65,6 @@ dependencies:
|
|
|
66
65
|
- - ">="
|
|
67
66
|
- !ruby/object:Gem::Version
|
|
68
67
|
version: '0'
|
|
69
|
-
- !ruby/object:Gem::Dependency
|
|
70
|
-
name: pry-byebug
|
|
71
|
-
requirement: !ruby/object:Gem::Requirement
|
|
72
|
-
requirements:
|
|
73
|
-
- - ">="
|
|
74
|
-
- !ruby/object:Gem::Version
|
|
75
|
-
version: '0'
|
|
76
|
-
type: :development
|
|
77
|
-
prerelease: false
|
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
|
79
|
-
requirements:
|
|
80
|
-
- - ">="
|
|
81
|
-
- !ruby/object:Gem::Version
|
|
82
|
-
version: '0'
|
|
83
68
|
- !ruby/object:Gem::Dependency
|
|
84
69
|
name: rake
|
|
85
70
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -122,6 +107,20 @@ dependencies:
|
|
|
122
107
|
- - ">="
|
|
123
108
|
- !ruby/object:Gem::Version
|
|
124
109
|
version: '0'
|
|
110
|
+
- !ruby/object:Gem::Dependency
|
|
111
|
+
name: term-ansicolor
|
|
112
|
+
requirement: !ruby/object:Gem::Requirement
|
|
113
|
+
requirements:
|
|
114
|
+
- - "!="
|
|
115
|
+
- !ruby/object:Gem::Version
|
|
116
|
+
version: 1.11.1
|
|
117
|
+
type: :development
|
|
118
|
+
prerelease: false
|
|
119
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
120
|
+
requirements:
|
|
121
|
+
- - "!="
|
|
122
|
+
- !ruby/object:Gem::Version
|
|
123
|
+
version: 1.11.1
|
|
125
124
|
- !ruby/object:Gem::Dependency
|
|
126
125
|
name: webmock
|
|
127
126
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -160,6 +159,7 @@ files:
|
|
|
160
159
|
- ".coveralls.yml"
|
|
161
160
|
- ".github/dependabot.yml"
|
|
162
161
|
- ".github/workflows/pages.yml"
|
|
162
|
+
- ".github/workflows/release_gem.yml"
|
|
163
163
|
- ".github/workflows/test.yml"
|
|
164
164
|
- ".gitignore"
|
|
165
165
|
- ".rspec"
|
|
@@ -185,7 +185,6 @@ metadata:
|
|
|
185
185
|
changelog_uri: https://github.com/sue445/syobocalite/blob/master/CHANGELOG.md
|
|
186
186
|
documentation_uri: https://sue445.github.io/syobocalite/
|
|
187
187
|
rubygems_mfa_required: 'true'
|
|
188
|
-
post_install_message:
|
|
189
188
|
rdoc_options: []
|
|
190
189
|
require_paths:
|
|
191
190
|
- lib
|
|
@@ -200,8 +199,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
200
199
|
- !ruby/object:Gem::Version
|
|
201
200
|
version: '0'
|
|
202
201
|
requirements: []
|
|
203
|
-
rubygems_version: 3.
|
|
204
|
-
signing_key:
|
|
202
|
+
rubygems_version: 3.6.7
|
|
205
203
|
specification_version: 4
|
|
206
204
|
summary: Lite client for Syoboi calendar
|
|
207
205
|
test_files: []
|