gyazo 2.1.1 → 2.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +13 -4
- data/lib/gyazo/client.rb +4 -4
- data/lib/gyazo/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 73172604e611a854e2191a013b9e4e3367a72ec7
|
4
|
+
data.tar.gz: 055ea0cca4ad119bd3c65163c39179f5f200ef93
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a6d592e7a2155d0421a5e1279a4caa85f1764b456702ef8f8d943f4d46de0e45e1aa5708951a26df747cfe97f1912222ec91675078d01c7c83b86a72bddd1675
|
7
|
+
data.tar.gz: c7cdc51eca52d3ec370cc8cca78b8c6c8e59c1228a3ea5d07281ffa573e4ddc8562a78b896195c0a6ff8b6182efdfbba5440c00144c942ec9d8e1c439e5b411b
|
data/README.md
CHANGED
@@ -8,14 +8,13 @@ Gyazo
|
|
8
8
|
- https://rubygems.org/gems/gyazo
|
9
9
|
|
10
10
|
|
11
|
-
|
12
|
-
|
11
|
+
# Install
|
12
|
+
|
13
13
|
|
14
14
|
% gem install gyazo
|
15
15
|
|
16
16
|
|
17
|
-
Usage
|
18
|
-
-----
|
17
|
+
# Usage
|
19
18
|
|
20
19
|
Register new application and get [ACCESS TOKEN](https://gyazo.com/oauth/applications), then
|
21
20
|
|
@@ -28,6 +27,16 @@ gyazo = Gyazo::Client.new 'your-access-token'
|
|
28
27
|
res = gyazo.upload 'my_image.png'
|
29
28
|
puts res['permalink_url'] # => "http://gyazo.com/a1b2cdef345"
|
30
29
|
```
|
30
|
+
#### Upload with metadata
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
require 'gyazo'
|
34
|
+
|
35
|
+
gyazo = Gyazo::Client.new 'your-access-token'
|
36
|
+
res = gyazo.upload 'my_image.png',
|
37
|
+
{ :time => Time.now, :url => 'http://example.com/' }
|
38
|
+
puts res['permalink_url']
|
39
|
+
```
|
31
40
|
|
32
41
|
### List
|
33
42
|
|
data/lib/gyazo/client.rb
CHANGED
@@ -12,15 +12,15 @@ module Gyazo
|
|
12
12
|
|
13
13
|
def upload(imagefile,params={})
|
14
14
|
url = "https://upload.gyazo.com/api/upload"
|
15
|
-
time = params[
|
15
|
+
time = params[:time] || params[:created_at] || Time.now
|
16
16
|
res = HTTMultiParty.post url, {
|
17
17
|
:query => {
|
18
18
|
:access_token => @access_token,
|
19
19
|
:imagedata => File.open(imagefile),
|
20
20
|
:created_at => time.to_i,
|
21
|
-
:referer_url => params[
|
22
|
-
:title => params[
|
23
|
-
:desc => params[
|
21
|
+
:referer_url => params[:referer_url] || params[:url] || '',
|
22
|
+
:title => params[:title] || '',
|
23
|
+
:desc => params[:desc] || ''
|
24
24
|
},
|
25
25
|
:header => {
|
26
26
|
'User-Agent' => @user_agent
|
data/lib/gyazo/version.rb
CHANGED
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: 2.1.
|
4
|
+
version: 2.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Toshiyuki Masui
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2015-12-
|
12
|
+
date: 2015-12-23 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|