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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 219615c9ae39e62cfc3ed2122b3fd4a048d45b2c
4
- data.tar.gz: 1a631d3436f84a93f1ff7f66b0ee39d57ef00fe5
3
+ metadata.gz: 73172604e611a854e2191a013b9e4e3367a72ec7
4
+ data.tar.gz: 055ea0cca4ad119bd3c65163c39179f5f200ef93
5
5
  SHA512:
6
- metadata.gz: 1a10d9a91f3f284432766630585dd851411eeddd349b31d0dd5a0d256fe1e2bb26ac9d6a25321eb61a7df12d8f97b9e7be75df4f266f57d83e16afd5aa945547
7
- data.tar.gz: cae5e950dc046ffa938d442a8cbad85c6acd3a024aed39eac8d4d618b256b8c86ae9bd48bcb1e28ec65134a4c8c75d529fa7763d083a77c7d65d7e9a8330993c
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
- Installation
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
 
@@ -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['time'] || params['created_at'] || Time.now
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['referer_url'] || params['url'] || '',
22
- :title => params['title'] || '',
23
- :desc => params['desc'] || ''
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
@@ -1,3 +1,3 @@
1
1
  module Gyazo
2
- VERSION = '2.1.1'
2
+ VERSION = '2.1.2'
3
3
  end
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.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-22 00:00:00.000000000 Z
12
+ date: 2015-12-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler