puffing-billy 3.0.3 → 3.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/README.md +15 -0
- data/lib/billy/browsers/capybara.rb +16 -1
- data/lib/billy/config.rb +3 -1
- data/lib/billy/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8b7d3b4b15358e9998041d26db1aba6f2ca23bca951c8c8c6b2aaf847e91c86e
|
4
|
+
data.tar.gz: 1c9c377f7fc4afe0ca4e834b589dee248781cf41dc2ec4226e7c12b793b0214f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f0764b84b5bcffa1a3e46f86109e37574689185455d3bf6d81ab6c54cd9688c443d0bf98d1531c3c1ffa88ac04f8208854756e205b743b70099d03ab34cfc524
|
7
|
+
data.tar.gz: 54ed99e222fbc2659673b575cfcd38cfa8b387fa58465e385cabd6e822d539da1cb4437b894abd7a2fa1755b5d152633ffb57fcc2791f02fa3e44f2d0c05ec36
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
v3.1.0, 2023-03-10
|
2
|
+
------------------
|
3
|
+
* Add support for Ruby 3.2 [#330](https://github.com/oesmith/puffing-billy/pull/330)
|
4
|
+
|
5
|
+
v3.0.4, 2022-08-07
|
6
|
+
------------------
|
7
|
+
* Adds a configurable Cuprite driver [#327](https://github.com/oesmith/puffing-billy/pull/327)
|
8
|
+
|
1
9
|
v3.0.3, 2022-05-31
|
2
10
|
-------------------
|
3
11
|
* Only calculate cache scope and key if request is cacheable [#324](https://github.com/oesmith/puffing-billy/pull/324)
|
data/README.md
CHANGED
@@ -65,6 +65,7 @@ Capybara.javascript_driver = :selenium_billy # Uses Firefox
|
|
65
65
|
# Capybara.javascript_driver = :apparition_billy
|
66
66
|
# Capybara.javascript_driver = :webkit_billy
|
67
67
|
# Capybara.javascript_driver = :poltergeist_billy
|
68
|
+
# Capybara.javascript_driver = :cuprite_billy
|
68
69
|
```
|
69
70
|
|
70
71
|
> __Note__: `:poltergeist_billy` doesn't support proxying any localhosts, so you must use
|
@@ -154,6 +155,20 @@ And /^a stub for google$/ do
|
|
154
155
|
end
|
155
156
|
```
|
156
157
|
|
158
|
+
### Setup remote Chrome
|
159
|
+
|
160
|
+
In the case you are using a Chrome instance, running on another machine, or in
|
161
|
+
another Docker container, you need to :
|
162
|
+
* Fix the Billy proxy host and port
|
163
|
+
* Passes the `--proxy-server=<billy host>:<billy port>`
|
164
|
+
|
165
|
+
#### WebSockets
|
166
|
+
|
167
|
+
Puffing billy doesn't support websockets, so if you are using them,
|
168
|
+
or ActionCable for the Ruby On Rails developers, you can tell Chrome to bypass
|
169
|
+
the proxy for websockets by adding the flag `--proxy-bypass-list=ws://*` to
|
170
|
+
your remote chrome intance or Docker container.
|
171
|
+
|
157
172
|
## Minitest Usage
|
158
173
|
|
159
174
|
Please see [this link](https://gist.github.com/sauy7/1b081266dd453a1b737b) for
|
@@ -8,7 +8,8 @@ module Billy
|
|
8
8
|
poltergeist: 'capybara/poltergeist',
|
9
9
|
webkit: 'capybara/webkit',
|
10
10
|
selenium: 'selenium/webdriver',
|
11
|
-
apparition: 'capybara/apparition'
|
11
|
+
apparition: 'capybara/apparition',
|
12
|
+
cuprite: 'capybara/cuprite'
|
12
13
|
}
|
13
14
|
|
14
15
|
def self.register_drivers
|
@@ -108,6 +109,20 @@ module Billy
|
|
108
109
|
end
|
109
110
|
end
|
110
111
|
|
112
|
+
def self.register_cuprite_driver
|
113
|
+
driver_otions = {
|
114
|
+
browser_options: {
|
115
|
+
'ignore-certificate-errors' => nil
|
116
|
+
}
|
117
|
+
}.deep_merge(Billy.config.cuprite_options)
|
118
|
+
|
119
|
+
::Capybara.register_driver :cuprite_billy do |app|
|
120
|
+
::Capybara::Cuprite::Driver.new(app, **driver_otions).tap do |driver|
|
121
|
+
driver.set_proxy(Billy.proxy.host, Billy.proxy.port)
|
122
|
+
end
|
123
|
+
end
|
124
|
+
end
|
125
|
+
|
111
126
|
def self.build_selenium_options_for_firefox
|
112
127
|
profile = Selenium::WebDriver::Firefox::Profile.new.tap do |prof|
|
113
128
|
prof.proxy = Selenium::WebDriver::Proxy.new(
|
data/lib/billy/config.rb
CHANGED
@@ -11,7 +11,8 @@ module Billy
|
|
11
11
|
:non_whitelisted_requests_disabled, :cache_path, :certs_path, :verify_peer, :proxy_host, :proxy_port, :proxied_request_inactivity_timeout,
|
12
12
|
:proxied_request_connect_timeout, :dynamic_jsonp, :dynamic_jsonp_keys, :dynamic_jsonp_callback_name, :merge_cached_responses_whitelist,
|
13
13
|
:strip_query_params, :proxied_request_host, :proxied_request_port, :cache_request_body_methods, :after_cache_handles_request,
|
14
|
-
:cache_simulates_network_delays, :cache_simulates_network_delay_time, :record_requests, :record_stub_requests, :use_ignore_params,
|
14
|
+
:cache_simulates_network_delays, :cache_simulates_network_delay_time, :record_requests, :record_stub_requests, :use_ignore_params,
|
15
|
+
:before_handle_request, :cuprite_options
|
15
16
|
|
16
17
|
def initialize
|
17
18
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -53,6 +54,7 @@ module Billy
|
|
53
54
|
@record_stub_requests = false
|
54
55
|
@use_ignore_params = true
|
55
56
|
@before_handle_request = nil
|
57
|
+
@cuprite_options = {}
|
56
58
|
end
|
57
59
|
end
|
58
60
|
|
data/lib/billy/version.rb
CHANGED
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: 3.0
|
4
|
+
version: 3.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olly Smith
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-03-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -28,16 +28,16 @@ dependencies:
|
|
28
28
|
name: thin
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - "
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version:
|
33
|
+
version: 1.8.1
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - "
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version:
|
40
|
+
version: 1.8.1
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: faraday
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|