pixela 3.3.0 → 3.4.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: 70ad266dd772aa47bb3201ceeb05f8f68c5ec6aac5f9f42f6955065d36459214
4
- data.tar.gz: 4d5431713d481a5115eedd74ec96507217420d260407d44576179b436df873ca
3
+ metadata.gz: 84863e1784b461eabfb1ae36666416fc7cf37c8ca2951a3a464b20f3821ff777
4
+ data.tar.gz: 8da17e92b6c7a6597429894031836bf37203ef26df8222985abce978629f93e0
5
5
  SHA512:
6
- metadata.gz: ce88158d30ec96dbe366f37a944bd2227a816666459fcac18b36a975e8ff135995a7db4ddc25ad6b45dd802c6591cac54d0d2b07d5ea7accfa2ee7f018889f96
7
- data.tar.gz: a93bf0966fbd6fefb7f8fe8101e20b30e951ff2ea2b9c55d61de8a434ad436bd96cb1a0904f7ebf79cbe4bfbe6b35eb2de142d9b561e8a4eec3aa98ce7ad75fa
6
+ metadata.gz: bea0ab88f494152ac7e15ba5bd59bab5cd66a3e9c8b19c88ccd02c2e0d82e01777700ec7a89e500c9598ac899b2f13accc878d7254c82bdd341704f320a9269f
7
+ data.tar.gz: 84a72a29e516a3ff59b19183c065ad80eb063d36954a42758a932d98e1022c1aee9936a53841c238208b3ce29ae9ad697df6a2693447bf65248c5c1223fb58c8
data/CHANGELOG.md CHANGED
@@ -1,5 +1,12 @@
1
1
  ## Unreleased
2
- [full changelog](http://github.com/sue445/pixela/compare/v3.3.0...master)
2
+ [full changelog](http://github.com/sue445/pixela/compare/v3.4.0...master)
3
+
4
+ ## v3.4.0
5
+ [full changelog](http://github.com/sue445/pixela/compare/v3.3.0...v3.4.0)
6
+
7
+ * Add `appearance`, `less_than` and `greather_than` to `Pixela::Client::GraphMethods#graph_url` and `Pixela::Graph#url`
8
+ * https://github.com/sue445/pixela/pull/115
9
+ * https://github.com/a-know/Pixela/releases/tag/v1.30.0
3
10
 
4
11
  ## v3.3.0
5
12
  [full changelog](http://github.com/sue445/pixela/compare/v3.2.0...v3.3.0)
@@ -2,3 +2,8 @@ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.7.0")
2
2
  # unparser v0.6.5+ requires ruby 2.7.0+
3
3
  gem "unparser", "< 0.6.5"
4
4
  end
5
+
6
+ if Gem::Version.create(RUBY_VERSION) < Gem::Version.create("2.7.0")
7
+ # term-ansicolor 1.9.0+ doesn't work on Ruby < 2.7
8
+ gem "term-ansicolor", "< 1.9.0"
9
+ end
@@ -55,9 +55,12 @@ module Pixela::Client::GraphMethods
55
55
 
56
56
  # Get graph url
57
57
  #
58
- # @param graph_id [String]
59
- # @param date [Date,Time]
60
- # @param mode [String] e.g) `short`
58
+ # @param graph_id [String]
59
+ # @param date [Date,Time]
60
+ # @param mode [String] e.g) `short`
61
+ # @param appearance [String] e.g) `dark`
62
+ # @param less_than [String]
63
+ # @param greater_than [String]
61
64
  #
62
65
  # @return [String]
63
66
  #
@@ -66,12 +69,15 @@ module Pixela::Client::GraphMethods
66
69
  # @example
67
70
  # client.graph_url(graph_id: "test-graph")
68
71
  # client.graph_url(graph_id: "test-graph", date: Date.new(2018, 3, 31), mode: "short")
69
- def graph_url(graph_id:, date: nil, mode: nil)
72
+ def graph_url(graph_id:, date: nil, mode: nil, appearance: nil, less_than: nil, greater_than: nil)
70
73
  url = "#{Pixela::Client::API_ENDPOINT}/users/#{username}/graphs/#{graph_id}"
71
74
 
72
75
  params = Faraday::Utils::ParamsHash.new
73
76
  params[:date] = to_ymd(date) if date
74
77
  params[:mode] = mode if mode
78
+ params[:appearance] = appearance if appearance
79
+ params[:lessThan] = less_than if less_than
80
+ params[:greaterThan] = greater_than if greater_than
75
81
 
76
82
  url << "?#{params.to_query}" unless params.empty?
77
83
 
data/lib/pixela/graph.rb CHANGED
@@ -50,8 +50,11 @@ module Pixela
50
50
 
51
51
  # Get graph url
52
52
  #
53
- # @param date [Date,Time]
54
- # @param mode [String] e.g) `short`
53
+ # @param date [Date,Time]
54
+ # @param mode [String] e.g) `short`
55
+ # @param appearance [String] e.g) `dark`
56
+ # @param less_than [String]
57
+ # @param greater_than [String]
55
58
  #
56
59
  # @return [String]
57
60
  #
@@ -60,8 +63,8 @@ module Pixela
60
63
  # @example
61
64
  # client.graph("test-graph").url
62
65
  # client.graph("test-graph").url(date: Date.new(2018, 3, 31), mode: "short")
63
- def url(date: nil, mode: nil)
64
- client.graph_url(graph_id: graph_id, date: date, mode: mode)
66
+ def url(date: nil, mode: nil, appearance: nil, less_than: nil, greater_than: nil)
67
+ client.graph_url(graph_id: graph_id, date: date, mode: mode, appearance: appearance, less_than: less_than, greater_than: greater_than)
65
68
  end
66
69
 
67
70
  # Update predefined pixelation graph definitions.
@@ -1,3 +1,3 @@
1
1
  module Pixela
2
- VERSION = "3.3.0"
2
+ VERSION = "3.4.0"
3
3
  end
data/pixela.gemspec CHANGED
@@ -43,6 +43,7 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency "rspec-its"
44
44
  spec.add_development_dependency "rspec-parameterized"
45
45
  spec.add_development_dependency "simplecov"
46
+ spec.add_development_dependency "term-ansicolor", "!= 1.11.1" # ref. https://github.com/flori/term-ansicolor/issues/41
46
47
  spec.add_development_dependency "unparser", ">= 0.4.5"
47
48
  spec.add_development_dependency "webmock"
48
49
  spec.add_development_dependency "yard"
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: 3.3.0
4
+ version: 3.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - sue445
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-04-18 00:00:00.000000000 Z
11
+ date: 2024-09-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: term-ansicolor
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - "!="
172
+ - !ruby/object:Gem::Version
173
+ version: 1.11.1
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - "!="
179
+ - !ruby/object:Gem::Version
180
+ version: 1.11.1
167
181
  - !ruby/object:Gem::Dependency
168
182
  name: unparser
169
183
  requirement: !ruby/object:Gem::Requirement