pixela 3.4.0 → 3.5.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 +15 -2
- data/README.md +1 -1
- data/lib/pixela/client/graph_methods.rb +24 -0
- data/lib/pixela/graph.rb +16 -0
- data/lib/pixela/response.rb +15 -0
- data/lib/pixela/version.rb +1 -1
- metadata +4 -6
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3d39bdd23220713711c3d2ecbc65e66b95f874f71d8987e3b4ae02449db614c8
|
|
4
|
+
data.tar.gz: 48b0efd0a4c8e30f0d0bdbe6610eb7c215e0e5385dc99aa8f9d31100af87896f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 61efb3ed1806ea747a5d8356260eade052bbc03bb672be5d991a54ececf26928f11a8f2d2c21e762b93353deae3f231b90e4215b349a75c485c96c79d7827be9
|
|
7
|
+
data.tar.gz: 2f6295b3edc28e817d6c51248bbf22663a82af3db73da0c335a6112378a1cc9a38bd064f33d076317b9dbadadb8db79e2812816798ff64a1f9d03801b104c57c
|
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/pixela'
|
|
9
|
+
runs-on: ubuntu-latest
|
|
10
|
+
|
|
11
|
+
environment:
|
|
12
|
+
name: rubygems.org
|
|
13
|
+
url: https://rubygems.org/gems/pixela
|
|
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
|
@@ -30,13 +30,14 @@ jobs:
|
|
|
30
30
|
- "3.1"
|
|
31
31
|
- "3.2"
|
|
32
32
|
- "3.3"
|
|
33
|
+
- "3.4"
|
|
33
34
|
gemfile:
|
|
34
35
|
- faraday_2
|
|
35
36
|
|
|
36
37
|
steps:
|
|
37
|
-
- uses: actions/checkout@
|
|
38
|
+
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
|
|
38
39
|
|
|
39
|
-
- uses: ruby/setup-ruby@v1
|
|
40
|
+
- uses: ruby/setup-ruby@8aeb6ff8030dd539317f8e1769a044873b56ea71 # v1.268.0
|
|
40
41
|
with:
|
|
41
42
|
ruby-version: ${{ matrix.ruby }}
|
|
42
43
|
bundler-cache: true
|
|
@@ -45,7 +46,7 @@ jobs:
|
|
|
45
46
|
- run: bundle update --jobs $(nproc) --retry 3
|
|
46
47
|
|
|
47
48
|
- name: Setup Code Climate Test Reporter
|
|
48
|
-
uses: aktions/codeclimate-test-reporter@v1
|
|
49
|
+
uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
|
|
49
50
|
with:
|
|
50
51
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
51
52
|
command: before-build
|
|
@@ -54,7 +55,7 @@ jobs:
|
|
|
54
55
|
- run: bundle exec rspec
|
|
55
56
|
|
|
56
57
|
- name: Teardown Code Climate Test Reporter
|
|
57
|
-
uses: aktions/codeclimate-test-reporter@v1
|
|
58
|
+
uses: aktions/codeclimate-test-reporter@7634aa9ac7883182f583f15ff7b6ff519939dd0a # v1.2.0
|
|
58
59
|
with:
|
|
59
60
|
codeclimate-test-reporter-id: ${{ secrets.CC_TEST_REPORTER_ID }}
|
|
60
61
|
command: after-build
|
|
@@ -71,7 +72,7 @@ jobs:
|
|
|
71
72
|
continue-on-error: true
|
|
72
73
|
|
|
73
74
|
- name: Slack Notification (not success)
|
|
74
|
-
uses: act10ns/slack@v2
|
|
75
|
+
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
|
|
75
76
|
if: "! success()"
|
|
76
77
|
continue-on-error: true
|
|
77
78
|
with:
|
|
@@ -87,7 +88,7 @@ jobs:
|
|
|
87
88
|
|
|
88
89
|
steps:
|
|
89
90
|
- name: Slack Notification (success)
|
|
90
|
-
uses: act10ns/slack@v2
|
|
91
|
+
uses: act10ns/slack@cfcc30955fe9377f4f55e1079e5419ee1014269f # v2
|
|
91
92
|
if: always()
|
|
92
93
|
continue-on-error: true
|
|
93
94
|
with:
|
data/CHANGELOG.md
CHANGED
|
@@ -1,7 +1,20 @@
|
|
|
1
1
|
## Unreleased
|
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v3.
|
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.5.1...master)
|
|
3
3
|
|
|
4
|
-
## v3.
|
|
4
|
+
## [v3.5.1](https://github.com/sue445/pixela/releases/tag/v3.5.1)
|
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.5.0...v3.5.1)
|
|
6
|
+
|
|
7
|
+
* Release gem from GitHub Actions
|
|
8
|
+
* https://github.com/sue445/pixela/pull/122
|
|
9
|
+
|
|
10
|
+
## [v3.5.0](https://github.com/sue445/pixela/releases/tag/v3.5.0)
|
|
11
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.4.0...v3.5.0)
|
|
12
|
+
|
|
13
|
+
* Add `Pixela::Client::GraphMethods#get_graph_today` and `Pixela::Graph#today`
|
|
14
|
+
* https://github.com/sue445/pixela/pull/117
|
|
15
|
+
* https://github.com/a-know/Pixela/releases/tag/v1.32.0
|
|
16
|
+
|
|
17
|
+
## [v3.4.0](https://github.com/sue445/pixela/releases/tag/v3.4.0)
|
|
5
18
|
[full changelog](http://github.com/sue445/pixela/compare/v3.3.0...v3.4.0)
|
|
6
19
|
|
|
7
20
|
* Add `appearance`, `less_than` and `greather_than` to `Pixela::Client::GraphMethods#graph_url` and `Pixela::Graph#url`
|
data/README.md
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
[](https://badge.fury.io/rb/pixela)
|
|
6
6
|
[](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci.html)
|
|
7
|
-
[](https://github.com/sue445/pixela/actions/workflows/test.yml)
|
|
8
8
|
[](https://codeclimate.com/github/sue445/pixela/maintainability)
|
|
9
9
|
[](https://coveralls.io/github/sue445/pixela)
|
|
10
10
|
|
|
@@ -282,4 +282,28 @@ module Pixela::Client::GraphMethods
|
|
|
282
282
|
connection.get("users/#{username}/graphs/#{graph_id}/latest").body
|
|
283
283
|
end
|
|
284
284
|
end
|
|
285
|
+
|
|
286
|
+
# This is an endpoint that responds with the Pixel of the day you requested this API.
|
|
287
|
+
#
|
|
288
|
+
# @param graph_id [String]
|
|
289
|
+
# @param return_empty [Boolean] Specifying `true` for this param will return an empty Pixel instead of `404 Not Found` if the Pixel is unregistered on the day of the request.
|
|
290
|
+
#
|
|
291
|
+
# @return [Pixela::Response]
|
|
292
|
+
#
|
|
293
|
+
# @raise [Pixela::PixelaError] API is failed
|
|
294
|
+
#
|
|
295
|
+
# @see https://docs.pixe.la/entry/get-today-pixel
|
|
296
|
+
#
|
|
297
|
+
# @example
|
|
298
|
+
# client.get_graph_today(graph_id: "test-graph", return_empty: true)
|
|
299
|
+
def get_graph_today(graph_id:, return_empty: false)
|
|
300
|
+
params = {}
|
|
301
|
+
if return_empty
|
|
302
|
+
params[:returnEmpty] = return_empty
|
|
303
|
+
end
|
|
304
|
+
|
|
305
|
+
with_error_handling do
|
|
306
|
+
connection.get("users/#{username}/graphs/#{graph_id}/today", params.compact).body
|
|
307
|
+
end
|
|
308
|
+
end
|
|
285
309
|
end
|
data/lib/pixela/graph.rb
CHANGED
|
@@ -261,5 +261,21 @@ module Pixela
|
|
|
261
261
|
def latest
|
|
262
262
|
client.get_graph_latest(graph_id: graph_id)
|
|
263
263
|
end
|
|
264
|
+
|
|
265
|
+
# This is an endpoint that responds with the Pixel of the day you requested this API.
|
|
266
|
+
#
|
|
267
|
+
# @param return_empty [Boolean] Specifying `true` for this param will return an empty Pixel instead of `404 Not Found` if the Pixel is unregistered on the day of the request.
|
|
268
|
+
#
|
|
269
|
+
# @return [Pixela::Response]
|
|
270
|
+
#
|
|
271
|
+
# @raise [Pixela::PixelaError] API is failed
|
|
272
|
+
#
|
|
273
|
+
# @see https://docs.pixe.la/entry/get-today-pixel
|
|
274
|
+
#
|
|
275
|
+
# @example
|
|
276
|
+
# client.graph("test-graph").today(return_empty: true)
|
|
277
|
+
def today(return_empty: false)
|
|
278
|
+
client.get_graph_today(graph_id: graph_id, return_empty: return_empty)
|
|
279
|
+
end
|
|
264
280
|
end
|
|
265
281
|
end
|
data/lib/pixela/response.rb
CHANGED
|
@@ -1,6 +1,21 @@
|
|
|
1
|
+
# @!parse
|
|
2
|
+
# module Hashie
|
|
3
|
+
# # @see https://www.rubydoc.info/gems/hashie/Hashie/Hash
|
|
4
|
+
# class Hash < ::Hash
|
|
5
|
+
# end
|
|
6
|
+
#
|
|
7
|
+
# # @see https://www.rubydoc.info/gems/hashie/Hashie/Mash
|
|
8
|
+
# class Mash < Hash
|
|
9
|
+
# end
|
|
10
|
+
# end
|
|
11
|
+
|
|
1
12
|
module Pixela
|
|
2
13
|
require "hashie/mash"
|
|
3
14
|
|
|
15
|
+
# Pixela API response
|
|
16
|
+
#
|
|
17
|
+
# @see https://www.rubydoc.info/gems/hashie/Hashie/Hash
|
|
18
|
+
# @see https://www.rubydoc.info/gems/hashie/Hashie/Mash
|
|
4
19
|
class Response < Hashie::Mash
|
|
5
20
|
disable_warnings
|
|
6
21
|
end
|
data/lib/pixela/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: pixela
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.
|
|
4
|
+
version: 3.5.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: faraday
|
|
@@ -231,6 +230,7 @@ files:
|
|
|
231
230
|
- ".env.example"
|
|
232
231
|
- ".github/dependabot.yml"
|
|
233
232
|
- ".github/workflows/pages.yml"
|
|
233
|
+
- ".github/workflows/release_gem.yml"
|
|
234
234
|
- ".github/workflows/test.yml"
|
|
235
235
|
- ".gitignore"
|
|
236
236
|
- ".rspec"
|
|
@@ -267,7 +267,6 @@ metadata:
|
|
|
267
267
|
changelog_uri: https://github.com/sue445/pixela/blob/master/CHANGELOG.md
|
|
268
268
|
documentation_uri: https://sue445.github.io/pixela/
|
|
269
269
|
rubygems_mfa_required: 'true'
|
|
270
|
-
post_install_message:
|
|
271
270
|
rdoc_options: []
|
|
272
271
|
require_paths:
|
|
273
272
|
- lib
|
|
@@ -282,8 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
282
281
|
- !ruby/object:Gem::Version
|
|
283
282
|
version: '0'
|
|
284
283
|
requirements: []
|
|
285
|
-
rubygems_version: 3.
|
|
286
|
-
signing_key:
|
|
284
|
+
rubygems_version: 3.6.7
|
|
287
285
|
specification_version: 4
|
|
288
286
|
summary: Pixela API client for Ruby
|
|
289
287
|
test_files: []
|