faraday-http-cache 2.2.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'net/http'
3
4
 
4
5
  class TestServer
@@ -27,11 +28,11 @@ class TestServer
27
28
  log = File.open('log/test.log', 'w+')
28
29
  log.sync = true
29
30
  webrick_opts = {
30
- Port: @port,
31
- Logger: WEBrick::Log.new(log),
32
- AccessLog: [[log, '[%{X-Faraday-Adapter}i] %m %U -> %s %b']]
31
+ Port: @port,
32
+ Logger: WEBrick::Log.new(log),
33
+ AccessLog: [[log, '[%{X-Faraday-Adapter}i] %m %U -> %s %b']]
33
34
  }
34
- Rack::Handler::WEBrick.run(TestApp, webrick_opts)
35
+ Rack::Handler::WEBrick.run(TestApp, **webrick_opts)
35
36
  end
36
37
  end
37
38
 
@@ -39,7 +40,7 @@ class TestServer
39
40
  conn = Net::HTTP.new @host, @port
40
41
  conn.open_timeout = conn.read_timeout = 0.1
41
42
 
42
- responsive = ->(path) { # rubocop:disable Style/BlockDelimiters
43
+ responsive = ->(path) {
43
44
  begin
44
45
  res = conn.start { conn.get(path) }
45
46
  res.is_a?(Net::HTTPSuccess)
@@ -51,6 +52,7 @@ class TestServer
51
52
  server_pings = 0
52
53
  loop do
53
54
  break if responsive.call('/ping')
55
+
54
56
  server_pings += 1
55
57
  sleep 0.05
56
58
  abort 'test server did not managed to start' if server_pings >= 50
@@ -61,6 +63,6 @@ class TestServer
61
63
  server = TCPServer.new(@host, 0)
62
64
  server.addr[1]
63
65
  ensure
64
- server.close if server
66
+ server&.close
65
67
  end
66
68
  end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'spec_helper'
3
4
 
4
5
  describe Faraday::HttpCache do
metadata CHANGED
@@ -1,15 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-http-cache
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.0
4
+ version: 2.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lucas Mazza
8
8
  - George Guimarães
9
- autorequire:
9
+ - Gustavo Araujo
10
+ autorequire:
10
11
  bindir: bin
11
12
  cert_chain: []
12
- date: 2020-04-13 00:00:00.000000000 Z
13
+ date: 2022-08-08 00:00:00.000000000 Z
13
14
  dependencies:
14
15
  - !ruby/object:Gem::Dependency
15
16
  name: faraday
@@ -37,9 +38,14 @@ files:
37
38
  - lib/faraday-http-cache.rb
38
39
  - lib/faraday/http_cache.rb
39
40
  - lib/faraday/http_cache/cache_control.rb
41
+ - lib/faraday/http_cache/memory_store.rb
40
42
  - lib/faraday/http_cache/request.rb
41
43
  - lib/faraday/http_cache/response.rb
42
44
  - lib/faraday/http_cache/storage.rb
45
+ - lib/faraday/http_cache/strategies.rb
46
+ - lib/faraday/http_cache/strategies/base_strategy.rb
47
+ - lib/faraday/http_cache/strategies/by_url.rb
48
+ - lib/faraday/http_cache/strategies/by_vary.rb
43
49
  - spec/binary_spec.rb
44
50
  - spec/cache_control_spec.rb
45
51
  - spec/http_cache_spec.rb
@@ -49,15 +55,18 @@ files:
49
55
  - spec/response_spec.rb
50
56
  - spec/spec_helper.rb
51
57
  - spec/storage_spec.rb
58
+ - spec/strategies/base_strategy_spec.rb
59
+ - spec/strategies/by_url_spec.rb
60
+ - spec/strategies/by_vary_spec.rb
52
61
  - spec/support/empty.png
53
62
  - spec/support/test_app.rb
54
63
  - spec/support/test_server.rb
55
64
  - spec/validation_spec.rb
56
65
  homepage: https://github.com/sourcelevel/faraday-http-cache
57
66
  licenses:
58
- - Apache 2.0
67
+ - Apache-2.0
59
68
  metadata: {}
60
- post_install_message:
69
+ post_install_message:
61
70
  rdoc_options: []
62
71
  require_paths:
63
72
  - lib
@@ -65,29 +74,31 @@ required_ruby_version: !ruby/object:Gem::Requirement
65
74
  requirements:
66
75
  - - ">="
67
76
  - !ruby/object:Gem::Version
68
- version: 2.1.0
77
+ version: 2.4.0
69
78
  required_rubygems_version: !ruby/object:Gem::Requirement
70
79
  requirements:
71
80
  - - ">="
72
81
  - !ruby/object:Gem::Version
73
82
  version: '0'
74
83
  requirements: []
75
- rubyforge_project:
76
- rubygems_version: 2.6.8
77
- signing_key:
84
+ rubygems_version: 3.2.3
85
+ signing_key:
78
86
  specification_version: 4
79
87
  summary: A Faraday middleware that stores and validates cache expiration.
80
88
  test_files:
81
- - spec/spec_helper.rb
82
- - spec/validation_spec.rb
83
- - spec/json_spec.rb
89
+ - spec/binary_spec.rb
90
+ - spec/cache_control_spec.rb
91
+ - spec/http_cache_spec.rb
84
92
  - spec/instrumentation_spec.rb
93
+ - spec/json_spec.rb
94
+ - spec/request_spec.rb
95
+ - spec/response_spec.rb
96
+ - spec/spec_helper.rb
85
97
  - spec/storage_spec.rb
86
- - spec/http_cache_spec.rb
87
- - spec/binary_spec.rb
88
- - spec/support/test_app.rb
98
+ - spec/strategies/base_strategy_spec.rb
99
+ - spec/strategies/by_url_spec.rb
100
+ - spec/strategies/by_vary_spec.rb
89
101
  - spec/support/empty.png
102
+ - spec/support/test_app.rb
90
103
  - spec/support/test_server.rb
91
- - spec/request_spec.rb
92
- - spec/cache_control_spec.rb
93
- - spec/response_spec.rb
104
+ - spec/validation_spec.rb