httpsimple 1.0.3 → 1.0.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.
- data/lib/httpsimple.rb +6 -2
- metadata +2 -2
data/lib/httpsimple.rb
CHANGED
@@ -2,7 +2,7 @@ require 'net/http'
|
|
2
2
|
require 'uri'
|
3
3
|
|
4
4
|
module HttpSimple
|
5
|
-
VERSION='1.0.
|
5
|
+
VERSION='1.0.4'
|
6
6
|
def self.get(url, data=nil, &block)
|
7
7
|
request(url, :get, data, &block)
|
8
8
|
end
|
@@ -30,7 +30,7 @@ module HttpSimple
|
|
30
30
|
end
|
31
31
|
|
32
32
|
class Http
|
33
|
-
attr_accessor :headers, :max_redirects,
|
33
|
+
attr_accessor :headers, :max_redirects, :debug,
|
34
34
|
:strict_ssl, :timeout, :handlers, :follow_redirects
|
35
35
|
attr_reader :url
|
36
36
|
|
@@ -41,6 +41,9 @@ module HttpSimple
|
|
41
41
|
@follow_redirects = true
|
42
42
|
@strict_ssl = true
|
43
43
|
@timeout = 90
|
44
|
+
# If debug is set to true ``set_debug_output``
|
45
|
+
# will be enabled and write to $stderr
|
46
|
+
@debug = false
|
44
47
|
# Response handlers
|
45
48
|
@handlers = {}
|
46
49
|
|
@@ -94,6 +97,7 @@ module HttpSimple
|
|
94
97
|
http = Net::HTTP.new(uri.host, uri.port)
|
95
98
|
http.use_ssl = uri.scheme == 'https'
|
96
99
|
http.verify_mode = OpenSSL::SSL::VERIFY_NONE unless @scrict_ssl
|
100
|
+
http.set_debug_output $stderr if @debug
|
97
101
|
http.read_timeout = @timeout
|
98
102
|
|
99
103
|
@headers.each_pair { |k,v| request[k] = v } unless @headers.empty?
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: httpsimple
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-
|
12
|
+
date: 2012-09-14 00:00:00.000000000 Z
|
13
13
|
dependencies: []
|
14
14
|
description: ! " Simple wrapper around Ruby's net/http library. It supports \n redirects
|
15
15
|
and HTTPS.\n"
|