glebtv-httpclient 3.2.2 → 3.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fbfa21688174465890638f114dc5c7112585a4fb
4
- data.tar.gz: 6c5238d001ceff26fa29e4fbea423c12bd356a30
3
+ metadata.gz: 6cf2043154f902f7b5b729fd0fec0cb37256794b
4
+ data.tar.gz: fb3529a6832512228abba6d5598bfa572ebfe2cc
5
5
  SHA512:
6
- metadata.gz: deaeacee1fabae239a77494b29b3d39c30a895b0e45cc21d3bed00535bb04718ec87f38d0523f1dfe85d9622a0b0cbcb0cbff6864dc5283d3091191c83e5a004
7
- data.tar.gz: af09297a1507784c998f3f2838f1792775fa43be5b07f06b5b5bb82fc032a49a61a71965765a879f67ea7889b15ee15925ba4b9751cc8d6a9503734480e052e8
6
+ metadata.gz: bbbdff5e660faf4f26c0efd6d108f7b74468eeeb08dd059cb72303ef618b3902e2c9935991b14be8c45add521f52ea98691ddb307e0fc4e275a19f69cc0439ee
7
+ data.tar.gz: d3d3c5e8745b50c89759dc8d8eb964ccbbab55ccca11728771ddb608558636042d2fb576f344357ee2f27825492e602053b43ec90c31649e0d0b2c83b46f2484
data/Gemfile.lock CHANGED
@@ -1,22 +1,12 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- glebtv-httpclient (3.2.1)
5
- activesupport
6
- addressable
4
+ glebtv-httpclient (3.2.3)
7
5
  lru_redux
8
6
 
9
7
  GEM
10
8
  remote: http://rubygems.org/
11
9
  specs:
12
- activesupport (4.0.2)
13
- i18n (~> 0.6, >= 0.6.4)
14
- minitest (~> 4.2)
15
- multi_json (~> 1.3)
16
- thread_safe (~> 0.1)
17
- tzinfo (~> 0.3.37)
18
- addressable (2.3.5)
19
- atomic (1.1.14)
20
10
  coveralls (0.7.0)
21
11
  multi_json (~> 1.3)
22
12
  rest-client
@@ -26,11 +16,9 @@ GEM
26
16
  diff-lcs (1.2.5)
27
17
  docile (1.1.2)
28
18
  ffi2-generators (0.1.1)
29
- i18n (0.6.9)
30
19
  json (1.8.1)
31
20
  lru_redux (0.8.1)
32
21
  mime-types (2.1)
33
- minitest (4.7.5)
34
22
  multi_json (1.8.4)
35
23
  rake (10.1.1)
36
24
  rdoc (4.1.1)
@@ -266,10 +254,7 @@ GEM
266
254
  tins (~> 0.8)
267
255
  test-unit (2.5.5)
268
256
  thor (0.18.1)
269
- thread_safe (0.1.3)
270
- atomic
271
257
  tins (0.13.2)
272
- tzinfo (0.3.38)
273
258
 
274
259
  PLATFORMS
275
260
  ruby
data/httpclient.gemspec CHANGED
@@ -20,9 +20,7 @@ Gem::Specification.new do |spec|
20
20
  spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
21
21
  spec.require_paths = ["lib"]
22
22
 
23
- spec.add_dependency "activesupport"
24
23
  spec.add_dependency "lru_redux"
25
- spec.add_dependency "addressable"
26
24
 
27
25
  spec.add_development_dependency "bundler"
28
26
  spec.add_development_dependency "rake"
data/lib/httpclient.rb CHANGED
@@ -19,11 +19,8 @@ require 'httpclient/http'
19
19
  require 'httpclient/auth'
20
20
  require 'httpclient/cookie'
21
21
  require 'httpclient/cookie'
22
-
23
22
  require 'httpclient/lru_cache'
24
23
 
25
- require 'active_support/core_ext'
26
-
27
24
  # :main:HTTPClient
28
25
  # The HTTPClient class provides several methods for accessing Web resources
29
26
  # via HTTP.
@@ -234,8 +231,10 @@ require 'active_support/core_ext'
234
231
  # ruby -rhttpclient -e 'p HTTPClient.head(ARGV.shift).header["last-modified"]' http://dev.ctor.org/
235
232
  #
236
233
  class HTTPClient
237
- @@dns_cache = HTTPClient::LRUCache.new(ttl: 20.minutes, soft_ttl: 10.minute, retry_delay: 5.minutes)
238
- cattr_accessor :dns_cache
234
+ @@dns_cache = HTTPClient::LRUCache.new(ttl: 600, soft_ttl: 300, retry_delay: 60)
235
+ def self.dns_cache
236
+ @@dns_cache
237
+ end
239
238
 
240
239
  def own_methods
241
240
  (methods - (self.class.ancestors - [self.class]).collect { |k| k.instance_methods }.flatten).sort
@@ -824,14 +824,14 @@ class HTTPClient
824
824
  begin
825
825
  ip = IPAddr.new(clean_host).to_s
826
826
  # puts "! #{site.host} IS AN IP!\n"
827
- @debug_dev << "! #{site.host} IS AN IP!\n" if @debug_dev
827
+ # @debug_dev << "! #{site.host} IS AN IP!\n" if @debug_dev
828
828
  rescue
829
829
  ip = HTTPClient.dns_cache.fetch clean_host do
830
830
  Timeout.timeout(10) do
831
- @debug_dev << "! RESOLVING #{clean_host}" if @debug_dev
831
+ # @debug_dev << "! RESOLVING #{clean_host}" if @debug_dev
832
832
  ip = Resolv.getaddress(clean_host)
833
833
  # puts "! RESOLVED #{clean_host} TO #{ip}\n"
834
- @debug_dev << "! RESOLVED #{clean_host} TO #{ip}\n" if @debug_dev
834
+ # @debug_dev << "! RESOLVED #{clean_host} TO #{ip}\n" if @debug_dev
835
835
  ip
836
836
  end
837
837
  end
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '3.2.2' unless defined?(VERSION)
2
+ VERSION = '3.2.3' unless defined?(VERSION)
3
3
  end
@@ -313,7 +313,7 @@ describe HTTPClient do
313
313
  it '#urify' do
314
314
  urify(nil).should be_nil
315
315
  uri = 'http://foo'
316
- urify(uri).class.name.should eq 'HTTPClient::Util::AddressableURI'
316
+ # urify(uri).class.name.should eq 'HTTPClient::Util::AddressableURI'
317
317
  urify(uri).should eq urify(uri)
318
318
  urify(uri).to_s.should eq uri
319
319
  urify(urify(uri)).should eq urify(uri)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: glebtv-httpclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.2
4
+ version: 3.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv
@@ -11,20 +11,6 @@ bindir: bin
11
11
  cert_chain: []
12
12
  date: 2014-02-04 00:00:00.000000000 Z
13
13
  dependencies:
14
- - !ruby/object:Gem::Dependency
15
- name: activesupport
16
- requirement: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - '>='
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
- type: :runtime
22
- prerelease: false
23
- version_requirements: !ruby/object:Gem::Requirement
24
- requirements:
25
- - - '>='
26
- - !ruby/object:Gem::Version
27
- version: '0'
28
14
  - !ruby/object:Gem::Dependency
29
15
  name: lru_redux
30
16
  requirement: !ruby/object:Gem::Requirement
@@ -39,20 +25,6 @@ dependencies:
39
25
  - - '>='
40
26
  - !ruby/object:Gem::Version
41
27
  version: '0'
42
- - !ruby/object:Gem::Dependency
43
- name: addressable
44
- requirement: !ruby/object:Gem::Requirement
45
- requirements:
46
- - - '>='
47
- - !ruby/object:Gem::Version
48
- version: '0'
49
- type: :runtime
50
- prerelease: false
51
- version_requirements: !ruby/object:Gem::Requirement
52
- requirements:
53
- - - '>='
54
- - !ruby/object:Gem::Version
55
- version: '0'
56
28
  - !ruby/object:Gem::Dependency
57
29
  name: bundler
58
30
  requirement: !ruby/object:Gem::Requirement