attune 0.0.6 → 0.0.7
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 +4 -4
- data/attune.gemspec +1 -0
- data/lib/attune/default.rb +6 -1
- data/lib/attune/net_http_persistent.rb +15 -0
- data/lib/attune/version.rb +1 -1
- metadata +17 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a563fd197a9c289b606b60513d1ff6d59e923f59
|
|
4
|
+
data.tar.gz: db9e422ab1230d0df8b763d04d3b18f6ef263a78
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 77f9eee386f7c94052fcae0e1c9badbe97294ad0fdb7cf5227876cd6a41127bf6563398c808904cddf9ba3a2968e95d3c28f3554b036a26158c841665f521eb1
|
|
7
|
+
data.tar.gz: dcdabaec2faf8cc7d3e39f170a90a8fa970fae7de0dc3cfb2804a95067196c5bd7fe994c41a199557b6fc9b1d2ec8783f4ae64282698b96a18b7723e83691cbb
|
data/attune.gemspec
CHANGED
data/lib/attune/default.rb
CHANGED
|
@@ -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
|
-
|
|
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
|
data/lib/attune/version.rb
CHANGED
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.
|
|
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-
|
|
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
|