pixela 3.0.0 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/dependabot.yml +10 -0
- data/.github/workflows/pages.yml +62 -0
- data/.github/workflows/test.yml +12 -30
- data/CHANGELOG.md +9 -2
- data/Gemfile +2 -0
- data/README.md +1 -1
- data/gemfiles/common.gemfile +4 -0
- data/gemfiles/faraday_2.gemfile +2 -0
- data/lib/pixela/client/pixel_methods.rb +46 -0
- data/lib/pixela/graph.rb +32 -0
- data/lib/pixela/version.rb +1 -1
- data/pixela.gemspec +6 -12
- metadata +8 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '0758a0f7230d97159b28dc76c5a840bf60542c800e0cb3424315ceaae6e00daf'
|
4
|
+
data.tar.gz: 79b3d72e7d69c326f413d5c4810f9fcb4568be7aabc711135a3580754f349d09
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 523cfa26b5678985aeea71992d4d60b5816bcb64fc256b9420cc32c050b35b49ba532d567d39c66e9fe5008bdfa6c83efce1434b766e594d8e1a7e92ca2781f5
|
7
|
+
data.tar.gz: a804acd66cf17fac4387a987d5453989202e02f91b359fbd921a1c9638921f0c4f3ce60c6842b84fcde1d95cd1439ac50037bb1603a3d9e57201c99f53c5752b
|
@@ -0,0 +1,10 @@
|
|
1
|
+
# c.f. https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file
|
2
|
+
version: 2
|
3
|
+
|
4
|
+
updates:
|
5
|
+
- package-ecosystem: github-actions
|
6
|
+
directory: /
|
7
|
+
schedule:
|
8
|
+
interval: weekly
|
9
|
+
assignees:
|
10
|
+
- sue445
|
@@ -0,0 +1,62 @@
|
|
1
|
+
# Simple workflow for deploying static content to GitHub Pages
|
2
|
+
name: Deploy static content to Pages
|
3
|
+
|
4
|
+
on:
|
5
|
+
# Runs on pushes targeting the default branch
|
6
|
+
push:
|
7
|
+
branches:
|
8
|
+
- master
|
9
|
+
|
10
|
+
# Allows you to run this workflow manually from the Actions tab
|
11
|
+
workflow_dispatch:
|
12
|
+
|
13
|
+
# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
|
14
|
+
permissions:
|
15
|
+
contents: read
|
16
|
+
pages: write
|
17
|
+
id-token: write
|
18
|
+
|
19
|
+
# Allow one concurrent deployment
|
20
|
+
concurrency:
|
21
|
+
group: "pages"
|
22
|
+
cancel-in-progress: true
|
23
|
+
|
24
|
+
jobs:
|
25
|
+
# Single deploy job since we're just deploying
|
26
|
+
deploy:
|
27
|
+
environment:
|
28
|
+
name: github-pages
|
29
|
+
url: ${{ steps.deployment.outputs.page_url }}
|
30
|
+
runs-on: ubuntu-latest
|
31
|
+
steps:
|
32
|
+
- name: Checkout
|
33
|
+
uses: actions/checkout@v3
|
34
|
+
|
35
|
+
- uses: ruby/setup-ruby@v1
|
36
|
+
with:
|
37
|
+
ruby-version: ruby
|
38
|
+
bundler-cache: true
|
39
|
+
|
40
|
+
- run: bundle exec yard
|
41
|
+
|
42
|
+
- name: Setup Pages
|
43
|
+
uses: actions/configure-pages@v3
|
44
|
+
- name: Upload artifact
|
45
|
+
uses: actions/upload-pages-artifact@v1
|
46
|
+
with:
|
47
|
+
# Upload entire repository
|
48
|
+
path: './doc'
|
49
|
+
- name: Deploy to GitHub Pages
|
50
|
+
id: deployment
|
51
|
+
uses: actions/deploy-pages@main
|
52
|
+
|
53
|
+
- name: Slack Notification (not success)
|
54
|
+
uses: lazy-actions/slatify@master
|
55
|
+
if: "! success()"
|
56
|
+
continue-on-error: true
|
57
|
+
with:
|
58
|
+
job_name: "*pages*"
|
59
|
+
type: ${{ job.status }}
|
60
|
+
icon_emoji: ":octocat:"
|
61
|
+
url: ${{ secrets.SLACK_WEBHOOK }}
|
62
|
+
token: ${{ secrets.GITHUB_TOKEN }}
|
data/.github/workflows/test.yml
CHANGED
@@ -16,8 +16,6 @@ jobs:
|
|
16
16
|
test:
|
17
17
|
runs-on: ubuntu-latest
|
18
18
|
|
19
|
-
container: ${{ matrix.ruby }}
|
20
|
-
|
21
19
|
env:
|
22
20
|
BUNDLE_GEMFILE: gemfiles/${{ matrix.gemfile }}.gemfile
|
23
21
|
|
@@ -26,36 +24,24 @@ jobs:
|
|
26
24
|
|
27
25
|
matrix:
|
28
26
|
ruby:
|
29
|
-
-
|
30
|
-
-
|
31
|
-
-
|
32
|
-
-
|
33
|
-
-
|
27
|
+
- "2.6"
|
28
|
+
- "2.7"
|
29
|
+
- "3.0"
|
30
|
+
- "3.1"
|
31
|
+
- "3.2"
|
34
32
|
gemfile:
|
35
33
|
- faraday_2
|
36
|
-
include:
|
37
|
-
- ruby: rubylang/ruby:master-nightly-bionic
|
38
|
-
allow_failures: "true"
|
39
34
|
|
40
35
|
steps:
|
41
|
-
- uses: actions/checkout@
|
36
|
+
- uses: actions/checkout@v3
|
42
37
|
|
43
|
-
-
|
44
|
-
uses: actions/cache@v1
|
45
|
-
id: cache_gem
|
38
|
+
- uses: ruby/setup-ruby@v1
|
46
39
|
with:
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
v1-gem-${{ runner.os }}-${{ matrix.ruby }}-${{ matrix.gemfile }}-
|
51
|
-
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
40
|
+
ruby-version: ${{ matrix.ruby }}
|
41
|
+
bundler-cache: true
|
42
|
+
cache-version: ${{ matrix.gemfile }}
|
52
43
|
|
53
|
-
-
|
54
|
-
run: |
|
55
|
-
set -xe
|
56
|
-
bundle config path vendor/bundle
|
57
|
-
bundle update --jobs $(nproc) --retry 3
|
58
|
-
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
44
|
+
- run: bundle update --jobs $(nproc) --retry 3
|
59
45
|
|
60
46
|
- name: Setup Code Climate Test Reporter
|
61
47
|
uses: aktions/codeclimate-test-reporter@v1
|
@@ -64,11 +50,7 @@ jobs:
|
|
64
50
|
command: before-build
|
65
51
|
continue-on-error: true
|
66
52
|
|
67
|
-
-
|
68
|
-
run: |
|
69
|
-
set -xe
|
70
|
-
bundle exec rspec
|
71
|
-
continue-on-error: ${{ matrix.allow_failures == 'true' }}
|
53
|
+
- run: bundle exec rspec
|
72
54
|
|
73
55
|
- name: Teardown Code Climate Test Reporter
|
74
56
|
uses: aktions/codeclimate-test-reporter@v1
|
data/CHANGELOG.md
CHANGED
@@ -1,10 +1,17 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v3.
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.1.0...master)
|
3
|
+
|
4
|
+
## v3.1.0
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v3.0.0...v3.1.0)
|
6
|
+
|
7
|
+
* Add `Pixela::Client#add_pixel` and `Pixela::Client#subtract_pixel`
|
8
|
+
* https://github.com/sue445/pixela/pull/101
|
9
|
+
* https://github.com/a-know/Pixela/releases/tag/v1.26.0
|
3
10
|
|
4
11
|
## v3.0.0
|
5
12
|
[full changelog](http://github.com/sue445/pixela/compare/v2.2.1...v3.0.0)
|
6
13
|
|
7
|
-
* Support faraday v2+ and drop support ruby < 2.6
|
14
|
+
* :bomb: **[BREAKING CHANGE]** Support faraday v2+ and drop support ruby < 2.6
|
8
15
|
* https://github.com/sue445/pixela/pull/91
|
9
16
|
|
10
17
|
## v2.2.1
|
data/Gemfile
CHANGED
data/README.md
CHANGED
data/gemfiles/faraday_2.gemfile
CHANGED
@@ -138,4 +138,50 @@ module Pixela::Client::PixelMethods
|
|
138
138
|
connection.put("users/#{username}/graphs/#{graph_id}/decrement").body
|
139
139
|
end
|
140
140
|
end
|
141
|
+
|
142
|
+
# Add quantity to the "Pixel" of the day
|
143
|
+
#
|
144
|
+
# @param graph_id [String]
|
145
|
+
# @param quantity [String]
|
146
|
+
#
|
147
|
+
# @return [Pixela::Response]
|
148
|
+
#
|
149
|
+
# @raise [Pixela::PixelaError] API is failed
|
150
|
+
#
|
151
|
+
# @see https://docs.pixe.la/entry/add-pixel
|
152
|
+
#
|
153
|
+
# @example
|
154
|
+
# client.add_pixel(graph_id: "test-graph", quantity: "1")
|
155
|
+
def add_pixel(graph_id:, quantity:)
|
156
|
+
params = {
|
157
|
+
quantity: quantity.to_s,
|
158
|
+
}
|
159
|
+
|
160
|
+
with_error_handling do
|
161
|
+
connection.put("users/#{username}/graphs/#{graph_id}/add", params.compact).body
|
162
|
+
end
|
163
|
+
end
|
164
|
+
|
165
|
+
# Subtract quantity from the "Pixel" of the day
|
166
|
+
#
|
167
|
+
# @param graph_id [String]
|
168
|
+
# @param quantity [String]
|
169
|
+
#
|
170
|
+
# @return [Pixela::Response]
|
171
|
+
#
|
172
|
+
# @raise [Pixela::PixelaError] API is failed
|
173
|
+
#
|
174
|
+
# @see https://docs.pixe.la/entry/subtract-pixel
|
175
|
+
#
|
176
|
+
# @example
|
177
|
+
# client.subtract_pixel(graph_id: "test-graph", quantity: "1")
|
178
|
+
def subtract_pixel(graph_id:, quantity:)
|
179
|
+
params = {
|
180
|
+
quantity: quantity.to_s,
|
181
|
+
}
|
182
|
+
|
183
|
+
with_error_handling do
|
184
|
+
connection.put("users/#{username}/graphs/#{graph_id}/subtract", params.compact).body
|
185
|
+
end
|
186
|
+
end
|
141
187
|
end
|
data/lib/pixela/graph.rb
CHANGED
@@ -132,6 +132,38 @@ module Pixela
|
|
132
132
|
client.decrement_pixel(graph_id: graph_id)
|
133
133
|
end
|
134
134
|
|
135
|
+
# Add quantity to the "Pixel" of the day
|
136
|
+
#
|
137
|
+
# @param quantity [String]
|
138
|
+
#
|
139
|
+
# @return [Pixela::Response]
|
140
|
+
#
|
141
|
+
# @raise [Pixela::PixelaError] API is failed
|
142
|
+
#
|
143
|
+
# @see https://docs.pixe.la/entry/add-pixel
|
144
|
+
#
|
145
|
+
# @example
|
146
|
+
# client.graph("test-graph").add(quantity: "1")
|
147
|
+
def add(quantity:)
|
148
|
+
client.add_pixel(graph_id: graph_id, quantity: quantity)
|
149
|
+
end
|
150
|
+
|
151
|
+
# Subtract quantity from the "Pixel" of the day
|
152
|
+
#
|
153
|
+
# @param quantity [String]
|
154
|
+
#
|
155
|
+
# @return [Pixela::Response]
|
156
|
+
#
|
157
|
+
# @raise [Pixela::PixelaError] API is failed
|
158
|
+
#
|
159
|
+
# @see https://docs.pixe.la/entry/subtract-pixel
|
160
|
+
#
|
161
|
+
# @example
|
162
|
+
# client.graph("test-graph").subtract(quantity: "1")
|
163
|
+
def subtract(quantity:)
|
164
|
+
client.subtract_pixel(graph_id: graph_id, quantity: quantity)
|
165
|
+
end
|
166
|
+
|
135
167
|
# Get a Date list of Pixel registered in the graph specified by graphID.
|
136
168
|
#
|
137
169
|
# @param from [Date] Specify the start position of the period.
|
data/lib/pixela/version.rb
CHANGED
data/pixela.gemspec
CHANGED
@@ -14,17 +14,11 @@ Gem::Specification.new do |spec|
|
|
14
14
|
spec.homepage = "https://github.com/sue445/pixela"
|
15
15
|
spec.license = "MIT"
|
16
16
|
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
spec.metadata["changelog_uri"] = spec.homepage + "/blob/master/CHANGELOG.md"
|
23
|
-
spec.metadata["rubygems_mfa_required"] = "true"
|
24
|
-
else
|
25
|
-
raise "RubyGems 2.0 or newer is required to protect against " \
|
26
|
-
"public gem pushes."
|
27
|
-
end
|
17
|
+
spec.metadata["homepage_uri"] = spec.homepage
|
18
|
+
spec.metadata["source_code_uri"] = spec.homepage
|
19
|
+
spec.metadata["changelog_uri"] = spec.homepage + "/blob/master/CHANGELOG.md"
|
20
|
+
spec.metadata["documentation_uri"] = "https://sue445.github.io/pixela/"
|
21
|
+
spec.metadata["rubygems_mfa_required"] = "true"
|
28
22
|
|
29
23
|
# Specify which files should be added to the gem when it is released.
|
30
24
|
# The `git ls-files -z` loads the files in the RubyGem that have been added into git.
|
@@ -42,7 +36,7 @@ Gem::Specification.new do |spec|
|
|
42
36
|
spec.add_dependency "faraday-mashify"
|
43
37
|
|
44
38
|
spec.add_development_dependency "bundler", ">= 1.16"
|
45
|
-
spec.add_development_dependency "
|
39
|
+
spec.add_development_dependency "coveralls_reborn"
|
46
40
|
spec.add_development_dependency "dotenv"
|
47
41
|
spec.add_development_dependency "rake", ">= 10.0"
|
48
42
|
spec.add_development_dependency "rspec", "~> 3.0"
|
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.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -67,7 +67,7 @@ dependencies:
|
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '1.16'
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
70
|
+
name: coveralls_reborn
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
72
72
|
requirements:
|
73
73
|
- - ">="
|
@@ -215,6 +215,8 @@ extra_rdoc_files: []
|
|
215
215
|
files:
|
216
216
|
- ".coveralls.yml"
|
217
217
|
- ".env.example"
|
218
|
+
- ".github/dependabot.yml"
|
219
|
+
- ".github/workflows/pages.yml"
|
218
220
|
- ".github/workflows/test.yml"
|
219
221
|
- ".gitignore"
|
220
222
|
- ".rspec"
|
@@ -226,6 +228,7 @@ files:
|
|
226
228
|
- Rakefile
|
227
229
|
- bin/console
|
228
230
|
- bin/setup
|
231
|
+
- gemfiles/common.gemfile
|
229
232
|
- gemfiles/faraday_2.gemfile
|
230
233
|
- lib/pixela.rb
|
231
234
|
- lib/pixela/client.rb
|
@@ -248,6 +251,7 @@ metadata:
|
|
248
251
|
homepage_uri: https://github.com/sue445/pixela
|
249
252
|
source_code_uri: https://github.com/sue445/pixela
|
250
253
|
changelog_uri: https://github.com/sue445/pixela/blob/master/CHANGELOG.md
|
254
|
+
documentation_uri: https://sue445.github.io/pixela/
|
251
255
|
rubygems_mfa_required: 'true'
|
252
256
|
post_install_message:
|
253
257
|
rdoc_options: []
|
@@ -264,7 +268,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
268
|
- !ruby/object:Gem::Version
|
265
269
|
version: '0'
|
266
270
|
requirements: []
|
267
|
-
rubygems_version: 3.
|
271
|
+
rubygems_version: 3.4.6
|
268
272
|
signing_key:
|
269
273
|
specification_version: 4
|
270
274
|
summary: Pixela API client for Ruby
|