faraday-conductivity 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ YzFiZDYzNzFhODliZjNjNTQ3YTlmMWE0MzY5YTkzYzFiYTEyOTJmMg==
5
+ data.tar.gz: !binary |-
6
+ MDMzZTJkODg4ZDEzNjk1OTEzMjkxMDA5YTRlYzQ4Y2FhNGE1N2VkZQ==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ NGQ5MzA4NmUzYjZlZWU4OTlkZmNlOGM0ODMyMmNlZjE0ZDk3ZDQ4MzM5Yjk3
10
+ MWFjNzE4ZTliYjNmZGNiMDdmYjgyYjUwZmE3YjI3ZDdiNWVhMGM4NzZiZDYz
11
+ NzY4OTZhOWE4ZDEwN2VjYzQ0NzliMGU2MzRmYjJjM2ViMTgxZDM=
12
+ data.tar.gz: !binary |-
13
+ Mzc2YjZjODg1NDNmOWIxODc1MjQ2ODMwZjc4YWNlODRkNWJhNzljMWMxMGI5
14
+ MjQ1NTBlZmY3ZWIwODc4YmJiMDNhZDE3MGZjMWE2NWQwZGE4MDQ0ZDUxODRj
15
+ YzFkNDQwZGEyYWNmMDAzMWQ4NDljYjFiODllZDRjNGM5YjMzYTI=
@@ -26,7 +26,7 @@ module Faraday
26
26
  tries = 0
27
27
  begin
28
28
  @app.call(env)
29
- rescue Faraday::Error::ClientError
29
+ rescue Faraday::Error::ClientError, SystemCallError
30
30
  if tries < @retries
31
31
  tries += 1
32
32
  @pattern.wait(tries)
@@ -1,5 +1,5 @@
1
1
  module Faraday
2
2
  module Conductivity
3
- VERSION = "0.1.0"
3
+ VERSION = "0.1.1"
4
4
  end
5
5
  end
@@ -26,6 +26,20 @@ describe Faraday::Conductivity::Repeater do
26
26
  get_with_max(3)
27
27
  end
28
28
 
29
+ it "handles other errors too" do
30
+ connection = Faraday.new(url: "http://blabla.bla") { |faraday|
31
+ faraday.use :repeater, mode: :rapid, retries: 2
32
+ faraday.adapter Faraday.default_adapter
33
+ }
34
+
35
+ pattern = double :pattern
36
+ Faraday::Conductivity::Repeater::Pattern.should_receive(:new).and_return(pattern)
37
+ pattern.should_receive(:wait).with(1).ordered
38
+ pattern.should_receive(:wait).with(2).ordered
39
+
40
+ expect { connection.get("/") }.to raise_error(Faraday::Error::ConnectionFailed)
41
+ end
42
+
29
43
  def get_with_max(num)
30
44
  connection.get("/unreliable/#{num}") { |req|
31
45
  req.options[:timeout] = 1
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: faraday-conductivity
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
5
- prerelease:
4
+ version: 0.1.1
6
5
  platform: ruby
7
6
  authors:
8
7
  - iain
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-03-15 00:00:00.000000000 Z
11
+ date: 2013-03-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: faraday
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,7 +27,6 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: rake
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
31
  - - ! '>='
36
32
  - !ruby/object:Gem::Version
@@ -38,7 +34,6 @@ dependencies:
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
38
  - - ! '>='
44
39
  - !ruby/object:Gem::Version
@@ -46,7 +41,6 @@ dependencies:
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: rspec
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
45
  - - ! '>='
52
46
  - !ruby/object:Gem::Version
@@ -54,7 +48,6 @@ dependencies:
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
52
  - - ! '>='
60
53
  - !ruby/object:Gem::Version
@@ -62,7 +55,6 @@ dependencies:
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: pry
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
59
  - - ! '>='
68
60
  - !ruby/object:Gem::Version
@@ -70,7 +62,6 @@ dependencies:
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
66
  - - ! '>='
76
67
  - !ruby/object:Gem::Version
@@ -78,7 +69,6 @@ dependencies:
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: service_double
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
73
  - - ! '>='
84
74
  - !ruby/object:Gem::Version
@@ -86,7 +76,6 @@ dependencies:
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
80
  - - ! '>='
92
81
  - !ruby/object:Gem::Version
@@ -123,27 +112,26 @@ files:
123
112
  homepage: https://github.com/yourkarma/faraday-conductivity
124
113
  licenses:
125
114
  - MIT
115
+ metadata: {}
126
116
  post_install_message:
127
117
  rdoc_options: []
128
118
  require_paths:
129
119
  - lib
130
120
  required_ruby_version: !ruby/object:Gem::Requirement
131
- none: false
132
121
  requirements:
133
122
  - - ! '>='
134
123
  - !ruby/object:Gem::Version
135
124
  version: '0'
136
125
  required_rubygems_version: !ruby/object:Gem::Requirement
137
- none: false
138
126
  requirements:
139
127
  - - ! '>='
140
128
  - !ruby/object:Gem::Version
141
129
  version: '0'
142
130
  requirements: []
143
131
  rubyforge_project:
144
- rubygems_version: 1.8.23
132
+ rubygems_version: 2.0.3
145
133
  signing_key:
146
- specification_version: 3
134
+ specification_version: 4
147
135
  summary: Extra Faraday middleware, geared towards a service oriented architecture.
148
136
  test_files:
149
137
  - spec/fake_server.rb