pixela 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -1
- data/README.md +11 -0
- data/lib/pixela/client/graph_methods.rb +11 -6
- data/lib/pixela/graph.rb +7 -6
- data/lib/pixela/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 25fbb20e23770f6f80aa0f64c4deb5a307b3b51fa085d509e33a6f4515eac047
|
4
|
+
data.tar.gz: 86718c3b950f1478e0381480ae3ceab903b2be5cd32a4593999b36763b4b7d73
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c4a7061a46d3830d0e1fa9b0436920d7f751412ca1ff57ae34bdbfd991220d15c4707e46e3b67976b0f261d8bb13f338c0a3e01985a387ab2754b00c642d7a94
|
7
|
+
data.tar.gz: 774ea1249452fa072547fe1dd667298cf61cbc1328837150202918c5b9fdda0d94307cb257ffe0d77ec60f43d0adcf87cc96ea8a1808f324aa87461b1a532e6a
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v0.
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v0.3.0...master)
|
3
|
+
|
4
|
+
## v0.3.0
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v0.2.0...v0.3.0)
|
6
|
+
|
7
|
+
* Support purgeCacheURLs
|
8
|
+
* https://github.com/sue445/pixela/issues/20
|
9
|
+
* https://github.com/sue445/pixela/pull/22
|
3
10
|
|
4
11
|
## v0.2.0
|
5
12
|
[full changelog](http://github.com/sue445/pixela/compare/v0.1.1...v0.2.0)
|
data/README.md
CHANGED
@@ -41,6 +41,17 @@ require "date"
|
|
41
41
|
client.create_pixel(graph_id: "test-graph", date: Date.today, quantity: 5)
|
42
42
|
```
|
43
43
|
|
44
|
+
or
|
45
|
+
|
46
|
+
```ruby
|
47
|
+
# create graph
|
48
|
+
client.graph("test-graph").create(name: "graph-name", unit: "commit", type: "int", color: "shibafu")
|
49
|
+
|
50
|
+
# register value
|
51
|
+
client.graph("test-graph").pixel(Date.today).create(quantity: 5)
|
52
|
+
```
|
53
|
+
|
54
|
+
|
44
55
|
All methods are followings
|
45
56
|
|
46
57
|
https://www.rubydoc.info/gems/pixela/Pixela/Client
|
@@ -67,10 +67,11 @@ module Pixela::Client::GraphMethods
|
|
67
67
|
|
68
68
|
# Update predefined pixelation graph definitions.
|
69
69
|
#
|
70
|
-
# @param graph_id
|
71
|
-
# @param name
|
72
|
-
# @param unit
|
73
|
-
# @param color
|
70
|
+
# @param graph_id [String]
|
71
|
+
# @param name [String]
|
72
|
+
# @param unit [String]
|
73
|
+
# @param color [String]
|
74
|
+
# @param purge_cache_urls [String,Array<String>]
|
74
75
|
#
|
75
76
|
# @return [Hashie::Mash]
|
76
77
|
#
|
@@ -79,14 +80,18 @@ module Pixela::Client::GraphMethods
|
|
79
80
|
# @see https://pixe.la/#api-graph
|
80
81
|
#
|
81
82
|
# @example
|
82
|
-
# client.update_graph(graph_id: "test-graph", name: "graph-name", unit: "commit", color: "shibafu")
|
83
|
-
def update_graph(graph_id:, name:, unit:, color:)
|
83
|
+
# client.update_graph(graph_id: "test-graph", name: "graph-name", unit: "commit", color: "shibafu", purge_cache_urls: ["https://camo.githubusercontent.com/xxx/xxxx"])
|
84
|
+
def update_graph(graph_id:, name:, unit:, color:, purge_cache_urls: nil)
|
84
85
|
params = {
|
85
86
|
name: name,
|
86
87
|
unit: unit,
|
87
88
|
color: color,
|
88
89
|
}
|
89
90
|
|
91
|
+
if purge_cache_urls
|
92
|
+
params[:purgeCacheURLs] = Array(purge_cache_urls)
|
93
|
+
end
|
94
|
+
|
90
95
|
with_error_handling do
|
91
96
|
connection.put("users/#{username}/graphs/#{graph_id}", params, user_token_headers).body
|
92
97
|
end
|
data/lib/pixela/graph.rb
CHANGED
@@ -58,9 +58,10 @@ module Pixela
|
|
58
58
|
|
59
59
|
# Update predefined pixelation graph definitions.
|
60
60
|
#
|
61
|
-
# @param name
|
62
|
-
# @param unit
|
63
|
-
# @param color
|
61
|
+
# @param name [String]
|
62
|
+
# @param unit [String]
|
63
|
+
# @param color [String]
|
64
|
+
# @param purge_cache_urls [String,Array<String>]
|
64
65
|
#
|
65
66
|
# @return [Hashie::Mash]
|
66
67
|
#
|
@@ -69,9 +70,9 @@ module Pixela
|
|
69
70
|
# @see https://pixe.la/#api-graph
|
70
71
|
#
|
71
72
|
# @example
|
72
|
-
# client.graph("test-graph").update(name: "graph-name", unit: "commit", color: "shibafu")
|
73
|
-
def update(name:, unit:, color:)
|
74
|
-
client.update_graph(graph_id: graph_id, name: name, unit: unit, color: color)
|
73
|
+
# client.graph("test-graph").update(name: "graph-name", unit: "commit", color: "shibafu", purge_cache_urls: ["https://camo.githubusercontent.com/xxx/xxxx"])
|
74
|
+
def update(name:, unit:, color:, purge_cache_urls: nil)
|
75
|
+
client.update_graph(graph_id: graph_id, name: name, unit: unit, color: color, purge_cache_urls: purge_cache_urls)
|
75
76
|
end
|
76
77
|
|
77
78
|
# Increment quantity "Pixel" of the day (UTC).
|
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: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- sue445
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-10-
|
11
|
+
date: 2018-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|