pixela 3.4.0 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 84863e1784b461eabfb1ae36666416fc7cf37c8ca2951a3a464b20f3821ff777
4
- data.tar.gz: 8da17e92b6c7a6597429894031836bf37203ef26df8222985abce978629f93e0
3
+ metadata.gz: 2294c4ab50d90e3081e699ad2c99b33b7a8e4c37e271fe061e45433910508080
4
+ data.tar.gz: 1421993d12f16a5243526cefa580a06a9c3415385297055af0223510c72bb095
5
5
  SHA512:
6
- metadata.gz: bea0ab88f494152ac7e15ba5bd59bab5cd66a3e9c8b19c88ccd02c2e0d82e01777700ec7a89e500c9598ac899b2f13accc878d7254c82bdd341704f320a9269f
7
- data.tar.gz: 84a72a29e516a3ff59b19183c065ad80eb063d36954a42758a932d98e1022c1aee9936a53841c238208b3ce29ae9ad697df6a2693447bf65248c5c1223fb58c8
6
+ metadata.gz: d35da5fef54b3493635999a382ccb473af3e98e46dee0f014f3dfbcf99eeae4068e8d25a81523ccf525661e94139ab0755b9768ce11be84db8d921c9e9d2757e
7
+ data.tar.gz: 907b8a988c388f3a40656173441e9f3727cbb869c8723313d4bbcb00c44b149a7e18d5a0a6ffd26ff0a5d90d429e69a694b1fb45093a2b17c0af03bdbd5436b8
@@ -30,6 +30,7 @@ jobs:
30
30
  - "3.1"
31
31
  - "3.2"
32
32
  - "3.3"
33
+ - "3.4"
33
34
  gemfile:
34
35
  - faraday_2
35
36
 
data/CHANGELOG.md CHANGED
@@ -1,7 +1,14 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/pixela/compare/v3.4.0...master)
2
+ [full changelog](http://github.com/sue445/pixela/compare/v3.5.0...master)
3
3
 
4
- ## v3.4.0
4
+ ## [v3.5.0](https://github.com/sue445/pixela/releases/tag/v3.5.0)
5
+ [full changelog](http://github.com/sue445/pixela/compare/v3.4.0...v3.5.0)
6
+
7
+ * Add `Pixela::Client::GraphMethods#get_graph_today` and `Pixela::Graph#today`
8
+ * https://github.com/sue445/pixela/pull/117
9
+ * https://github.com/a-know/Pixela/releases/tag/v1.32.0
10
+
11
+ ## [v3.4.0](https://github.com/sue445/pixela/releases/tag/v3.4.0)
5
12
  [full changelog](http://github.com/sue445/pixela/compare/v3.3.0...v3.4.0)
6
13
 
7
14
  * Add `appearance`, `less_than` and `greather_than` to `Pixela::Client::GraphMethods#graph_url` and `Pixela::Graph#url`
data/README.md CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
  [![Gem Version](https://badge.fury.io/rb/pixela.svg)](https://badge.fury.io/rb/pixela)
6
6
  [![CI activity of pixela-gem](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci?mode=badge)](https://pixe.la/v1/users/sue445/graphs/pixela-gem-ci.html)
7
- [![Build Status](https://github.com/sue445/pixela/workflows/test/badge.svg?branch=master)](https://github.com/sue445/pixela/actions?query=workflow%3Atest)
7
+ [![test](https://github.com/sue445/pixela/actions/workflows/test.yml/badge.svg)](https://github.com/sue445/pixela/actions/workflows/test.yml)
8
8
  [![Maintainability](https://api.codeclimate.com/v1/badges/4c6316222717ee809b57/maintainability)](https://codeclimate.com/github/sue445/pixela/maintainability)
9
9
  [![Coverage Status](https://coveralls.io/repos/github/sue445/pixela/badge.svg)](https://coveralls.io/github/sue445/pixela)
10
10
 
@@ -282,4 +282,28 @@ module Pixela::Client::GraphMethods
282
282
  connection.get("users/#{username}/graphs/#{graph_id}/latest").body
283
283
  end
284
284
  end
285
+
286
+ # This is an endpoint that responds with the Pixel of the day you requested this API.
287
+ #
288
+ # @param graph_id [String]
289
+ # @param return_empty [Boolean] Specifying `true` for this param will return an empty Pixel instead of `404 Not Found` if the Pixel is unregistered on the day of the request.
290
+ #
291
+ # @return [Pixela::Response]
292
+ #
293
+ # @raise [Pixela::PixelaError] API is failed
294
+ #
295
+ # @see https://docs.pixe.la/entry/get-today-pixel
296
+ #
297
+ # @example
298
+ # client.get_graph_today(graph_id: "test-graph", return_empty: true)
299
+ def get_graph_today(graph_id:, return_empty: false)
300
+ params = {}
301
+ if return_empty
302
+ params[:returnEmpty] = return_empty
303
+ end
304
+
305
+ with_error_handling do
306
+ connection.get("users/#{username}/graphs/#{graph_id}/today", params.compact).body
307
+ end
308
+ end
285
309
  end
data/lib/pixela/graph.rb CHANGED
@@ -261,5 +261,21 @@ module Pixela
261
261
  def latest
262
262
  client.get_graph_latest(graph_id: graph_id)
263
263
  end
264
+
265
+ # This is an endpoint that responds with the Pixel of the day you requested this API.
266
+ #
267
+ # @param return_empty [Boolean] Specifying `true` for this param will return an empty Pixel instead of `404 Not Found` if the Pixel is unregistered on the day of the request.
268
+ #
269
+ # @return [Pixela::Response]
270
+ #
271
+ # @raise [Pixela::PixelaError] API is failed
272
+ #
273
+ # @see https://docs.pixe.la/entry/get-today-pixel
274
+ #
275
+ # @example
276
+ # client.graph("test-graph").today(return_empty: true)
277
+ def today(return_empty: false)
278
+ client.get_graph_today(graph_id: graph_id, return_empty: return_empty)
279
+ end
264
280
  end
265
281
  end
@@ -1,3 +1,3 @@
1
1
  module Pixela
2
- VERSION = "3.4.0"
2
+ VERSION = "3.5.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pixela
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.4.0
4
+ version: 3.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2024-09-18 00:00:00.000000000 Z
10
+ date: 2025-02-25 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: faraday
@@ -267,7 +266,6 @@ metadata:
267
266
  changelog_uri: https://github.com/sue445/pixela/blob/master/CHANGELOG.md
268
267
  documentation_uri: https://sue445.github.io/pixela/
269
268
  rubygems_mfa_required: 'true'
270
- post_install_message:
271
269
  rdoc_options: []
272
270
  require_paths:
273
271
  - lib
@@ -282,8 +280,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
280
  - !ruby/object:Gem::Version
283
281
  version: '0'
284
282
  requirements: []
285
- rubygems_version: 3.5.3
286
- signing_key:
283
+ rubygems_version: 3.6.2
287
284
  specification_version: 4
288
285
  summary: Pixela API client for Ruby
289
286
  test_files: []