puffing-billy 2.3.1 → 3.0.1
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/CHANGELOG.md +17 -0
- data/README.md +18 -5
- data/lib/billy/browsers/capybara.rb +13 -9
- data/lib/billy/browsers/watir.rb +4 -2
- data/lib/billy/config.rb +2 -1
- data/lib/billy/handlers/proxy_handler.rb +4 -0
- data/lib/billy/proxy.rb +1 -1
- data/lib/billy/ssl/certificate_helpers.rb +1 -1
- data/lib/billy/version.rb +1 -1
- metadata +29 -80
- data/.gitignore +0 -6
- data/.rspec +0 -2
- data/.travis.yml +0 -36
- data/Dockerfile +0 -14
- data/Gemfile +0 -4
- data/Guardfile +0 -23
- data/Rakefile +0 -11
- data/bin/proxy.rb +0 -3
- data/examples/README.md +0 -1
- data/examples/facebook_api.html +0 -59
- data/examples/intercept_request.html +0 -10
- data/examples/post_api.html +0 -16
- data/examples/preflight_request.html +0 -22
- data/examples/tumblr_api.html +0 -22
- data/examples/tumblr_api_https.html +0 -22
- data/lib/tasks/billy.rake +0 -87
- data/log/.gitkeep +0 -0
- data/puffing-billy.gemspec +0 -39
- data/spec/features/examples/facebook_api_spec.rb +0 -23
- data/spec/features/examples/intercept_request_spec.rb +0 -31
- data/spec/features/examples/post_api_spec.rb +0 -15
- data/spec/features/examples/preflight_request_spec.rb +0 -29
- data/spec/features/examples/tumblr_api_spec.rb +0 -59
- data/spec/lib/billy/browsers/capybara_spec.rb +0 -28
- data/spec/lib/billy/cache_spec.rb +0 -158
- data/spec/lib/billy/handlers/cache_handler_spec.rb +0 -191
- data/spec/lib/billy/handlers/handler_spec.rb +0 -16
- data/spec/lib/billy/handlers/proxy_handler_spec.rb +0 -254
- data/spec/lib/billy/handlers/request_handler_spec.rb +0 -200
- data/spec/lib/billy/handlers/request_log_spec.rb +0 -74
- data/spec/lib/billy/handlers/stub_handler_spec.rb +0 -117
- data/spec/lib/billy/proxy_connection_spec.rb +0 -20
- data/spec/lib/billy/proxy_request_stub_spec.rb +0 -252
- data/spec/lib/billy/resource_utils_spec.rb +0 -55
- data/spec/lib/billy/ssl/authority_spec.rb +0 -84
- data/spec/lib/billy/ssl/certificate_chain_spec.rb +0 -39
- data/spec/lib/billy/ssl/certificate_spec.rb +0 -89
- data/spec/lib/billy/watir/watir_spec.rb +0 -18
- data/spec/lib/proxy_spec.rb +0 -431
- data/spec/spec_helper.rb +0 -52
- data/spec/support/test_server.rb +0 -79
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ec02ea3b7f01e33d68df684db911886bacb0b9c92f1fbe3d9931df42218dd78f
|
4
|
+
data.tar.gz: 9ea280821375f4ba83429c33aa2d17035a3269e580fbb52c6a26e5db968eed25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9b1680023f9b58ee65995bc91471d11f4d1a9fd96dbee00a9635edb23775bbe2824b3234414c5d87aa33709a10b8c71729079bb0bd885db7023958aa4da77859
|
7
|
+
data.tar.gz: f42c4227325d9dcab48a50eed2f5470db36c90e5fc8aff2618cfd37531fe15e23345b7bff92080053a130b0e9755a8f43c46cdf958d45ece795e8cd4ac7e7c51
|
data/CHANGELOG.md
CHANGED
@@ -1,3 +1,20 @@
|
|
1
|
+
v3.0.1, 2022-02-15
|
2
|
+
-------------------
|
3
|
+
* Adapt to newer versions selenium webdriver [#314](https://github.com/oesmith/puffing-billy/pull/314)
|
4
|
+
|
5
|
+
v3.0.0, 2022-02-15
|
6
|
+
-------------------
|
7
|
+
* Add support for Ruby 2.7+, remove support for Ruby 2.4 and 2.5
|
8
|
+
|
9
|
+
v2.4.1, 2021-01-05
|
10
|
+
-------------------
|
11
|
+
* Rescue Errno::ECONNRESET in shutdown phase [#307](https://github.com/oesmith/puffing-billy/pull/307)
|
12
|
+
|
13
|
+
v2.4.0, 2020-08-26
|
14
|
+
-------------------
|
15
|
+
* Make verify_peer configurable and default it to false [#294](https://github.com/oesmith/puffing-billy/pull/294)
|
16
|
+
* Include pid in names of temporary files [#290](https://github.com/oesmith/puffing-billy/pull/290)
|
17
|
+
|
1
18
|
v2.3.1, 2020-03-19
|
2
19
|
-------------------
|
3
20
|
* Update min 'faraday' gem version required [#285](https://github.com/oesmith/puffing-billy/pull/285)
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# Puffing Billy [](https://badge.fury.io/rb/puffing-billy)
|
1
|
+
# Puffing Billy [](https://badge.fury.io/rb/puffing-billy) 
|
2
2
|
|
3
3
|
A rewriting web proxy for testing interactions between your browser and
|
4
4
|
external sites. Works with ruby + rspec.
|
@@ -437,7 +437,7 @@ The handler column indicates how Puffing Billy handled your request:
|
|
437
437
|
- error: This request was not handled by a stub, and was not successfully handled
|
438
438
|
- cache: This response was handled by a previous cache
|
439
439
|
|
440
|
-
If your `status` is set to
|
440
|
+
If your `status` is set to `inflight` this request has not yet been handled fully. Either puffing billy crashed
|
441
441
|
internally on this request, or your test ended before it could complete successfully.
|
442
442
|
|
443
443
|
`c.cache_request_body_methods` is used to specify HTTP methods of requests that you would like to cache separately based on the contents of the request body. The default is ['post'].
|
@@ -551,7 +551,7 @@ Before('@javascript') do |scenario, block|
|
|
551
551
|
feature_name = scenario.feature.name.underscore
|
552
552
|
scenario_name = scenario.name.underscore
|
553
553
|
c.cache_path = "features/support/fixtures/req_cache/#{feature_name}/#{scenario_name}/"
|
554
|
-
|
554
|
+
FileUtils.mkdir_p(Billy.config.cache_path) unless File.exist?(Billy.config.cache_path)
|
555
555
|
end
|
556
556
|
end
|
557
557
|
```
|
@@ -740,10 +740,23 @@ the system store. So after a run of your the suite only one certificate will be
|
|
740
740
|
left over. If this is not enough you can handling the cleanup again with a
|
741
741
|
custom on-after hook.
|
742
742
|
|
743
|
+
### TLS hostname validation
|
744
|
+
|
745
|
+
em-http-request was modified to emit a warning if being used without the TLS
|
746
|
+
``verify_peer`` option. Puffing Billy defaults to specifying ``verify_peer: false``
|
747
|
+
but you can now modify configuration to do peer verification. So if you've
|
748
|
+
gone to the trouble of setting up your own certificate authority and self-signed
|
749
|
+
certs you can enable it like so:
|
750
|
+
|
751
|
+
```ruby
|
752
|
+
Billy.configure do |c|
|
753
|
+
c.verify_peer = true
|
754
|
+
end
|
755
|
+
```
|
756
|
+
|
743
757
|
## Resources
|
744
758
|
|
745
|
-
* [Bring Ruby VCR to Javascript testing with Capybara and puffing-billy](
|
746
|
-
* [Integration Testing Stripe.js With Mocked Network Requests](http://dev.contractual.ly/testing-stripe-js-with-mocked-network/)
|
759
|
+
* [Bring Ruby VCR to Javascript testing with Capybara and puffing-billy](https://dzone.com/articles/bring-ruby-vcr-javascript)
|
747
760
|
* [Clean-up unused cache files periodically with this config](https://github.com/oesmith/puffing-billy/pull/26#issuecomment-29905030)
|
748
761
|
|
749
762
|
## Contributing
|
@@ -47,19 +47,24 @@ module Billy
|
|
47
47
|
|
48
48
|
def self.register_selenium_driver
|
49
49
|
::Capybara.register_driver :selenium_billy do |app|
|
50
|
-
|
51
|
-
|
50
|
+
capabilities = [
|
51
|
+
build_selenium_options_for_firefox,
|
52
|
+
Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
|
53
|
+
]
|
52
54
|
|
53
|
-
::Capybara::Selenium::Driver.new(app,
|
55
|
+
::Capybara::Selenium::Driver.new(app, capabilities: capabilities)
|
54
56
|
end
|
55
57
|
|
56
58
|
::Capybara.register_driver :selenium_headless_billy do |app|
|
57
59
|
options = build_selenium_options_for_firefox.tap do |opts|
|
58
60
|
opts.add_argument '-headless'
|
59
61
|
end
|
60
|
-
capabilities =
|
61
|
-
|
62
|
-
|
62
|
+
capabilities = [
|
63
|
+
options,
|
64
|
+
Selenium::WebDriver::Remote::Capabilities.firefox(accept_insecure_certs: true)
|
65
|
+
]
|
66
|
+
|
67
|
+
::Capybara::Selenium::Driver.new(app, capabilities: capabilities)
|
63
68
|
end
|
64
69
|
|
65
70
|
::Capybara.register_driver :selenium_chrome_billy do |app|
|
@@ -70,7 +75,7 @@ module Billy
|
|
70
75
|
::Capybara::Selenium::Driver.new(
|
71
76
|
app,
|
72
77
|
browser: :chrome,
|
73
|
-
|
78
|
+
capabilities: options,
|
74
79
|
clear_local_storage: true,
|
75
80
|
clear_session_storage: true
|
76
81
|
)
|
@@ -88,7 +93,7 @@ module Billy
|
|
88
93
|
::Capybara::Selenium::Driver.new(
|
89
94
|
app,
|
90
95
|
browser: :chrome,
|
91
|
-
|
96
|
+
capabilities: options,
|
92
97
|
clear_local_storage: true,
|
93
98
|
clear_session_storage: true
|
94
99
|
)
|
@@ -105,7 +110,6 @@ module Billy
|
|
105
110
|
|
106
111
|
def self.build_selenium_options_for_firefox
|
107
112
|
profile = Selenium::WebDriver::Firefox::Profile.new.tap do |prof|
|
108
|
-
prof.assume_untrusted_certificate_issuer = false
|
109
113
|
prof.proxy = Selenium::WebDriver::Proxy.new(
|
110
114
|
http: "#{Billy.proxy.host}:#{Billy.proxy.port}",
|
111
115
|
ssl: "#{Billy.proxy.host}:#{Billy.proxy.port}")
|
data/lib/billy/browsers/watir.rb
CHANGED
@@ -20,8 +20,10 @@ module Billy
|
|
20
20
|
|
21
21
|
def configure_chrome(args)
|
22
22
|
args[:headless] = true
|
23
|
-
args[:
|
24
|
-
|
23
|
+
args[:proxy] = {
|
24
|
+
http: "#{Billy.proxy.host}:#{Billy.proxy.port}",
|
25
|
+
ssl: "#{Billy.proxy.host}:#{Billy.proxy.port}"
|
26
|
+
}
|
25
27
|
args
|
26
28
|
end
|
27
29
|
|
data/lib/billy/config.rb
CHANGED
@@ -8,7 +8,7 @@ module Billy
|
|
8
8
|
|
9
9
|
attr_accessor :logger, :cache, :cache_request_headers, :whitelist, :cache_whitelist, :path_blacklist, :ignore_params, :allow_params,
|
10
10
|
:persist_cache, :ignore_cache_port, :non_successful_cache_disabled, :non_successful_error_level,
|
11
|
-
:non_whitelisted_requests_disabled, :cache_path, :certs_path, :proxy_host, :proxy_port, :proxied_request_inactivity_timeout,
|
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
14
|
:cache_simulates_network_delays, :cache_simulates_network_delay_time, :record_requests, :record_stub_requests, :use_ignore_params, :before_handle_request
|
@@ -37,6 +37,7 @@ module Billy
|
|
37
37
|
@non_whitelisted_requests_disabled = false
|
38
38
|
@cache_path = File.join(Dir.tmpdir, 'puffing-billy')
|
39
39
|
@certs_path = File.join(Dir.tmpdir, 'puffing-billy', 'certs')
|
40
|
+
@verify_peer = false
|
40
41
|
@proxy_host = 'localhost'
|
41
42
|
@proxy_port = RANDOM_AVAILABLE_PORT
|
42
43
|
@proxied_request_inactivity_timeout = 10 # defaults from https://github.com/igrigorik/em-http-request/wiki/Redirects-and-Timeouts
|
@@ -16,6 +16,10 @@ module Billy
|
|
16
16
|
opts = { inactivity_timeout: Billy.config.proxied_request_inactivity_timeout,
|
17
17
|
connect_timeout: Billy.config.proxied_request_connect_timeout }
|
18
18
|
|
19
|
+
if url =~ /^https/
|
20
|
+
opts.merge!({tls: {verify_peer: Billy.config.verify_peer}})
|
21
|
+
end
|
22
|
+
|
19
23
|
if Billy.config.proxied_request_host && !bypass_internal_proxy?(url)
|
20
24
|
opts.merge!({ proxy: { host: Billy.config.proxied_request_host,
|
21
25
|
port: Billy.config.proxied_request_port }} )
|
data/lib/billy/proxy.rb
CHANGED
@@ -62,7 +62,7 @@ module Billy
|
|
62
62
|
s.close
|
63
63
|
Billy.log(:info, "puffing-billy: Waiting for event machine to shutdown on port #{port}")
|
64
64
|
s
|
65
|
-
rescue Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL, Errno::ENETUNREACH
|
65
|
+
rescue Errno::ECONNREFUSED, Errno::EADDRNOTAVAIL, Errno::ENETUNREACH, Errno::ECONNRESET
|
66
66
|
false
|
67
67
|
end
|
68
68
|
|
@@ -27,7 +27,7 @@ module Billy
|
|
27
27
|
# and ensure the location is safely created. Pass
|
28
28
|
# back the resulting path.
|
29
29
|
def write_file(name, contents)
|
30
|
-
path = File.join(Billy.config.certs_path, name)
|
30
|
+
path = File.join(Billy.config.certs_path, "#{Process.pid}-#{name}")
|
31
31
|
FileUtils.mkdir_p(File.dirname(path))
|
32
32
|
File.write(path, contents)
|
33
33
|
path
|
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:
|
4
|
+
version: 3.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olly Smith
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2022-02-15 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -86,14 +86,14 @@ dependencies:
|
|
86
86
|
requirements:
|
87
87
|
- - ">="
|
88
88
|
- !ruby/object:Gem::Version
|
89
|
-
version:
|
89
|
+
version: 4.0.0
|
90
90
|
type: :development
|
91
91
|
prerelease: false
|
92
92
|
version_requirements: !ruby/object:Gem::Requirement
|
93
93
|
requirements:
|
94
94
|
- - ">="
|
95
95
|
- !ruby/object:Gem::Version
|
96
|
-
version:
|
96
|
+
version: 4.0.0
|
97
97
|
- !ruby/object:Gem::Dependency
|
98
98
|
name: rack
|
99
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -184,16 +184,30 @@ dependencies:
|
|
184
184
|
requirements:
|
185
185
|
- - "~>"
|
186
186
|
- !ruby/object:Gem::Version
|
187
|
-
version:
|
187
|
+
version: 7.1.0
|
188
188
|
type: :development
|
189
189
|
prerelease: false
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
191
191
|
requirements:
|
192
192
|
- - "~>"
|
193
193
|
- !ruby/object:Gem::Version
|
194
|
-
version:
|
194
|
+
version: 7.1.0
|
195
195
|
- !ruby/object:Gem::Dependency
|
196
196
|
name: webdrivers
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - ">="
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 5.0.0
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - ">="
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 5.0.0
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: webrick
|
197
211
|
requirement: !ruby/object:Gem::Requirement
|
198
212
|
requirements:
|
199
213
|
- - ">="
|
@@ -314,29 +328,13 @@ description: A stubbing proxy server for ruby. Connect it to your browser in int
|
|
314
328
|
tests to fake interactions with remote HTTP(S) servers.
|
315
329
|
email:
|
316
330
|
- olly.smith@gmail.com
|
317
|
-
executables:
|
318
|
-
- proxy.rb
|
331
|
+
executables: []
|
319
332
|
extensions: []
|
320
333
|
extra_rdoc_files: []
|
321
334
|
files:
|
322
|
-
- ".gitignore"
|
323
|
-
- ".rspec"
|
324
|
-
- ".travis.yml"
|
325
335
|
- CHANGELOG.md
|
326
|
-
- Dockerfile
|
327
|
-
- Gemfile
|
328
|
-
- Guardfile
|
329
336
|
- LICENSE
|
330
337
|
- README.md
|
331
|
-
- Rakefile
|
332
|
-
- bin/proxy.rb
|
333
|
-
- examples/README.md
|
334
|
-
- examples/facebook_api.html
|
335
|
-
- examples/intercept_request.html
|
336
|
-
- examples/post_api.html
|
337
|
-
- examples/preflight_request.html
|
338
|
-
- examples/tumblr_api.html
|
339
|
-
- examples/tumblr_api_https.html
|
340
338
|
- lib/billy.rb
|
341
339
|
- lib/billy/browsers/capybara.rb
|
342
340
|
- lib/billy/browsers/watir.rb
|
@@ -368,36 +366,11 @@ files:
|
|
368
366
|
- lib/billy/watir/rspec.rb
|
369
367
|
- lib/puffing-billy.rb
|
370
368
|
- lib/puffing-billy/rspec.rb
|
371
|
-
- lib/tasks/billy.rake
|
372
|
-
- log/.gitkeep
|
373
|
-
- puffing-billy.gemspec
|
374
|
-
- spec/features/examples/facebook_api_spec.rb
|
375
|
-
- spec/features/examples/intercept_request_spec.rb
|
376
|
-
- spec/features/examples/post_api_spec.rb
|
377
|
-
- spec/features/examples/preflight_request_spec.rb
|
378
|
-
- spec/features/examples/tumblr_api_spec.rb
|
379
|
-
- spec/lib/billy/browsers/capybara_spec.rb
|
380
|
-
- spec/lib/billy/cache_spec.rb
|
381
|
-
- spec/lib/billy/handlers/cache_handler_spec.rb
|
382
|
-
- spec/lib/billy/handlers/handler_spec.rb
|
383
|
-
- spec/lib/billy/handlers/proxy_handler_spec.rb
|
384
|
-
- spec/lib/billy/handlers/request_handler_spec.rb
|
385
|
-
- spec/lib/billy/handlers/request_log_spec.rb
|
386
|
-
- spec/lib/billy/handlers/stub_handler_spec.rb
|
387
|
-
- spec/lib/billy/proxy_connection_spec.rb
|
388
|
-
- spec/lib/billy/proxy_request_stub_spec.rb
|
389
|
-
- spec/lib/billy/resource_utils_spec.rb
|
390
|
-
- spec/lib/billy/ssl/authority_spec.rb
|
391
|
-
- spec/lib/billy/ssl/certificate_chain_spec.rb
|
392
|
-
- spec/lib/billy/ssl/certificate_spec.rb
|
393
|
-
- spec/lib/billy/watir/watir_spec.rb
|
394
|
-
- spec/lib/proxy_spec.rb
|
395
|
-
- spec/spec_helper.rb
|
396
|
-
- spec/support/test_server.rb
|
397
369
|
homepage: https://github.com/oesmith/puffing-billy
|
398
|
-
licenses:
|
370
|
+
licenses:
|
371
|
+
- MIT
|
399
372
|
metadata: {}
|
400
|
-
post_install_message:
|
373
|
+
post_install_message:
|
401
374
|
rdoc_options: []
|
402
375
|
require_paths:
|
403
376
|
- lib
|
@@ -405,39 +378,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
405
378
|
requirements:
|
406
379
|
- - ">="
|
407
380
|
- !ruby/object:Gem::Version
|
408
|
-
version:
|
381
|
+
version: 2.6.0
|
409
382
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
410
383
|
requirements:
|
411
384
|
- - ">="
|
412
385
|
- !ruby/object:Gem::Version
|
413
386
|
version: '0'
|
414
387
|
requirements: []
|
415
|
-
|
416
|
-
|
417
|
-
signing_key:
|
388
|
+
rubygems_version: 3.2.22
|
389
|
+
signing_key:
|
418
390
|
specification_version: 4
|
419
391
|
summary: Easy request stubs for browser tests.
|
420
|
-
test_files:
|
421
|
-
- spec/features/examples/facebook_api_spec.rb
|
422
|
-
- spec/features/examples/intercept_request_spec.rb
|
423
|
-
- spec/features/examples/post_api_spec.rb
|
424
|
-
- spec/features/examples/preflight_request_spec.rb
|
425
|
-
- spec/features/examples/tumblr_api_spec.rb
|
426
|
-
- spec/lib/billy/browsers/capybara_spec.rb
|
427
|
-
- spec/lib/billy/cache_spec.rb
|
428
|
-
- spec/lib/billy/handlers/cache_handler_spec.rb
|
429
|
-
- spec/lib/billy/handlers/handler_spec.rb
|
430
|
-
- spec/lib/billy/handlers/proxy_handler_spec.rb
|
431
|
-
- spec/lib/billy/handlers/request_handler_spec.rb
|
432
|
-
- spec/lib/billy/handlers/request_log_spec.rb
|
433
|
-
- spec/lib/billy/handlers/stub_handler_spec.rb
|
434
|
-
- spec/lib/billy/proxy_connection_spec.rb
|
435
|
-
- spec/lib/billy/proxy_request_stub_spec.rb
|
436
|
-
- spec/lib/billy/resource_utils_spec.rb
|
437
|
-
- spec/lib/billy/ssl/authority_spec.rb
|
438
|
-
- spec/lib/billy/ssl/certificate_chain_spec.rb
|
439
|
-
- spec/lib/billy/ssl/certificate_spec.rb
|
440
|
-
- spec/lib/billy/watir/watir_spec.rb
|
441
|
-
- spec/lib/proxy_spec.rb
|
442
|
-
- spec/spec_helper.rb
|
443
|
-
- spec/support/test_server.rb
|
392
|
+
test_files: []
|
data/.gitignore
DELETED
data/.rspec
DELETED
data/.travis.yml
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
language: ruby
|
2
|
-
|
3
|
-
rvm:
|
4
|
-
- 2.3
|
5
|
-
- 2.4
|
6
|
-
- 2.5
|
7
|
-
- 2.6
|
8
|
-
|
9
|
-
cache:
|
10
|
-
bundler: true
|
11
|
-
directories:
|
12
|
-
- $HOME/.webdrivers
|
13
|
-
|
14
|
-
addons:
|
15
|
-
chrome: stable
|
16
|
-
apt:
|
17
|
-
update: true
|
18
|
-
|
19
|
-
sudo: false
|
20
|
-
dist: xenial
|
21
|
-
|
22
|
-
rvm:
|
23
|
-
- 2.3
|
24
|
-
- 2.4
|
25
|
-
- 2.5
|
26
|
-
- 2.6
|
27
|
-
|
28
|
-
matrix:
|
29
|
-
fast_finish: true
|
30
|
-
|
31
|
-
bundler_args: --jobs 3 --retry 3
|
32
|
-
|
33
|
-
before_install:
|
34
|
-
- gem update --system
|
35
|
-
- gem install bundler
|
36
|
-
|
data/Dockerfile
DELETED
@@ -1,14 +0,0 @@
|
|
1
|
-
FROM ruby:1.9.3
|
2
|
-
|
3
|
-
RUN apt-get update -y
|
4
|
-
RUN apt-get install -y qt5-default libqt5webkit5-dev gstreamer1.0-plugins-base gstreamer1.0-tools gstreamer1.0-x
|
5
|
-
RUN gem install bundler
|
6
|
-
RUN \
|
7
|
-
export PHANTOMJS_VERSION='2.1.1' && \
|
8
|
-
export PHANTOMJS_URL='https://github.com/Medium/phantomjs/releases/download/v2.1.1/phantomjs-2.1.1-linux-x86_64.tar.bz2' && \
|
9
|
-
wget -q ${PHANTOMJS_URL} && \
|
10
|
-
tar xfv phantomjs-${PHANTOMJS_VERSION}-linux-x86_64.tar.bz2 \
|
11
|
-
-C /usr/bin --wildcards */bin/phantomjs --strip-components=2
|
12
|
-
RUN mkdir -p /app
|
13
|
-
COPY . /app
|
14
|
-
RUN cd /app && bundle install
|
data/Gemfile
DELETED
data/Guardfile
DELETED
@@ -1,23 +0,0 @@
|
|
1
|
-
# A sample Guardfile
|
2
|
-
# More info at https://github.com/guard/guard#readme
|
3
|
-
|
4
|
-
guard 'rspec', version: 2 do
|
5
|
-
watch(%r{^spec/.+_spec\.rb$})
|
6
|
-
watch(%r{^lib/(.+)\.rb$}) { |m| "spec/lib/#{m[1]}_spec.rb" }
|
7
|
-
watch('spec/spec_helper.rb') { 'spec' }
|
8
|
-
|
9
|
-
# Rails example
|
10
|
-
watch(%r{^app/(.+)\.rb$}) { |m| "spec/#{m[1]}_spec.rb" }
|
11
|
-
watch(%r{^app/(.*)(\.erb|\.haml)$}) { |m| "spec/#{m[1]}#{m[2]}_spec.rb" }
|
12
|
-
watch(%r{^app/controllers/(.+)_(controller)\.rb$}) { |m| ["spec/routing/#{m[1]}_routing_spec.rb", "spec/#{m[2]}s/#{m[1]}_#{m[2]}_spec.rb", "spec/acceptance/#{m[1]}_spec.rb"] }
|
13
|
-
watch(%r{^spec/support/(.+)\.rb$}) { 'spec' }
|
14
|
-
watch('config/routes.rb') { 'spec/routing' }
|
15
|
-
watch('app/controllers/application_controller.rb') { 'spec/controllers' }
|
16
|
-
|
17
|
-
# Capybara request specs
|
18
|
-
watch(%r{^app/views/(.+)/.*\.(erb|haml)$}) { |m| "spec/requests/#{m[1]}_spec.rb" }
|
19
|
-
|
20
|
-
# Turnip features and steps
|
21
|
-
watch(%r{^spec/acceptance/(.+)\.feature$})
|
22
|
-
watch(%r{^spec/acceptance/steps/(.+)_steps\.rb$}) { |m| Dir[File.join("**/#{m[1]}.feature")][0] || 'spec/acceptance' }
|
23
|
-
end
|
data/Rakefile
DELETED
data/bin/proxy.rb
DELETED
data/examples/README.md
DELETED
@@ -1 +0,0 @@
|
|
1
|
-
See example specs in `spec/requests/examples`.
|
data/examples/facebook_api.html
DELETED
@@ -1,59 +0,0 @@
|
|
1
|
-
<div id="fb-root"></div>
|
2
|
-
<script>
|
3
|
-
// Load the SDK Asynchronously
|
4
|
-
(function(d){
|
5
|
-
var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
|
6
|
-
if (d.getElementById(id)) {return;}
|
7
|
-
js = d.createElement('script'); js.id = id; js.async = true;
|
8
|
-
js.src = "//connect.facebook.net/en_US/all.js";
|
9
|
-
ref.parentNode.insertBefore(js, ref);
|
10
|
-
}(document));
|
11
|
-
|
12
|
-
// Init the SDK upon load
|
13
|
-
window.fbAsyncInit = function() {
|
14
|
-
FB.init({
|
15
|
-
appId : '408416075843608', // App ID
|
16
|
-
//channelUrl : '//'+window.location.hostname+'/channel', // Path to your Channel File
|
17
|
-
status : true, // check login status
|
18
|
-
cookie : true, // enable cookies to allow the server to access the session
|
19
|
-
xfbml : true // parse XFBML
|
20
|
-
});
|
21
|
-
|
22
|
-
// listen for and handle auth.statusChange events
|
23
|
-
FB.Event.subscribe('auth.statusChange', function(response) {
|
24
|
-
if (response.authResponse) {
|
25
|
-
// user has auth'd your app and is logged into Facebook
|
26
|
-
FB.api('/me', function(me){
|
27
|
-
if (me.name) {
|
28
|
-
document.getElementById('auth-displayname').innerHTML = me.name;
|
29
|
-
}
|
30
|
-
})
|
31
|
-
document.getElementById('auth-loggedout').style.display = 'none';
|
32
|
-
document.getElementById('auth-loggedin').style.display = 'block';
|
33
|
-
} else {
|
34
|
-
// user has not auth'd your app, or is not logged into Facebook
|
35
|
-
document.getElementById('auth-loggedout').style.display = 'block';
|
36
|
-
document.getElementById('auth-loggedin').style.display = 'none';
|
37
|
-
}
|
38
|
-
});
|
39
|
-
|
40
|
-
// respond to clicks on the login and logout links
|
41
|
-
document.getElementById('auth-loginlink').addEventListener('click', function(){
|
42
|
-
FB.login();
|
43
|
-
});
|
44
|
-
document.getElementById('auth-logoutlink').addEventListener('click', function(){
|
45
|
-
FB.logout();
|
46
|
-
});
|
47
|
-
}
|
48
|
-
</script>
|
49
|
-
|
50
|
-
<h1>Facebook Client-side Authentication Example</h1>
|
51
|
-
<div id="auth-status">
|
52
|
-
<div id="auth-loggedout">
|
53
|
-
<a href="#" id="auth-loginlink">Login</a>
|
54
|
-
</div>
|
55
|
-
<div id="auth-loggedin" style="display:none">
|
56
|
-
Hi, <span id="auth-displayname"></span>
|
57
|
-
(<a href="#" id="auth-logoutlink">logout</a>)
|
58
|
-
</div>
|
59
|
-
</div>
|
@@ -1,10 +0,0 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<body>
|
3
|
-
<h1>Intercept request example</h1>
|
4
|
-
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.min.js'></script>
|
5
|
-
<script type='text/javascript'>
|
6
|
-
$(function () {
|
7
|
-
$.post('http://example.com/', { foo: 'bar' });
|
8
|
-
})
|
9
|
-
</script>
|
10
|
-
</body>
|
data/examples/post_api.html
DELETED
@@ -1,16 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<body>
|
3
|
-
<h1>POST to API</h1>
|
4
|
-
<div id="result"></div>
|
5
|
-
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.min.js'></script>
|
6
|
-
<script type='text/javascript'>
|
7
|
-
$(function () {
|
8
|
-
$.post('http://example.com/api', { foo: 'bar' }).done(function(data) {
|
9
|
-
$('#result').append('Success!');
|
10
|
-
})
|
11
|
-
.fail(function(data) {
|
12
|
-
$('#result').append('Fail!');
|
13
|
-
});
|
14
|
-
})
|
15
|
-
</script>
|
16
|
-
</body>
|
@@ -1,22 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<body>
|
3
|
-
<h1>Cross Domain Request</h1>
|
4
|
-
<div id="result"></div>
|
5
|
-
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.min.js'></script>
|
6
|
-
<script type='text/javascript'>
|
7
|
-
$(function () {
|
8
|
-
$.ajax(
|
9
|
-
{
|
10
|
-
url: 'http://example.com/api',
|
11
|
-
method: 'GET',
|
12
|
-
contentType: 'json' // setting this forces an OPTIONS request
|
13
|
-
}
|
14
|
-
).done(function(data) {
|
15
|
-
$('#result').append('Success!');
|
16
|
-
})
|
17
|
-
.fail(function(data) {
|
18
|
-
$('#result').append('Fail!');
|
19
|
-
});
|
20
|
-
})
|
21
|
-
</script>
|
22
|
-
</body>
|
data/examples/tumblr_api.html
DELETED
@@ -1,22 +0,0 @@
|
|
1
|
-
<!doctype html>
|
2
|
-
<body>
|
3
|
-
<h1>Latest news</h1>
|
4
|
-
<div id="news"></div>
|
5
|
-
|
6
|
-
<script type='text/javascript' src='http://code.jquery.com/jquery-1.8.2.min.js'></script>
|
7
|
-
<script type='text/javascript'>
|
8
|
-
$(function () {
|
9
|
-
var url = 'http://blog.howmanyleft.co.uk/api/read/json?callback=?&type=text&num=3&filter=text';
|
10
|
-
$.getJSON(url, function (data) {
|
11
|
-
$.each(data.posts, function (idx, post) {
|
12
|
-
var title = post['regular-title'];
|
13
|
-
var href = post['url-with-slug'];
|
14
|
-
var body = post['regular-body'];
|
15
|
-
$('#news').append(
|
16
|
-
'<h3><a href="' + href + '">' + title + '</a></h3>' +
|
17
|
-
'<p>' + body + '</p>');
|
18
|
-
});
|
19
|
-
});
|
20
|
-
})
|
21
|
-
</script>
|
22
|
-
</body>
|