pixela 1.1.0 → 1.2.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: dcc5605956279b4c01b0c67fb573e7c28623c78b488a74b323922790de902e7d
4
- data.tar.gz: c4f32689c73fe71b27a5fd24530dd4b58220ca6ad9903cf44700c07d5f9215ed
3
+ metadata.gz: 729e3f74af8018ea0e332f4a349a0eb69591ddb08a7c89a0adea62f4727aca0c
4
+ data.tar.gz: 24e40fbcf152dfc2ec69a027bb9a3a8b0de17b090a567396a0c7c0ce165adee8
5
5
  SHA512:
6
- metadata.gz: 149f1ee7315422c8d31b6d1fbc0cff9a668be0b044563a16f3c22d2388f313361dbe8d6713b16127612220d7ff670570f4ae2285fef140b1ea46e8d769936b93
7
- data.tar.gz: 70856d12a2fbe7cc92fcf8c2697aef7a3ba98f6bf8a4659a9708a2edb06b8122f2dfeb3ebd5241550bb0cedd45584d405d822c9d9a5b3e272ffae10a2de54f60
6
+ metadata.gz: 0452b7cf21f9829b5777863749fe5e51be6b0f64b9fcc5c215dfe94ddf01f44c22b4637d68ecd99a9c1ea19d4b48f08eca809a09b30f725aea6e1a6c27465ecc
7
+ data.tar.gz: c808d02bfa6aaca74d599f09c41717b6f743ba3b180b7afc14d4c5c4d63034ce8b4442e524d8c1694b6a19038bc82aabb8dc8f6332490ad50306c0ce719eee2f
@@ -1,8 +1,15 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/pixela/compare/v1.1.0...master)
2
+ [full changelog](http://github.com/sue445/pixela/compare/v1.2.0...master)
3
+
4
+ ## v1.2.0
5
+ [full changelog](http://github.com/sue445/pixela/compare/v1.1.0...v1.2.0)
6
+
7
+ * Add `Pixela::Client#get_graph_stats` and `Pixela::Graph#stats`
8
+ * https://github.com/sue445/pixela/pull/53
9
+ * https://github.com/a-know/Pixela/releases/tag/v1.10.0
3
10
 
4
11
  ## v1.1.0
5
- [full changelog](http://github.com/sue445/pixela/compare/v1.0.1...v1.1.1)
12
+ [full changelog](http://github.com/sue445/pixela/compare/v1.0.1...v1.1.0)
6
13
 
7
14
  * Add `Pixela::Client#get_pixel_dates` and `Pixela::Graph#pixel_dates`
8
15
  * https://github.com/sue445/pixela/pull/49
@@ -155,4 +155,22 @@ module Pixela::Client::GraphMethods
155
155
 
156
156
  res.pixels.map { |ymd| Date.parse(ymd) }
157
157
  end
158
+
159
+ # Based on the registered information, get various statistics.
160
+ #
161
+ # @param graph_id [String]
162
+ #
163
+ # @return [Pixela::Response]
164
+ #
165
+ # @raise [Pixela::PixelaError] API is failed
166
+ #
167
+ # @see https://docs.pixe.la/#/get-graph-stats
168
+ #
169
+ # @example
170
+ # client.get_graph_stats(graph_id: "test-graph")
171
+ def get_graph_stats(graph_id:)
172
+ with_error_handling do
173
+ connection.get("users/#{username}/graphs/#{graph_id}/stats").body
174
+ end
175
+ end
158
176
  end
@@ -134,9 +134,23 @@ module Pixela
134
134
  # @see https://docs.pixe.la/#/get-graph-pixels
135
135
  #
136
136
  # @example
137
- # client.get_pixels(graph_id: "test-graph", from: Date.new(2018, 1, 1), to: Date.new(2018, 12, 31))
137
+ # client.graph("test-graph").pixel_dates(from: Date.new(2018, 1, 1), to: Date.new(2018, 12, 31))
138
138
  def pixel_dates(from: nil, to: nil)
139
139
  client.get_pixel_dates(graph_id: graph_id, from: from, to: to)
140
140
  end
141
+
142
+ # Based on the registered information, get various statistics.
143
+ #
144
+ # @return [Pixela::Response]
145
+ #
146
+ # @raise [Pixela::PixelaError] API is failed
147
+ #
148
+ # @see https://docs.pixe.la/#/get-graph-stats
149
+ #
150
+ # @example
151
+ # client.graph("test-graph").stats
152
+ def stats
153
+ client.get_graph_stats(graph_id: graph_id)
154
+ end
141
155
  end
142
156
  end
@@ -1,3 +1,3 @@
1
1
  module Pixela
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.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: 1.1.0
4
+ version: 1.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: 2019-02-19 00:00:00.000000000 Z
11
+ date: 2019-04-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday