httpi 2.2.0 → 2.2.1

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,15 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 64f90cd54aeecb3d644ddc16fec7b315c1f3b04b
4
- data.tar.gz: dfd7327d1ec9c29435c45225142e4d7dbb9f69f6
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ ZDM4YmYwM2E3NWM1YzQ4OGQ3MWZkNWIxNGVhZTIwZDEzOWYyMmJiOA==
5
+ data.tar.gz: !binary |-
6
+ ZTU1NmUxZDRlMjczZjRjMDFkNjZhZGM5Mjc5ZWFiZTJlNzQ5ZWQ3NQ==
5
7
  SHA512:
6
- metadata.gz: ecd189b6104973f1286423bf498f37849ad37acaab443d108dda5d2d87d663bfd44171dd291506bd4dc8db45ac1fd57fbf90cd107e1b367dae0442e3b7d0f170
7
- data.tar.gz: 904207471eed6b713d613f97453bc2a8e0abf156aadfde9ed228a93018c31ee3360b58a399f02c06833a769b3275bc3b483e5c69076f938c509617d288571145
8
+ metadata.gz: !binary |-
9
+ MWNiMjU5ZmQxYzRjODI2ZWZhNjAyNjBiZDkwMmUzMjY4NDY4ZDQyM2RiMDMx
10
+ NTlhOWRlMDdlM2Q1Y2E2ZjZlMDkzMGIwNWIyMjU2NTE1MzBjYTEwMzllOWE0
11
+ Y2FmNWUwZDY5OWFmODM2ZWEyYTc4MTI5MWNlMjdiZjhlMjI1NWE=
12
+ data.tar.gz: !binary |-
13
+ NjU1MzY3YWQ1MWVjNzlmYWNjNjE3MWJjOGMzMTIyY2E5NmJlNzJjYjFjNGI0
14
+ NDc0NjcwZGY4OTIwYzQ2MTQ5OThjNzZmZjUzMGYzYzE0ZGE4NzIwNjU4OWJm
15
+ ZTI1Nzc1OGVkZTRjMDI2ZmM3YzZmMGQ1ZDUzNjA1MTRmZTZmZjc=
@@ -1,4 +1,8 @@
1
- ### 2.2.0 (edge)
1
+ ### 2.2.1 (2014-06-11)
2
+
3
+ * Fix: [#116](https://github.com/savonrb/httpi/pull/116) Fix NoMethodError when not using NTLM.
4
+
5
+ ### 2.2.0 (2014-05-22)
2
6
 
3
7
  * Fix: [#111](https://github.com/savonrb/httpi/pull/111) Check rubyntlm version in a 0.4.0+ compatible way. Thanks to [Carl Zulauf](https://github.com/carlzulauf).
4
8
  * Fix: [#109](https://github.com/savonrb/httpi/pull/109) SSL version is set regardless of SSL auth settings. Thanks to [Mike Campbell](https://github.com/mikecmpbll).
@@ -1,6 +1,5 @@
1
- require "logger"
2
-
3
1
  require "httpi/version"
2
+ require "httpi/logger"
4
3
  require "httpi/request"
5
4
 
6
5
  require "httpi/adapter/httpclient"
@@ -145,42 +144,6 @@ module HTTPI
145
144
  Adapter.use = adapter
146
145
  end
147
146
 
148
- # Sets whether to log HTTP requests.
149
- attr_writer :log
150
-
151
- # Returns whether to log HTTP requests. Defaults to +true+.
152
- def log?
153
- @log != false
154
- end
155
-
156
- # Sets the logger to use.
157
- attr_writer :logger
158
-
159
- # Returns the logger. Defaults to an instance of +Logger+ writing to STDOUT.
160
- def logger
161
- @logger ||= ::Logger.new($stdout)
162
- end
163
-
164
- # Sets the log level.
165
- attr_writer :log_level
166
-
167
- # Returns the log level. Defaults to :debug.
168
- def log_level
169
- @log_level ||= DEFAULT_LOG_LEVEL
170
- end
171
-
172
- # Logs a given +message+.
173
- def log(message)
174
- logger.send(log_level, message) if log?
175
- end
176
-
177
- # Reset the default config.
178
- def reset_config!
179
- @log = nil
180
- @logger = nil
181
- @log_level = nil
182
- end
183
-
184
147
  private
185
148
 
186
149
  def request_and_adapter_from(args)
@@ -192,9 +155,5 @@ module HTTPI
192
155
  Adapter.load(adapter).new(request)
193
156
  end
194
157
 
195
- def log_request(method, request, adapter)
196
- log("HTTPI #{method.to_s.upcase} request to #{request.url.host} (#{adapter})")
197
- end
198
-
199
158
  end
200
159
  end
@@ -0,0 +1,50 @@
1
+ require "logger"
2
+
3
+ module HTTPI
4
+
5
+ class << self
6
+
7
+ # Sets whether to log HTTP requests.
8
+ attr_writer :log
9
+
10
+ # Returns whether to log HTTP requests. Defaults to +true+.
11
+ def log?
12
+ @log != false
13
+ end
14
+
15
+ # Sets the logger to use.
16
+ attr_writer :logger
17
+
18
+ # Returns the logger. Defaults to an instance of +Logger+ writing to STDOUT.
19
+ def logger
20
+ @logger ||= ::Logger.new($stdout)
21
+ end
22
+
23
+ # Sets the log level.
24
+ attr_writer :log_level
25
+
26
+ # Returns the log level. Defaults to :debug.
27
+ def log_level
28
+ @log_level ||= DEFAULT_LOG_LEVEL
29
+ end
30
+
31
+ # Logs a given +message+.
32
+ def log(message)
33
+ logger.send(log_level, message) if log?
34
+ end
35
+
36
+ # Reset the default config.
37
+ def reset_config!
38
+ @log = nil
39
+ @logger = nil
40
+ @log_level = nil
41
+ end
42
+
43
+ protected
44
+
45
+ def log_request(method, request, adapter)
46
+ log("HTTPI #{method.to_s.upcase} request to #{request.url.host} (#{adapter})")
47
+ end
48
+
49
+ end
50
+ end
@@ -1,5 +1,5 @@
1
1
  module HTTPI
2
2
 
3
- VERSION = "2.2.0"
3
+ VERSION = "2.2.1"
4
4
 
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: httpi
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Harrington
@@ -9,20 +9,20 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-06-09 00:00:00.000000000 Z
12
+ date: 2014-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rack
16
16
  requirement: !ruby/object:Gem::Requirement
17
17
  requirements:
18
- - - '>='
18
+ - - ! '>='
19
19
  - !ruby/object:Gem::Version
20
20
  version: '0'
21
21
  type: :runtime
22
22
  prerelease: false
23
23
  version_requirements: !ruby/object:Gem::Requirement
24
24
  requirements:
25
- - - '>='
25
+ - - ! '>='
26
26
  - !ruby/object:Gem::Version
27
27
  version: '0'
28
28
  - !ruby/object:Gem::Dependency
@@ -125,6 +125,7 @@ files:
125
125
  - lib/httpi/cookie.rb
126
126
  - lib/httpi/cookie_store.rb
127
127
  - lib/httpi/dime.rb
128
+ - lib/httpi/logger.rb
128
129
  - lib/httpi/request.rb
129
130
  - lib/httpi/response.rb
130
131
  - lib/httpi/version.rb
@@ -176,17 +177,17 @@ require_paths:
176
177
  - lib
177
178
  required_ruby_version: !ruby/object:Gem::Requirement
178
179
  requirements:
179
- - - '>='
180
+ - - ! '>='
180
181
  - !ruby/object:Gem::Version
181
182
  version: '0'
182
183
  required_rubygems_version: !ruby/object:Gem::Requirement
183
184
  requirements:
184
- - - '>='
185
+ - - ! '>='
185
186
  - !ruby/object:Gem::Version
186
187
  version: '0'
187
188
  requirements: []
188
189
  rubyforge_project: httpi
189
- rubygems_version: 2.1.11
190
+ rubygems_version: 2.2.2
190
191
  signing_key:
191
192
  specification_version: 4
192
193
  summary: Common interface for Ruby's HTTP libraries