weibo_2 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1b299aa2089651b433978bf94453b12d7d774195
4
- data.tar.gz: 6d4e020781516c7f8fd8e35f2c4c9ddb81df011e
3
+ metadata.gz: 804567e4d657756fd85e6f1ee69d157af8a70c5d
4
+ data.tar.gz: 62c245c552dbaa0802162bf77442bcda0512bac7
5
5
  SHA512:
6
- metadata.gz: ef22e739cb358b42a7c485a1ef0af9f9ba0820529723c4dc9713b904c398f4f4741172dd89d6a5402b67150834c30b3cb1557a2bbfd4333a961bbab601d2c78a
7
- data.tar.gz: 847c227c70be1d65873c94cd560ce7aa65e2840f1c2c1312013c6763902b9904e0cf1bb5c1192f1383e7f844d4bd8bb3a88a71fff6e2652da42d38407d359d6a
6
+ metadata.gz: a2ab72bcc012887524bbdbf7f75ea27950b2f81891dd6860f45149e5aec11a35b1ae2474410a3c9e460ebb97a83b84aa2073fc8424bad12314c3a5fe065d6e5e
7
+ data.tar.gz: c0ffcc212443c76091d9c2e08865a145fb8418e5acbfcfdbbc3e6f144a88559da0d1898b098a20ef522c5f2662220ccfed03dc5681c7dc406714a79f27da80f6
data/README.md CHANGED
@@ -73,36 +73,37 @@ It should work.
73
73
  Upload a picture.
74
74
 
75
75
  ```ruby
76
- tmpfile = params[:file].delete(:tempfile)
77
- File.open(tmpfile.path, 'rb'){|pic| client.statuses.upload(params[:status], pic, params[:file])}
76
+ pic = params[:file].delete(:tempfile)
77
+ client.statuses.upload(params[:status], pic, params[:file])
78
78
  ```
79
79
 
80
80
  pass params[:file] into upload method as options could help weibo_2 to build post body, useful options as:
81
81
  * filename, filename with extension of the uploading file, example 'pic.jpg'
82
82
  * type, mime type of the uploading file, example 'image/jpeg'
83
+
83
84
  ## Setting up SSL certificates
84
85
 
85
- This gem using [faraday](https://github.com/technoweenie/faraday) for connection, which supports ssl. According to [this article](https://github.com/technoweenie/faraday/wiki/Setting-up-SSL-certificates), you can do as following to support ssl connection.
86
+ This gem using [faraday](https://github.com/technoweenie/faraday) for connection, which supports ssl. According to [this article](https://github.com/technoweenie/faraday/wiki/Setting-up-SSL-certificates), you can do as following to support ssl connection.
86
87
 
87
- ### Ubuntu
88
+ ### Ubuntu
88
89
 
89
- To locate your SSL certificate folder, type `openssl version -a`. Append `/certs` to the OPENSSLDIR listed, here it would be `/usr/lib/ssl/certs`.
90
+ To locate your SSL certificate folder, type `openssl version -a`. Append `/certs` to the OPENSSLDIR listed, here it would be `/usr/lib/ssl/certs`.
90
91
 
91
- ```ruby
92
- client = WeiboOAuth2::Client.new(YOUR_KEY, YOUR_SECRET, :ssl => {:ca_path => "/usr/lib/ssl/certs"})
93
- # or as below if you have set WeiboOAuth2::Config.api_key and WeiboOAuth2::Config.api_secret already
94
- # client = WeiboOAuth2::Client.new('', '', :ssl => {:ca_path => "/usr/lib/ssl/certs"})
95
- ```
92
+ ```ruby
93
+ client = WeiboOAuth2::Client.new(YOUR_KEY, YOUR_SECRET, :ssl => {:ca_path => "/usr/lib/ssl/certs"})
94
+ # or as below if you have set WeiboOAuth2::Config.api_key and WeiboOAuth2::Config.api_secret already
95
+ # client = WeiboOAuth2::Client.new('', '', :ssl => {:ca_path => "/usr/lib/ssl/certs"})
96
+ ```
96
97
 
97
- ### On Heroku, Fedora, CentOS
98
+ ### On Heroku, Fedora, CentOS
98
99
 
99
- ```ruby
100
- client = WeiboOAuth2::Client.new(YOUR_KEY, YOUR_SECRET, :ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'})
101
- # or as below if you have set WeiboOAuth2::Config.api_key and WeiboOAuth2::Config.api_secret already
102
- # client = WeiboOAuth2::Client.new('', '', :ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'})
103
- ```
100
+ ```ruby
101
+ client = WeiboOAuth2::Client.new(YOUR_KEY, YOUR_SECRET, :ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'})
102
+ # or as below if you have set WeiboOAuth2::Config.api_key and WeiboOAuth2::Config.api_secret already
103
+ # client = WeiboOAuth2::Client.new('', '', :ssl => {:ca_file => '/usr/lib/ssl/certs/ca-certificates.crt'})
104
+ ```
104
105
 
105
- For Fedora and CentOS, use the path and file `/etc/pki/tls/certs/ca-bundle.crt` instead, or find your system path with `openssl version -a`.
106
+ For Fedora and CentOS, use the path and file `/etc/pki/tls/certs/ca-bundle.crt` instead, or find your system path with `openssl version -a`.
106
107
 
107
108
  ## Integrate with Devise and omniauth
108
109
 
@@ -55,12 +55,12 @@ module WeiboOAuth2
55
55
  mime_type = opts.delete(:type) || mime_type(value.path)
56
56
 
57
57
  body << bin_encode("Content-Disposition: form-data; name=\"#{esc_key}\"; filename=\"#{filename}\"#{CRLF}")
58
- body << bin_encode("Content-Type: #{mime_type}#{CRLF*2}")
58
+ body << bin_encode("Content-Type: #{mime_type}#{CRLF}")
59
+ body << bin_encode("Content-Transfer-Encoding: binary#{CRLF*2}")
59
60
  body << bin_encode(value.read)
60
61
  else
61
62
  body << bin_encode("Content-Disposition: form-data; name=\"#{esc_key}\"#{CRLF*2}#{value}")
62
63
  end
63
- body << bin_encode("Content-Transfer-Encoding: binary")
64
64
  body << bin_encode(CRLF)
65
65
 
66
66
  end
@@ -3,7 +3,7 @@ module WeiboOAuth2
3
3
  class Version
4
4
  MAJOR = 0 unless defined? MAJOR
5
5
  MINOR = 1 unless defined? MINOR
6
- PATCH = 3 unless defined? PATCH
6
+ PATCH = 4 unless defined? PATCH
7
7
  PRE = nil unless defined? PRE
8
8
 
9
9
  class << self
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: weibo_2
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - simsicon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-07 00:00:00.000000000 Z
11
+ date: 2013-05-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec