gyazo 3.1.1 → 3.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: 26d22e358a2f7ad15e819b689f39ceb3399a2b1b1071b61dff3975943cc5b94b
4
- data.tar.gz: 4f43bafa5994680a5ce030e48d041d2b8bbaa1abd8e15ca3fc2c21f680173d9a
3
+ metadata.gz: b5501aee18aa242031b41934001bef19e73a034545aaebaadf199328eee8518a
4
+ data.tar.gz: 351c8efbdf423ad30ebd642988a31cb69f6eaa6512e1338f574e46aab8310347
5
5
  SHA512:
6
- metadata.gz: 9b461bc154522c72909a14addfc49ac5ab9c6accb5c8d0836a55141895eae3985ebb97cdf5c0e2762555e326335b0b6d4832c52f3e83cf2821675b40515e540a
7
- data.tar.gz: d93f554481d7744d054d452fab529c2d5d7bfe0977d5cfc89b65ffb913ffba849272c63dae58ca182b14e273cd716885fe635c4734b61bf12a3b0ab513cbd372
6
+ metadata.gz: 7a9e35b78e352e767aa970ed40ef09be8c7e9548b59b931abfcbeec309d8a83a462cdffa809f40d9f61a2c675fcc02aef0d63235eab2700b37397973a04106a8
7
+ data.tar.gz: 93c352deb35426ca0528cc5ca7b0c67ec23c75945ee6672efc86d7f3d5326ba140cd69da007c7ee254ecb40713142ddb919b08b1ee1eb8ee361aaed7abab6a11
data/lib/gyazo/client.rb CHANGED
@@ -64,12 +64,7 @@ module Gyazo
64
64
 
65
65
  def image(image_id:)
66
66
  path = "/api/images/#{image_id}"
67
- res = @conn.get path do |req|
68
- req.params[:access_token] = @access_token
69
- req.headers['User-Agent'] = @user_agent
70
- end
71
- raise Gyazo::Error, res.body unless res.status == 200
72
- return ::JSON.parse res.body, symbolize_names: true
67
+ send_get_without_param(path:)
73
68
  end
74
69
 
75
70
  def delete(image_id:)
@@ -82,6 +77,11 @@ module Gyazo
82
77
  return ::JSON.parse res.body, symbolize_names: true
83
78
  end
84
79
 
80
+ def user_info
81
+ path = '/api/users/me'
82
+ send_get_without_param(path:)
83
+ end
84
+
85
85
  private
86
86
 
87
87
  def ensure_io_or_file_exists(file, name)
@@ -94,5 +94,14 @@ module Gyazo
94
94
  return if ::File.file? file
95
95
  raise ArgumentError, "cannot find file #{file}"
96
96
  end
97
+
98
+ def send_get_without_param(path:)
99
+ res = @conn.get path do |req|
100
+ req.params[:access_token] = @access_token
101
+ req.headers['User-Agent'] = @user_agent
102
+ end
103
+ raise Gyazo::Error, res.body unless res.status == 200
104
+ return ::JSON.parse res.body, symbolize_names: true
105
+ end
97
106
  end
98
107
  end
data/lib/gyazo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Gyazo
2
- VERSION = '3.1.1'
2
+ VERSION = '3.2.0'
3
3
  end
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gyazo
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.1.1
4
+ version: 3.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Toshiyuki Masui
8
8
  - Sho Hashimoto
9
9
  - Nana Kugayama
10
- autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2022-01-04 00:00:00.000000000 Z
12
+ date: 2025-01-05 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: bundler
@@ -124,7 +123,6 @@ homepage: http://github.com/gyazo/gyazo-ruby
124
123
  licenses:
125
124
  - MIT
126
125
  metadata: {}
127
- post_install_message:
128
126
  rdoc_options: []
129
127
  require_paths:
130
128
  - lib
@@ -139,8 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
139
137
  - !ruby/object:Gem::Version
140
138
  version: '0'
141
139
  requirements: []
142
- rubygems_version: 3.2.32
143
- signing_key:
140
+ rubygems_version: 3.6.2
144
141
  specification_version: 4
145
142
  summary: Gyazo.com API Wrapper
146
143
  test_files: