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 +4 -4
- data/lib/gyazo/client.rb +15 -6
- data/lib/gyazo/version.rb +1 -1
- metadata +3 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b5501aee18aa242031b41934001bef19e73a034545aaebaadf199328eee8518a
|
4
|
+
data.tar.gz: 351c8efbdf423ad30ebd642988a31cb69f6eaa6512e1338f574e46aab8310347
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
-
|
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
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.
|
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:
|
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
|
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:
|