faraday_middleware 0.8.5 → 0.8.6
Sign up to get free protection for your applications and to get access to all the features.
- data/.travis.yml +5 -3
- data/lib/faraday_middleware/rack_compatible.rb +5 -4
- data/lib/faraday_middleware/version.rb +1 -1
- data/spec/caching_test.rb +8 -1
- data/spec/helper.rb +2 -3
- metadata +19 -20
data/.travis.yml
CHANGED
@@ -67,13 +67,14 @@ module FaradayMiddleware
|
|
67
67
|
|
68
68
|
def finalize_response(env, rack_response)
|
69
69
|
status, headers, body = rack_response
|
70
|
-
body = body.inject(
|
70
|
+
body = body.inject() { |str, part| str << part }
|
71
71
|
headers = Faraday::Utils::Headers.new(headers) unless Faraday::Utils::Headers === headers
|
72
72
|
|
73
|
-
|
73
|
+
env.update :status => status.to_i,
|
74
|
+
:body => body,
|
75
|
+
:response_headers => headers
|
74
76
|
|
75
|
-
env[:response] ||= Faraday::Response.new(
|
76
|
-
env[:response].env.update(response_env)
|
77
|
+
env[:response] ||= Faraday::Response.new(env)
|
77
78
|
env[:response]
|
78
79
|
end
|
79
80
|
end
|
data/spec/caching_test.rb
CHANGED
@@ -117,10 +117,17 @@ class HttpCachingTest < Test::Unit::TestCase
|
|
117
117
|
def_delegators :@conn, :get, :post
|
118
118
|
|
119
119
|
def test_cache_get
|
120
|
-
|
120
|
+
response = get('/', :user_agent => 'test')
|
121
|
+
assert_equal 'request:1', response.body
|
122
|
+
assert_equal :get, response.env[:method]
|
123
|
+
assert_equal 200, response.status
|
124
|
+
|
121
125
|
response = get('/', :user_agent => 'test')
|
122
126
|
assert_equal 'request:1', response.body
|
123
127
|
assert_equal 'text/plain', response['content-type']
|
128
|
+
assert_equal :get, response.env[:method]
|
129
|
+
assert response.env[:request].respond_to?(:fetch)
|
130
|
+
assert_equal 200, response.status
|
124
131
|
|
125
132
|
assert_equal 'request:2', post('/').body
|
126
133
|
end
|
data/spec/helper.rb
CHANGED
@@ -1,15 +1,14 @@
|
|
1
1
|
if ENV['COVERAGE']
|
2
2
|
require 'simplecov'
|
3
3
|
|
4
|
-
|
4
|
+
SimpleCov.formatter = Class.new do
|
5
5
|
def format(result)
|
6
|
-
SimpleCov::Formatter::HTMLFormatter.new.format(result)
|
6
|
+
SimpleCov::Formatter::HTMLFormatter.new.format(result) unless ENV['CI']
|
7
7
|
File.open('coverage/covered_percent', 'w') do |f|
|
8
8
|
f.puts result.source_files.covered_percent.to_i
|
9
9
|
end
|
10
10
|
end
|
11
11
|
end
|
12
|
-
SimpleCov.formatter = SimpleCov::Formatter::QualityFormatter
|
13
12
|
|
14
13
|
SimpleCov.start do
|
15
14
|
# add_filter 'faraday_middleware.rb'
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: faraday_middleware
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-03-
|
13
|
+
date: 2012-03-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: faraday
|
17
|
-
requirement: &
|
17
|
+
requirement: &70323858414060 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -25,10 +25,10 @@ dependencies:
|
|
25
25
|
version: '0.9'
|
26
26
|
type: :runtime
|
27
27
|
prerelease: false
|
28
|
-
version_requirements: *
|
28
|
+
version_requirements: *70323858414060
|
29
29
|
- !ruby/object:Gem::Dependency
|
30
30
|
name: multi_xml
|
31
|
-
requirement: &
|
31
|
+
requirement: &70323858413240 !ruby/object:Gem::Requirement
|
32
32
|
none: false
|
33
33
|
requirements:
|
34
34
|
- - ~>
|
@@ -36,10 +36,10 @@ dependencies:
|
|
36
36
|
version: '0.2'
|
37
37
|
type: :development
|
38
38
|
prerelease: false
|
39
|
-
version_requirements: *
|
39
|
+
version_requirements: *70323858413240
|
40
40
|
- !ruby/object:Gem::Dependency
|
41
41
|
name: rake
|
42
|
-
requirement: &
|
42
|
+
requirement: &70323858412680 !ruby/object:Gem::Requirement
|
43
43
|
none: false
|
44
44
|
requirements:
|
45
45
|
- - ~>
|
@@ -47,10 +47,10 @@ dependencies:
|
|
47
47
|
version: '0.9'
|
48
48
|
type: :development
|
49
49
|
prerelease: false
|
50
|
-
version_requirements: *
|
50
|
+
version_requirements: *70323858412680
|
51
51
|
- !ruby/object:Gem::Dependency
|
52
52
|
name: hashie
|
53
|
-
requirement: &
|
53
|
+
requirement: &70323858412120 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
55
55
|
requirements:
|
56
56
|
- - ~>
|
@@ -58,10 +58,10 @@ dependencies:
|
|
58
58
|
version: '1.2'
|
59
59
|
type: :development
|
60
60
|
prerelease: false
|
61
|
-
version_requirements: *
|
61
|
+
version_requirements: *70323858412120
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rash
|
64
|
-
requirement: &
|
64
|
+
requirement: &70323858411460 !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ~>
|
@@ -69,10 +69,10 @@ dependencies:
|
|
69
69
|
version: '0.3'
|
70
70
|
type: :development
|
71
71
|
prerelease: false
|
72
|
-
version_requirements: *
|
72
|
+
version_requirements: *70323858411460
|
73
73
|
- !ruby/object:Gem::Dependency
|
74
74
|
name: rspec
|
75
|
-
requirement: &
|
75
|
+
requirement: &70323858410680 !ruby/object:Gem::Requirement
|
76
76
|
none: false
|
77
77
|
requirements:
|
78
78
|
- - ~>
|
@@ -80,10 +80,10 @@ dependencies:
|
|
80
80
|
version: '2.6'
|
81
81
|
type: :development
|
82
82
|
prerelease: false
|
83
|
-
version_requirements: *
|
83
|
+
version_requirements: *70323858410680
|
84
84
|
- !ruby/object:Gem::Dependency
|
85
85
|
name: simple_oauth
|
86
|
-
requirement: &
|
86
|
+
requirement: &70323858410200 !ruby/object:Gem::Requirement
|
87
87
|
none: false
|
88
88
|
requirements:
|
89
89
|
- - ~>
|
@@ -91,10 +91,10 @@ dependencies:
|
|
91
91
|
version: '0.1'
|
92
92
|
type: :development
|
93
93
|
prerelease: false
|
94
|
-
version_requirements: *
|
94
|
+
version_requirements: *70323858410200
|
95
95
|
- !ruby/object:Gem::Dependency
|
96
96
|
name: rack-cache
|
97
|
-
requirement: &
|
97
|
+
requirement: &70323858409700 !ruby/object:Gem::Requirement
|
98
98
|
none: false
|
99
99
|
requirements:
|
100
100
|
- - ~>
|
@@ -102,7 +102,7 @@ dependencies:
|
|
102
102
|
version: '1.1'
|
103
103
|
type: :development
|
104
104
|
prerelease: false
|
105
|
-
version_requirements: *
|
105
|
+
version_requirements: *70323858409700
|
106
106
|
description: Various middleware for Faraday
|
107
107
|
email:
|
108
108
|
- sferik@gmail.com
|
@@ -171,7 +171,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
171
171
|
version: 1.3.6
|
172
172
|
requirements: []
|
173
173
|
rubyforge_project:
|
174
|
-
rubygems_version: 1.8.
|
174
|
+
rubygems_version: 1.8.10
|
175
175
|
signing_key:
|
176
176
|
specification_version: 3
|
177
177
|
summary: Various middleware for Faraday
|
@@ -188,4 +188,3 @@ test_files:
|
|
188
188
|
- spec/parse_xml_spec.rb
|
189
189
|
- spec/parse_yaml_spec.rb
|
190
190
|
- spec/rashify_spec.rb
|
191
|
-
has_rdoc:
|