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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 245d38a5c8da2a19b31e3d621bab11be044147077ddc1d8926ce8cae228152be
4
- data.tar.gz: 378bf2f361bbf229c93142175f7365389273a9f0cafaa7dbaedf0eeeb14af943
3
+ metadata.gz: 25fbb20e23770f6f80aa0f64c4deb5a307b3b51fa085d509e33a6f4515eac047
4
+ data.tar.gz: 86718c3b950f1478e0381480ae3ceab903b2be5cd32a4593999b36763b4b7d73
5
5
  SHA512:
6
- metadata.gz: 57847e630f6b0c341cd8ba1ca75df3d23fbe8948cb4d36c8e947299d9c55818f94fe1ff81ecfa7462f1fd645aa92e0869c51c33b07ac3de8a42ecd782de46443
7
- data.tar.gz: 62f09e06bb0654249d494b216b467c2e27c821e227b670d1befb035047033c976fd1c41be4ae7712c54b2e9891bd1cc2cf1e2cb056c0a373155c7a5534c99958
6
+ metadata.gz: c4a7061a46d3830d0e1fa9b0436920d7f751412ca1ff57ae34bdbfd991220d15c4707e46e3b67976b0f261d8bb13f338c0a3e01985a387ab2754b00c642d7a94
7
+ data.tar.gz: 774ea1249452fa072547fe1dd667298cf61cbc1328837150202918c5b9fdda0d94307cb257ffe0d77ec60f43d0adcf87cc96ea8a1808f324aa87461b1a532e6a
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/pixela/compare/v0.2.0...master)
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 [String]
71
- # @param name [String]
72
- # @param unit [String]
73
- # @param color [String]
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
@@ -58,9 +58,10 @@ module Pixela
58
58
 
59
59
  # Update predefined pixelation graph definitions.
60
60
  #
61
- # @param name [String]
62
- # @param unit [String]
63
- # @param color [String]
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).
@@ -1,3 +1,3 @@
1
1
  module Pixela
2
- VERSION = "0.2.0"
2
+ VERSION = "0.3.0"
3
3
  end
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.2.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-17 00:00:00.000000000 Z
11
+ date: 2018-10-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday