pixela 1.0.1 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +1 -0
- data/CHANGELOG.md +8 -1
- data/README.md +2 -0
- data/lib/pixela/client.rb +2 -0
- data/lib/pixela/client/graph_methods.rb +28 -0
- data/lib/pixela/graph.rb +17 -0
- 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: dcc5605956279b4c01b0c67fb573e7c28623c78b488a74b323922790de902e7d
|
4
|
+
data.tar.gz: c4f32689c73fe71b27a5fd24530dd4b58220ca6ad9903cf44700c07d5f9215ed
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 149f1ee7315422c8d31b6d1fbc0cff9a668be0b044563a16f3c22d2388f313361dbe8d6713b16127612220d7ff670570f4ae2285fef140b1ea46e8d769936b93
|
7
|
+
data.tar.gz: 70856d12a2fbe7cc92fcf8c2697aef7a3ba98f6bf8a4659a9708a2edb06b8122f2dfeb3ebd5241550bb0cedd45584d405d822c9d9a5b3e272ffae10a2de54f60
|
data/.travis.yml
CHANGED
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,12 @@
|
|
1
1
|
## Unreleased
|
2
|
-
[full changelog](http://github.com/sue445/pixela/compare/v1.0
|
2
|
+
[full changelog](http://github.com/sue445/pixela/compare/v1.1.0...master)
|
3
|
+
|
4
|
+
## v1.1.0
|
5
|
+
[full changelog](http://github.com/sue445/pixela/compare/v1.0.1...v1.1.1)
|
6
|
+
|
7
|
+
* Add `Pixela::Client#get_pixel_dates` and `Pixela::Graph#pixel_dates`
|
8
|
+
* https://github.com/sue445/pixela/pull/49
|
9
|
+
* https://github.com/a-know/Pixela/releases/tag/v1.8.0
|
3
10
|
|
4
11
|
## v1.0.1
|
5
12
|
[full changelog](http://github.com/sue445/pixela/compare/v1.0.0...v1.0.1)
|
data/README.md
CHANGED
@@ -7,6 +7,8 @@
|
|
7
7
|
[![Maintainability](https://api.codeclimate.com/v1/badges/4c6316222717ee809b57/maintainability)](https://codeclimate.com/github/sue445/pixela/maintainability)
|
8
8
|
[![Coverage Status](https://coveralls.io/repos/github/sue445/pixela/badge.svg)](https://coveralls.io/github/sue445/pixela)
|
9
9
|
|
10
|
+
[![CI activity of pixela-gem](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci)](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci.html)
|
11
|
+
|
10
12
|
## Installation
|
11
13
|
|
12
14
|
Add this line to your application's Gemfile:
|
data/lib/pixela/client.rb
CHANGED
@@ -127,4 +127,32 @@ module Pixela::Client::GraphMethods
|
|
127
127
|
connection.delete("users/#{username}/graphs/#{graph_id}").body
|
128
128
|
end
|
129
129
|
end
|
130
|
+
|
131
|
+
# Get a Date list of Pixel registered in the graph specified by graphID.
|
132
|
+
#
|
133
|
+
# @param graph_id [String]
|
134
|
+
# @param from [Date] Specify the start position of the period.
|
135
|
+
# @param to [Date] Specify the end position of the period.
|
136
|
+
#
|
137
|
+
# @return [Array<Date>]
|
138
|
+
#
|
139
|
+
# @raise [Pixela::PixelaError] API is failed
|
140
|
+
#
|
141
|
+
# @see https://docs.pixe.la/#/get-graph-pixels
|
142
|
+
#
|
143
|
+
# @example
|
144
|
+
# client.get_pixel_dates(graph_id: "test-graph", from: Date.new(2018, 1, 1), to: Date.new(2018, 12, 31))
|
145
|
+
def get_pixel_dates(graph_id:, from: nil, to: nil)
|
146
|
+
params = {
|
147
|
+
from: to_ymd(from),
|
148
|
+
to: to_ymd(to),
|
149
|
+
}
|
150
|
+
|
151
|
+
res =
|
152
|
+
with_error_handling do
|
153
|
+
connection.get("users/#{username}/graphs/#{graph_id}/pixels", compact_hash(params)).body
|
154
|
+
end
|
155
|
+
|
156
|
+
res.pixels.map { |ymd| Date.parse(ymd) }
|
157
|
+
end
|
130
158
|
end
|
data/lib/pixela/graph.rb
CHANGED
@@ -121,5 +121,22 @@ module Pixela
|
|
121
121
|
def decrement
|
122
122
|
client.decrement_pixel(graph_id: graph_id)
|
123
123
|
end
|
124
|
+
|
125
|
+
# Get a Date list of Pixel registered in the graph specified by graphID.
|
126
|
+
#
|
127
|
+
# @param from [Date] Specify the start position of the period.
|
128
|
+
# @param to [Date] Specify the end position of the period.
|
129
|
+
#
|
130
|
+
# @return [Array<Date>]
|
131
|
+
#
|
132
|
+
# @raise [Pixela::PixelaError] API is failed
|
133
|
+
#
|
134
|
+
# @see https://docs.pixe.la/#/get-graph-pixels
|
135
|
+
#
|
136
|
+
# @example
|
137
|
+
# client.get_pixels(graph_id: "test-graph", from: Date.new(2018, 1, 1), to: Date.new(2018, 12, 31))
|
138
|
+
def pixel_dates(from: nil, to: nil)
|
139
|
+
client.get_pixel_dates(graph_id: graph_id, from: from, to: to)
|
140
|
+
end
|
124
141
|
end
|
125
142
|
end
|
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: 1.0
|
4
|
+
version: 1.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: 2019-
|
11
|
+
date: 2019-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|