gyazo 3.0.1 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/gyazo/client.rb +2 -1
- data/lib/gyazo/version.rb +1 -1
- data/test/test_gyazo.rb +5 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8fe75b2d45f2bfa3aecf209dab362a2ad70319ed876e2fa3f316cda8229e6ac
|
4
|
+
data.tar.gz: 31da10ff0026ccf2a0c7a025fd6a4b3ca6749293a2ee9eff71eb7e49f13bb488
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 533ea33e10cf0b6baa999e11925bebb54e3e5cf5904634c73b33e15024719837d5154326bb86bd795b41d9f6f3f1283f85ef99b848849cbdeaf38f7120af0e82
|
7
|
+
data.tar.gz: bab38288fdd3a7d8faae4391b06be6714481c6deff942274566f93cc3aa28ffc7ed592febe1a9dc7e105eab3e3c07a14b5da2c72909719a5ea56a8a6a23c8751
|
data/README.md
CHANGED
@@ -37,7 +37,7 @@ Following attributes can be set
|
|
37
37
|
* referer_url(default: '')
|
38
38
|
* title(default: '')
|
39
39
|
* desc(default: '')
|
40
|
-
|
40
|
+
* collection_id(default: '')
|
41
41
|
|
42
42
|
```ruby
|
43
43
|
res = gyazo.upload imagefile: 'my_image.png', created_at: Time.now, referer_url: 'https://example.com/'
|
data/lib/gyazo/client.rb
CHANGED
@@ -18,7 +18,7 @@ module Gyazo
|
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
-
def upload(imagefile:, filename: nil, created_at: ::Time.now, referer_url: '', title: '', desc: '')
|
21
|
+
def upload(imagefile:, filename: nil, created_at: ::Time.now, referer_url: '', title: '', desc: '', collection_id: '')
|
22
22
|
ensure_io_or_file_exists imagefile, filename
|
23
23
|
|
24
24
|
conn = ::Faraday.new do |f|
|
@@ -35,6 +35,7 @@ module Gyazo
|
|
35
35
|
referer_url: referer_url.to_s,
|
36
36
|
title: title.to_s,
|
37
37
|
desc: desc.to_s,
|
38
|
+
collection_id: collection_id.to_s,
|
38
39
|
}
|
39
40
|
req.headers['User-Agent'] = @user_agent
|
40
41
|
end
|
data/lib/gyazo/version.rb
CHANGED
data/test/test_gyazo.rb
CHANGED
@@ -18,6 +18,11 @@ class TestGyazo < MiniTest::Test
|
|
18
18
|
assert res[:permalink_url].match GYAZO_REGEXP
|
19
19
|
end
|
20
20
|
|
21
|
+
def test_upload_with_collection_id
|
22
|
+
res = @gyazo.upload imagefile: @imagefile, collection_id: ENV['GYAZO_COLLECTION_ID']
|
23
|
+
assert res[:permalink_url].match GYAZO_REGEXP
|
24
|
+
end
|
25
|
+
|
21
26
|
def test_list
|
22
27
|
list = @gyazo.list
|
23
28
|
assert_instance_of Hash, list
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gyazo
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-01-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: bundler
|