gyazo 3.1.0 → 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: c8fe75b2d45f2bfa3aecf209dab362a2ad70319ed876e2fa3f316cda8229e6ac
4
- data.tar.gz: 31da10ff0026ccf2a0c7a025fd6a4b3ca6749293a2ee9eff71eb7e49f13bb488
3
+ metadata.gz: b5501aee18aa242031b41934001bef19e73a034545aaebaadf199328eee8518a
4
+ data.tar.gz: 351c8efbdf423ad30ebd642988a31cb69f6eaa6512e1338f574e46aab8310347
5
5
  SHA512:
6
- metadata.gz: 533ea33e10cf0b6baa999e11925bebb54e3e5cf5904634c73b33e15024719837d5154326bb86bd795b41d9f6f3f1283f85ef99b848849cbdeaf38f7120af0e82
7
- data.tar.gz: bab38288fdd3a7d8faae4391b06be6714481c6deff942274566f93cc3aa28ffc7ed592febe1a9dc7e105eab3e3c07a14b5da2c72909719a5ea56a8a6a23c8751
6
+ metadata.gz: 7a9e35b78e352e767aa970ed40ef09be8c7e9548b59b931abfcbeec309d8a83a462cdffa809f40d9f61a2c675fcc02aef0d63235eab2700b37397973a04106a8
7
+ data.tar.gz: 93c352deb35426ca0528cc5ca7b0c67ec23c75945ee6672efc86d7f3d5326ba140cd69da007c7ee254ecb40713142ddb919b08b1ee1eb8ee361aaed7abab6a11
data/gyazo.gemspec CHANGED
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
  spec.add_development_dependency "rake"
23
23
  spec.add_development_dependency "minitest"
24
24
 
25
- spec.add_dependency "faraday"
25
+ spec.add_dependency "faraday", '< 2.0.0'
26
26
  spec.add_dependency "multipart-post"
27
27
  spec.add_dependency "mime-types"
28
28
  end
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.0'
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.0
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: 2020-01-23 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
@@ -58,16 +57,16 @@ dependencies:
58
57
  name: faraday
59
58
  requirement: !ruby/object:Gem::Requirement
60
59
  requirements:
61
- - - ">="
60
+ - - "<"
62
61
  - !ruby/object:Gem::Version
63
- version: '0'
62
+ version: 2.0.0
64
63
  type: :runtime
65
64
  prerelease: false
66
65
  version_requirements: !ruby/object:Gem::Requirement
67
66
  requirements:
68
- - - ">="
67
+ - - "<"
69
68
  - !ruby/object:Gem::Version
70
- version: '0'
69
+ version: 2.0.0
71
70
  - !ruby/object:Gem::Dependency
72
71
  name: multipart-post
73
72
  requirement: !ruby/object:Gem::Requirement
@@ -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.0.1
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: