puffing-billy 0.6.1 → 0.6.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +13 -5
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/billy.rb +5 -5
- data/lib/billy/handlers/proxy_handler.rb +1 -1
- data/lib/billy/proxy.rb +3 -0
- data/lib/billy/proxy_connection.rb +2 -0
- data/lib/billy/version.rb +1 -1
- data/spec/lib/proxy_spec.rb +0 -11
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 036f99aa36198814c89f3764027a28b63d46e4d3
|
4
|
+
data.tar.gz: 14820ad20ea2e08038d8c9ed03921be8058831ac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e19c8f782fe8f99743bdb2349123447f7dd8cc6187721facec412650ef12d9d72d9a93155ee2bbcaaf0edfd7084abd61ef4882a6dd2d5e8f721caa96444370b
|
7
|
+
data.tar.gz: d1146aef57cad65dec0692f0492d2a662f923213dc7306128c345a627bbad3da45a79dadc26c2a77b0014a3f87b5caffa08c68cc7c86ad431f746d54946b0533
|
data/CHANGELOG.md
CHANGED
@@ -1,15 +1,23 @@
|
|
1
|
+
v0.6.2, 2015-11-23
|
2
|
+
------------------
|
3
|
+
|
4
|
+
* Enhanced error output for proxy handling [#125](https://github.com/oesmith/puffing-billy/pull/125)
|
5
|
+
* Use options to create webkit driver [#129](https://github.com/oesmith/puffing-billy/pull/129)
|
6
|
+
* Billy config and Capybara::Webkit config compatibility [#130](https://github.com/oesmith/puffing-billy/pull/130)
|
7
|
+
* Output the request method when proxy returns an error [#134](https://github.com/oesmith/puffing-billy/pull/134)
|
8
|
+
|
1
9
|
v0.6.1, 2015-08-25
|
2
10
|
------------------
|
3
11
|
|
4
|
-
* Fix `instance variable not initialized` warnings
|
5
|
-
* Add regex support to whitelist
|
6
|
-
* Support basic auth in requests
|
7
|
-
* Added alternative to run VCR in parallel
|
12
|
+
* Fix `instance variable not initialized` warnings [#107](https://github.com/oesmith/puffing-billy/pull/107)
|
13
|
+
* Add regex support to whitelist [#111](https://github.com/oesmith/puffing-billy/pull/111)
|
14
|
+
* Support basic auth in requests [#121](https://github.com/oesmith/puffing-billy/pull/121)
|
15
|
+
* Added alternative to run VCR in parallel [#122](https://github.com/oesmith/puffing-billy/pull/122)
|
8
16
|
|
9
17
|
v0.6.0, 2015-08-25
|
10
18
|
------------------
|
11
19
|
|
12
|
-
* Fix
|
20
|
+
* Fix uninitialized constant error in Minitest (#109)
|
13
21
|
* Add support for customizing Billy proxy host (#112)
|
14
22
|
* Add support for internal proxies (#118)
|
15
23
|
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -250,7 +250,7 @@ that are running on random ports.
|
|
250
250
|
or 304 status codes. This prevents unauthorized or internal server errors from
|
251
251
|
being cached and used for future test runs.
|
252
252
|
|
253
|
-
`c.non_successful_error_level` is used to log when non-successful
|
253
|
+
`c.non_successful_error_level` is used to log when non-successful responses are
|
254
254
|
received. By default, it just writes to the log file, but when set to `:error`
|
255
255
|
it throws an error with the URL and status code received for easier debugging.
|
256
256
|
|
data/lib/billy.rb
CHANGED
@@ -42,11 +42,11 @@ module Billy
|
|
42
42
|
|
43
43
|
if defined?(Capybara::Webkit::Driver)
|
44
44
|
Capybara.register_driver :webkit_billy do |app|
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
options = {
|
46
|
+
ignore_ssl_errors: false,
|
47
|
+
proxy: {host: Billy.proxy.host, port: Billy.proxy.port}
|
48
|
+
}
|
49
|
+
Capybara::Webkit::Driver.new(app, Capybara::Webkit::Configuration.to_hash.merge(options))
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
@@ -33,7 +33,7 @@ module Billy
|
|
33
33
|
|
34
34
|
unless allowed_response_code?(response[:status])
|
35
35
|
if Billy.config.non_successful_error_level == :error
|
36
|
-
return { error: "Request failed due to response status #{response[:status]} for '#{url}' which was not allowed." }
|
36
|
+
return { error: "#{method} Request failed due to response status #{response[:status]} for '#{url}' which was not allowed." }
|
37
37
|
else
|
38
38
|
Billy.log(:warn, "puffing-billy: Received response status code #{response[:status]} for '#{url}'")
|
39
39
|
end
|
data/lib/billy/proxy.rb
CHANGED
@@ -50,6 +50,9 @@ module Billy
|
|
50
50
|
@signature = EM.start_server('127.0.0.1', Billy.config.proxy_port, ProxyConnection) do |p|
|
51
51
|
p.handler = request_handler
|
52
52
|
p.cache = @cache if defined?(@cache)
|
53
|
+
p.errback do |msg|
|
54
|
+
Billy.log :error, msg
|
55
|
+
end
|
53
56
|
end
|
54
57
|
|
55
58
|
Billy.log(:info, "puffing-billy: Proxy listening on #{url}")
|
data/lib/billy/version.rb
CHANGED
data/spec/lib/proxy_spec.rb
CHANGED
@@ -230,17 +230,6 @@ shared_examples_for 'a cache' do
|
|
230
230
|
end
|
231
231
|
|
232
232
|
it 'should raise error for non-successful responses when :error' do
|
233
|
-
# When this config setting is set, the EventMachine running the test servers is killed upon error raising
|
234
|
-
# The `raise` is required to bubble up the error to the test running it
|
235
|
-
# The Faraday error is raised upon `close_connection` so this can be non-pending if we can do one of the following:
|
236
|
-
# 1) Remove the `raise error_message` conditionally for this test
|
237
|
-
# 2) Restart the test servers if they aren't running
|
238
|
-
# 3) Change the test servers to start/stop for each test instead of before all
|
239
|
-
# 4) Remove the test server completely and rely on the server instantiated by the app
|
240
|
-
pending 'Unable to test this without affecting the running test servers'
|
241
|
-
# If the 'pending' continues to execute the spec, 'skip' it to avoid EM errors.
|
242
|
-
# If 'pending' stops the test, 'skip' isn't defined but it won't hit this line.
|
243
|
-
skip 'Unable to test this without affecting the running test servers'
|
244
233
|
expect { http_error.get('/foo') }.to raise_error(Faraday::Error::ConnectionFailed)
|
245
234
|
end
|
246
235
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puffing-billy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.6.
|
4
|
+
version: 0.6.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olly Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-11-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|