gravis-typhoeus 0.1.30 → 0.1.31
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/typhoeus/easy.rb +7 -6
- data/typhoeus.gemspec +1 -1
- metadata +3 -3
data/lib/typhoeus/easy.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
module Typhoeus
|
2
2
|
class Easy
|
3
|
-
attr_reader :response_body, :response_header, :method, :headers, :url
|
3
|
+
attr_reader :response_body, :response_header, :method, :headers, :url, :params
|
4
4
|
attr_accessor :start_time
|
5
5
|
|
6
6
|
# These integer codes are available in curl/curl.h
|
@@ -163,6 +163,7 @@ module Typhoeus
|
|
163
163
|
end
|
164
164
|
|
165
165
|
def params=(params)
|
166
|
+
@params = params
|
166
167
|
params_string = params.keys.collect do |k|
|
167
168
|
value = params[k]
|
168
169
|
if value.is_a? Hash
|
@@ -185,14 +186,14 @@ module Typhoeus
|
|
185
186
|
# Set SSL certificate
|
186
187
|
# " The string should be the file name of your certificate. "
|
187
188
|
# The default format is "PEM" and can be changed with ssl_cert_type=
|
188
|
-
def ssl_cert=(cert
|
189
|
+
def ssl_cert=(cert)
|
189
190
|
set_option(OPTION_VALUES[:CURLOPT_SSLCERT], cert)
|
190
191
|
end
|
191
192
|
|
192
193
|
# Set SSL certificate type
|
193
194
|
# " The string should be the format of your certificate. Supported formats are "PEM" and "DER" "
|
194
195
|
def ssl_cert_type=(cert_type)
|
195
|
-
raise "Invalid ssl cert type : '#{cert_type}'..."
|
196
|
+
raise "Invalid ssl cert type : '#{cert_type}'..." if cert_type and !%w(PEM DER).include?(cert_type)
|
196
197
|
set_option(OPTION_VALUES[:CURLOPT_SSLCERTTYPE], cert_type)
|
197
198
|
end
|
198
199
|
|
@@ -200,15 +201,15 @@ module Typhoeus
|
|
200
201
|
# " The string should be the file name of your private key. "
|
201
202
|
# The default format is "PEM" and can be changed with ssl_key_type=
|
202
203
|
#
|
203
|
-
def ssl_key=(key
|
204
|
+
def ssl_key=(key)
|
204
205
|
set_option(OPTION_VALUES[:CURLOPT_SSLKEY], key)
|
205
206
|
end
|
206
207
|
|
207
208
|
# Set SSL Key type
|
208
209
|
# " The string should be the format of your private key. Supported formats are "PEM", "DER" and "ENG". "
|
209
210
|
#
|
210
|
-
def
|
211
|
-
raise "Invalid ssl key type : '#{key_type}'..."
|
211
|
+
def ssl_key_type=(key_type)
|
212
|
+
raise "Invalid ssl key type : '#{key_type}'..." if key_type and !%w(PEM DER ENG).include?(key_type)
|
212
213
|
set_option(OPTION_VALUES[:CURLOPT_SSLKEYTYPE], key_type)
|
213
214
|
end
|
214
215
|
|
data/typhoeus.gemspec
CHANGED
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gravis-typhoeus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 37
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 31
|
10
|
+
version: 0.1.31
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Paul Dix
|