glebtv-httpclient 3.2.1 → 3.2.2

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: cf53dd7d1fb84aafaf0d492a43fea2120759dab6
4
- data.tar.gz: e57fc09b5ff8aecaffe1b6691175c4fdadb50e33
3
+ metadata.gz: fbfa21688174465890638f114dc5c7112585a4fb
4
+ data.tar.gz: 6c5238d001ceff26fa29e4fbea423c12bd356a30
5
5
  SHA512:
6
- metadata.gz: 007324756e3fc82d18487b249df8568963b1b783d9af76179db92bc75be378672dd1afde44cce40a2a7175945ac403c889d3855fb1c63ac97f087005a729b489
7
- data.tar.gz: fbcccac32b648db73853951458782f978e17e3094060740f4fb9d93fbd437cdd751afa300fa0cf871143fd87e9842a908910121b6a057c10b6108c0fe5d58404
6
+ metadata.gz: deaeacee1fabae239a77494b29b3d39c30a895b0e45cc21d3bed00535bb04718ec87f38d0523f1dfe85d9622a0b0cbcb0cbff6864dc5283d3091191c83e5a004
7
+ data.tar.gz: af09297a1507784c998f3f2838f1792775fa43be5b07f06b5b5bb82fc032a49a61a71965765a879f67ea7889b15ee15925ba4b9751cc8d6a9503734480e052e8
data/Gemfile.lock CHANGED
@@ -45,8 +45,11 @@ GEM
45
45
  rspec-expectations (2.14.5)
46
46
  diff-lcs (>= 1.1.3, < 2.0)
47
47
  rspec-mocks (2.14.5)
48
+ rubinius-compiler (2.0.4)
48
49
  rubinius-coverage (2.0.3)
49
- rubinius-debugger (2.0.1)
50
+ rubinius-debugger (2.0.2)
51
+ rubinius-compiler (~> 2.0)
52
+ rubysl-readline (~> 2.0)
50
53
  rubinius-developer_tools (2.0.0)
51
54
  rubinius-coverage (~> 2.0)
52
55
  rubinius-debugger (~> 2.0)
@@ -38,7 +38,7 @@ class HTTPClient
38
38
  if datum.nil?
39
39
  store(key, value = yield)
40
40
  elsif datum.expired?
41
- delete(key)
41
+ @data.delete(key)
42
42
  store(key, value = yield)
43
43
  elsif datum.soft_expired?
44
44
  begin
@@ -1,3 +1,3 @@
1
1
  class HTTPClient
2
- VERSION = '3.2.1' unless defined?(VERSION)
2
+ VERSION = '3.2.2' unless defined?(VERSION)
3
3
  end
data/spec/lru_spec.rb ADDED
@@ -0,0 +1,22 @@
1
+ # coding: utf-8
2
+ require 'spec_helper'
3
+
4
+ describe HTTPClient::LRUCache do
5
+ before :each do
6
+ @cache = subject.class.new(ttl: 3, max_size: 2, soft_ttl: 2)
7
+ end
8
+
9
+ it 'expires values' do
10
+ @cache.fetch 'test' do
11
+ 2
12
+ end.should eq 2
13
+ @cache.fetch 'test' do
14
+ 3
15
+ end.should eq 2
16
+ sleep 4
17
+ @cache.fetch 'test' do
18
+ 4
19
+ end.should eq 4
20
+ end
21
+ end
22
+
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.1
4
+ version: 3.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - glebtv
@@ -196,6 +196,7 @@ files:
196
196
  - spec/http_message_spec.rb
197
197
  - spec/httpclient_spec.rb
198
198
  - spec/keepalive_spec.rb
199
+ - spec/lru_spec.rb
199
200
  - spec/spec_helper.rb
200
201
  - spec/support/1024x768.gif
201
202
  - spec/support/1x1.png
@@ -257,6 +258,7 @@ test_files:
257
258
  - spec/http_message_spec.rb
258
259
  - spec/httpclient_spec.rb
259
260
  - spec/keepalive_spec.rb
261
+ - spec/lru_spec.rb
260
262
  - spec/spec_helper.rb
261
263
  - spec/support/1024x768.gif
262
264
  - spec/support/1x1.png