attune 0.0.6 → 0.0.7

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: 9fcb3b174303aab18d64ea1e56ec412bf7298552
4
- data.tar.gz: 98050a3c62e76e27bc964af0f9bf7ee1963103e0
3
+ metadata.gz: a563fd197a9c289b606b60513d1ff6d59e923f59
4
+ data.tar.gz: db9e422ab1230d0df8b763d04d3b18f6ef263a78
5
5
  SHA512:
6
- metadata.gz: dc64a1ad7fd516d957d34c39da1824bc4c134adaad8560b55458726b000be59f3ffb1fac0dd248db156dffaa537ac128842ce399fb788542466e25e5ec3b1547
7
- data.tar.gz: 4af40d496569fdcced972070e7b2d0eda0ff6363ed77d9d3301e690facc8cf665bed5763ac48bb49c26ec8b7e54d455a63a6205bbf6ee7b9a3a6b76e1f3c4cce
6
+ metadata.gz: 77f9eee386f7c94052fcae0e1c9badbe97294ad0fdb7cf5227876cd6a41127bf6563398c808904cddf9ba3a2968e95d3c28f3554b036a26158c841665f521eb1
7
+ data.tar.gz: dcdabaec2faf8cc7d3e39f170a90a8fa970fae7de0dc3cfb2804a95067196c5bd7fe994c41a199557b6fc9b1d2ec8783f4ae64282698b96a18b7723e83691cbb
data/attune.gemspec CHANGED
@@ -19,6 +19,7 @@ Gem::Specification.new do |spec|
19
19
  spec.require_paths = ["lib"]
20
20
 
21
21
  spec.add_dependency "faraday", "~> 0.9.0"
22
+ spec.add_dependency "net-http-persistent"
22
23
 
23
24
  spec.add_development_dependency "bundler", "~> 1.2"
24
25
  spec.add_development_dependency "rake"
@@ -1,5 +1,6 @@
1
1
  require "attune/call_dropping"
2
2
  require "attune/json_logger"
3
+ require "attune/net_http_persistent"
3
4
 
4
5
  module Attune
5
6
  # Default options
@@ -8,6 +9,9 @@ module Attune
8
9
 
9
10
  ENDPOINT = "http://localhost/".freeze
10
11
 
12
+ # user our version of NetHttpPersistent adapter
13
+ Faraday::Adapter.register_middleware(attune_http_persistent: NetHttpPersistent)
14
+
11
15
  MIDDLEWARE = Faraday::RackBuilder.new do |builder|
12
16
  # Log all requests
13
17
  builder.use Attune::CallDropping
@@ -22,7 +26,8 @@ module Attune
22
26
 
23
27
  # Raise exceptions for HTTP 4xx/5xx
24
28
  builder.response :raise_error
25
- builder.adapter Faraday.default_adapter
29
+
30
+ builder.adapter :attune_http_persistent
26
31
  end
27
32
 
28
33
  configure do |c|
@@ -0,0 +1,15 @@
1
+ # Hack NetHttpPersistent adapter to allow passing for env options
2
+ # We need this so we can pass in an option for idle_timout, until
3
+ # this is resolved https://github.com/lostisland/faraday/issues/262
4
+
5
+ module Attune
6
+ class NetHttpPersistent < Faraday::Adapter::NetHttpPersistent
7
+
8
+ def net_http_connection(env)
9
+ adapter = super
10
+ adapter.idle_timeout = 58 # seconds
11
+ adapter
12
+ end
13
+
14
+ end
15
+ end
@@ -1,3 +1,3 @@
1
1
  module Attune
2
- VERSION = "0.0.6"
2
+ VERSION = "0.0.7"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: attune
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.6
4
+ version: 0.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - John Hawthorn
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-03-19 00:00:00.000000000 Z
11
+ date: 2014-03-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday
@@ -24,6 +24,20 @@ dependencies:
24
24
  - - ~>
25
25
  - !ruby/object:Gem::Version
26
26
  version: 0.9.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: net-http-persistent
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
27
41
  - !ruby/object:Gem::Dependency
28
42
  name: bundler
29
43
  requirement: !ruby/object:Gem::Requirement
@@ -130,6 +144,7 @@ files:
130
144
  - lib/attune/configurable.rb
131
145
  - lib/attune/default.rb
132
146
  - lib/attune/json_logger.rb
147
+ - lib/attune/net_http_persistent.rb
133
148
  - lib/attune/version.rb
134
149
  - spec/attune/call_dropping_spec.rb
135
150
  - spec/attune/client_spec.rb