instamsg-ruby 0.0.11 → 0.0.12
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/instamsg/request.rb +11 -6
- data/lib/instamsg/version.rb +1 -1
- metadata +4 -4
data/lib/instamsg/request.rb
CHANGED
@@ -98,13 +98,18 @@ module Instamsg
|
|
98
98
|
http = @client.http_sync_client
|
99
99
|
http.ssl_config.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
100
100
|
begin
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
file = @params["file"] || @params[:file]
|
102
|
+
if file.present?
|
103
|
+
File.open(@params["file"]) do |file|
|
104
|
+
@body = { :file => file}
|
105
|
+
response = http.request(@verb, @uri, @params, @body, @head)
|
104
106
|
|
105
|
-
|
106
|
-
|
107
|
-
|
107
|
+
body = response.body ? response.body.chomp : nil
|
108
|
+
return handle_response(response.code.to_i, body)
|
109
|
+
end
|
110
|
+
else
|
111
|
+
return handle_response("500", "You have not passed file object.)
|
112
|
+
end
|
108
113
|
rescue HTTPClient::BadResponseError, HTTPClient::TimeoutError,
|
109
114
|
SocketError, HTTPClient::ReceiveTimeoutError, Errno::ECONNREFUSED => e
|
110
115
|
error = Instamsg::HTTPError.new("#{e.message} (#{e.class})")
|
data/lib/instamsg/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: instamsg-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 7
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 12
|
10
|
+
version: 0.0.12
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Instamsg
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2015-04-
|
18
|
+
date: 2015-04-28 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: httpclient
|