pixela 3.1.0 → 3.2.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/pages.yml +3 -3
- data/.github/workflows/test.yml +1 -1
- data/CHANGELOG.md +8 -1
- data/lib/pixela/client/pixel_methods.rb +27 -0
- data/lib/pixela/pixel.rb +16 -0
- data/lib/pixela/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a336057a8b3d607b5bdce6259191278d1338995b5a68f3d44551bba1c3918fa
|
4
|
+
data.tar.gz: c63183b4a8484f6ac55841ef1362d103ab1e1aeeece0714f364c299239bd3872
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b3c14c121dd2df7e48f7f40d9639387685aca2e9925bf88af1803caf7941ce17ca89861615221b55ad7caed22cefe5eec908d953a0542988c814c6e8d50ef3f3
|
7
|
+
data.tar.gz: 80967736967c85edb89f6acfb41a713bd594e93f01874a1ddd9e7980ee6726e787297c7b0aa41944602b078227e5cfc5aa303137f12027944ff7c4c42bed05fb
|
data/.github/workflows/pages.yml
CHANGED
@@ -30,7 +30,7 @@ jobs:
|
|
30
30
|
runs-on: ubuntu-latest
|
31
31
|
steps:
|
32
32
|
- name: Checkout
|
33
|
-
uses: actions/checkout@
|
33
|
+
uses: actions/checkout@v4
|
34
34
|
|
35
35
|
- uses: ruby/setup-ruby@v1
|
36
36
|
with:
|
@@ -40,9 +40,9 @@ jobs:
|
|
40
40
|
- run: bundle exec yard
|
41
41
|
|
42
42
|
- name: Setup Pages
|
43
|
-
uses: actions/configure-pages@
|
43
|
+
uses: actions/configure-pages@v4
|
44
44
|
- name: Upload artifact
|
45
|
-
uses: actions/upload-pages-artifact@
|
45
|
+
uses: actions/upload-pages-artifact@v2
|
46
46
|
with:
|
47
47
|
# Upload entire repository
|
48
48
|
path: './doc'
|
data/.github/workflows/test.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v3.
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.2.0...master)
|
3
|
+
|
4
|
+
## v3.2.0
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.1.0...v3.2.0)
|
6
|
+
|
7
|
+
* Add Impl `Pixela::Client::PixelMethods#create_pixels` and `Pixela::Pixel#create_multi`
|
8
|
+
* https://github.com/sue445/pixela/pull/105
|
9
|
+
* https://github.com/a-know/Pixela/releases/tag/v1.28.0
|
3
10
|
|
4
11
|
## v3.1.0
|
5
12
|
[full changelog](http://github.com/sue445/pixela/compare/v3.0.0...v3.1.0)
|
@@ -26,6 +26,33 @@ module Pixela::Client::PixelMethods
|
|
26
26
|
end
|
27
27
|
end
|
28
28
|
|
29
|
+
# This API is used to register multiple Pixels (quantities for a specific day) at a time.
|
30
|
+
#
|
31
|
+
# @param graph_id [String]
|
32
|
+
# @param pixels [Array<Hash>] key: date, quantity, optional_data
|
33
|
+
#
|
34
|
+
# @return [Pixela::Response]
|
35
|
+
#
|
36
|
+
# @raise [Pixela::PixelaError] API is failed
|
37
|
+
#
|
38
|
+
# @see https://docs.pixe.la/entry/batch-post-pixels
|
39
|
+
#
|
40
|
+
# @example
|
41
|
+
# client.create_pixels(graph_id: "test-graph", pixels: [{date: Date.new(2018, 9, 15), quantity: 5, optional_data: {key: "value"}}])
|
42
|
+
def create_pixels(graph_id:, pixels:)
|
43
|
+
pixels = pixels.map do |pixel|
|
44
|
+
{
|
45
|
+
date: to_ymd(pixel[:date]),
|
46
|
+
quantity: pixel[:quantity].to_s,
|
47
|
+
optionalData: pixel[:optional_data]&.to_json,
|
48
|
+
}.compact
|
49
|
+
end
|
50
|
+
|
51
|
+
with_error_handling do
|
52
|
+
connection.post("users/#{username}/graphs/#{graph_id}/pixels", pixels).body
|
53
|
+
end
|
54
|
+
end
|
55
|
+
|
29
56
|
# Get registered quantity as "Pixel".
|
30
57
|
#
|
31
58
|
# @param graph_id [String]
|
data/lib/pixela/pixel.rb
CHANGED
@@ -38,6 +38,22 @@ module Pixela
|
|
38
38
|
client.create_pixel(graph_id: graph_id, date: date, quantity: quantity, optional_data: optional_data)
|
39
39
|
end
|
40
40
|
|
41
|
+
# This API is used to register multiple Pixels (quantities for a specific day) at a time.
|
42
|
+
#
|
43
|
+
# @param pixels [Array<Hash>] key: date, quantity, optional_data
|
44
|
+
#
|
45
|
+
# @return [Pixela::Response]
|
46
|
+
#
|
47
|
+
# @raise [Pixela::PixelaError] API is failed
|
48
|
+
#
|
49
|
+
# @see https://docs.pixe.la/entry/batch-post-pixels
|
50
|
+
#
|
51
|
+
# @example
|
52
|
+
# client.graph("test-graph").create_multi(pixels: [{date: Date.new(2018, 9, 15), quantity: 5, optional_data: {key: "value"}}])
|
53
|
+
def create_multi(pixels:)
|
54
|
+
client.create_pixels(graph_id: graph_id, pixels: pixels)
|
55
|
+
end
|
56
|
+
|
41
57
|
# Get registered quantity as "Pixel".
|
42
58
|
#
|
43
59
|
# @return [Pixela::Response]
|
data/lib/pixela/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pixela
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.
|
4
|
+
version: 3.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-
|
11
|
+
date: 2023-12-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -268,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
268
268
|
- !ruby/object:Gem::Version
|
269
269
|
version: '0'
|
270
270
|
requirements: []
|
271
|
-
rubygems_version: 3.4.
|
271
|
+
rubygems_version: 3.4.10
|
272
272
|
signing_key:
|
273
273
|
specification_version: 4
|
274
274
|
summary: Pixela API client for Ruby
|