pixela 2.0.0 → 2.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/workflows/test.yml +2 -2
- data/CHANGELOG.md +8 -1
- data/lib/pixela/client.rb +5 -2
- data/lib/pixela/client/profile_methods.rb +40 -0
- data/lib/pixela/client/user_methods.rb +1 -1
- data/lib/pixela/client/webhook_methods.rb +1 -1
- data/lib/pixela/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a3df84dc9f4591de4d69003caafb28e57d787a269dc70f9fed967d8787183579
|
4
|
+
data.tar.gz: 0e23cf942470fd6cbec58c8df6d157bc3bdd045cc7438162b67d170a241d327d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d4abcca60067437ac06d9b6dc76b92bc10edf54eed1260412ab7570b8d18153d297908f7339bebe5fb41c91c1170bb636b6c8dd9791108201cea72035fca02c3
|
7
|
+
data.tar.gz: 36f6d832bfaf3b7a470ec39ef365a261180a7b34fededd5d0e196322807f1aa811db23f643ac6c29d5de4e426f110096478f8414d12f343c2fa8ea7f23e195f5
|
data/.github/workflows/test.yml
CHANGED
@@ -92,7 +92,7 @@ jobs:
|
|
92
92
|
continue-on-error: true
|
93
93
|
|
94
94
|
- name: Slack Notification (not success)
|
95
|
-
uses:
|
95
|
+
uses: lazy-actions/slatify@master
|
96
96
|
if: "! success()"
|
97
97
|
continue-on-error: true
|
98
98
|
with:
|
@@ -110,7 +110,7 @@ jobs:
|
|
110
110
|
|
111
111
|
steps:
|
112
112
|
- name: Slack Notification (success)
|
113
|
-
uses:
|
113
|
+
uses: lazy-actions/slatify@master
|
114
114
|
if: always()
|
115
115
|
continue-on-error: true
|
116
116
|
with:
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v2.
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v2.1.0...master)
|
3
|
+
|
4
|
+
## v2.1.0
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v2.0.0...v2.1.0)
|
6
|
+
|
7
|
+
* Add `Pixela::Client#update_profile`
|
8
|
+
* https://github.com/sue445/pixela/pull/81
|
9
|
+
* https://github.com/a-know/Pixela/releases/tag/v1.20.0
|
3
10
|
|
4
11
|
## v2.0.0
|
5
12
|
[full changelog](http://github.com/sue445/pixela/compare/v1.5.0...v2.0.0)
|
data/lib/pixela/client.rb
CHANGED
@@ -2,15 +2,18 @@ module Pixela
|
|
2
2
|
class Client
|
3
3
|
autoload :GraphMethods, "pixela/client/graph_methods"
|
4
4
|
autoload :PixelMethods, "pixela/client/pixel_methods"
|
5
|
+
autoload :ProfileMethods, "pixela/client/profile_methods"
|
5
6
|
autoload :UserMethods, "pixela/client/user_methods"
|
6
7
|
autoload :WebhookMethods, "pixela/client/webhook_methods"
|
7
8
|
|
8
9
|
include GraphMethods
|
9
10
|
include PixelMethods
|
11
|
+
include ProfileMethods
|
10
12
|
include UserMethods
|
11
13
|
include WebhookMethods
|
12
14
|
|
13
15
|
API_ENDPOINT = "https://pixe.la/v1"
|
16
|
+
TOP_ENDPOINT = "https://pixe.la"
|
14
17
|
|
15
18
|
# @!attribute [r] username
|
16
19
|
# @return [String]
|
@@ -52,8 +55,8 @@ module Pixela
|
|
52
55
|
# @param request_headers [Hash]
|
53
56
|
#
|
54
57
|
# @return [Faraday::Connection]
|
55
|
-
def connection(request_headers
|
56
|
-
Faraday.new(url:
|
58
|
+
def connection(request_headers: user_token_headers, endpoint: API_ENDPOINT)
|
59
|
+
Faraday.new(url: endpoint, headers: request_headers) do |conn|
|
57
60
|
conn.request :json
|
58
61
|
conn.response :mashify, mash_class: Pixela::Response
|
59
62
|
conn.response :json
|
@@ -0,0 +1,40 @@
|
|
1
|
+
module Pixela::Client::ProfileMethods
|
2
|
+
# Updates the profile information for the user corresponding to username
|
3
|
+
#
|
4
|
+
# @param display_name [String]
|
5
|
+
# @param gravatar_icon_email [String]
|
6
|
+
# @param title [String]
|
7
|
+
# @param timezone [String]
|
8
|
+
# @param about_url [String]
|
9
|
+
# @param contribute_urls [Array<String>]
|
10
|
+
# @param pinned_graph_id [String]
|
11
|
+
#
|
12
|
+
# @return [Pixela::Response]
|
13
|
+
#
|
14
|
+
# @raise [Pixela::PixelaError] API is failed
|
15
|
+
#
|
16
|
+
# @see https://docs.pixe.la/entry/put-profile
|
17
|
+
#
|
18
|
+
# @example
|
19
|
+
# client.update_profile(display_name: "a-know", gravatar_icon_email: "user@example.com", title: "my title", timezone: "Asia/Tokyo", about_url: "https://home.a-know.me", contribute_urls: ["https://pixe.la/","https://github.com/a-know/pi","https://blog.a-know.me/archive/category/Pixela"])
|
20
|
+
def update_profile(display_name: nil, gravatar_icon_email: nil, title: nil, timezone: nil,
|
21
|
+
about_url: nil, contribute_urls: [], pinned_graph_id: nil)
|
22
|
+
|
23
|
+
params = {
|
24
|
+
displayName: display_name,
|
25
|
+
gravatarIconEmail: gravatar_icon_email,
|
26
|
+
title: title,
|
27
|
+
timezone: timezone,
|
28
|
+
aboutURL: about_url,
|
29
|
+
pinnedGraphID: pinned_graph_id
|
30
|
+
}
|
31
|
+
|
32
|
+
unless contribute_urls.empty?
|
33
|
+
params[:contributeURLs] = contribute_urls
|
34
|
+
end
|
35
|
+
|
36
|
+
with_error_handling do
|
37
|
+
connection(endpoint: Pixela::Client::TOP_ENDPOINT).put("@#{username}", params.compact).body
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
@@ -53,7 +53,7 @@ module Pixela::Client::WebhookMethods
|
|
53
53
|
# client.invoke_webhook(webhook_hash: "<webhookHash>")
|
54
54
|
def invoke_webhook(webhook_hash:)
|
55
55
|
with_error_handling do
|
56
|
-
connection(default_headers).post("users/#{username}/webhooks/#{webhook_hash}").body
|
56
|
+
connection(request_headers: default_headers).post("users/#{username}/webhooks/#{webhook_hash}").body
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
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: 2.
|
4
|
+
version: 2.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: 2020-10-
|
11
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -245,6 +245,7 @@ files:
|
|
245
245
|
- lib/pixela/client.rb
|
246
246
|
- lib/pixela/client/graph_methods.rb
|
247
247
|
- lib/pixela/client/pixel_methods.rb
|
248
|
+
- lib/pixela/client/profile_methods.rb
|
248
249
|
- lib/pixela/client/user_methods.rb
|
249
250
|
- lib/pixela/client/webhook_methods.rb
|
250
251
|
- lib/pixela/configuration.rb
|