capybara-thruster 0.1.0 → 0.1.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 +5 -0
- data/README.md +13 -1
- data/lib/capybara/dependency_checker.rb +30 -0
- data/lib/capybara/thruster/version.rb +1 -1
- data/lib/capybara/thruster.rb +4 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb193e41ea232704ba2ae902a1dcb1ce3986503d1cbe4a0032bc0749af052ca0
|
4
|
+
data.tar.gz: d42cad741af90cc72b10c2cad6e715b1494edb52ea533ae2f6b66bbbc1f9b99e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 931611098086ebf60db3ac10085e2b0af922af17b8513c5a0a2c431f176e585588f94a76b32830b523940b6f9fa707aa2a7f7a89f3871db3625e1825328cf28e
|
7
|
+
data.tar.gz: 3d6edd5a360dbfcbc3652b4deb18f79cb90b3e1f9c4fbd7f71ccc0a80eec6da274921296ddf4e459a2abf1e95e03959b53e9225c3c8d43b2117239536af46bfd
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -5,11 +5,23 @@
|
|
5
5
|
|
6
6
|
This gem makes it possible to use [Thruster][] as a Capybara server. Run your browser test with HTTP/2 enabled and static assets served via Thruster for faster load times!
|
7
7
|
|
8
|
-
> [TIP
|
8
|
+
> [!TIP]
|
9
9
|
> Using AnyCable? This gem works with [AnyCable-d Thruster][anycable-thruster], so you can run your system tests against a real AnyCable server with all its features!
|
10
10
|
|
11
11
|
## Getting started
|
12
12
|
|
13
|
+
### Prerequisites
|
14
|
+
|
15
|
+
Before adding the gem to your project, ensure you have either `thruster` or `anycable-thruster` installed. You can add one of these gems to your `Gemfile`:
|
16
|
+
|
17
|
+
```ruby
|
18
|
+
# For thruster
|
19
|
+
gem "thruster"
|
20
|
+
|
21
|
+
# or for anycable-thruster
|
22
|
+
gem "anycable-thruster"
|
23
|
+
```
|
24
|
+
|
13
25
|
Adding the gem to your project:
|
14
26
|
|
15
27
|
```ruby
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Capybara
|
4
|
+
module Thruster
|
5
|
+
class DependencyChecker
|
6
|
+
def self.call
|
7
|
+
new.call
|
8
|
+
end
|
9
|
+
|
10
|
+
def call
|
11
|
+
unless thruster_installed?
|
12
|
+
warn "*********************************************************"
|
13
|
+
warn "Warning: capybara-thruster requires either 'thruster' or 'anycable-thruster' gem."
|
14
|
+
warn "Please install one of them to ensure proper functionality."
|
15
|
+
warn "*********************************************************"
|
16
|
+
end
|
17
|
+
end
|
18
|
+
|
19
|
+
private
|
20
|
+
|
21
|
+
def thruster_installed?
|
22
|
+
gem_installed?("thruster") || gem_installed?("anycable-thruster")
|
23
|
+
end
|
24
|
+
|
25
|
+
def gem_installed?(name)
|
26
|
+
Gem::Specification.find_all_by_name(name).any?
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
data/lib/capybara/thruster.rb
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
|
3
3
|
require "childprocess"
|
4
4
|
require "capybara"
|
5
|
+
require "capybara/dependency_checker"
|
6
|
+
require "rack/handler"
|
7
|
+
|
8
|
+
Capybara::Thruster::DependencyChecker.call
|
5
9
|
|
6
10
|
# Replaces the default Puma server on CAPYBARA_SERVER_PORT port with Thruster server.
|
7
11
|
# Requests are proxied to the Puma server running on the internal port (CAPYBARA_SERVER_PORT + 1).
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: capybara-thruster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Vladimir Dementyev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: capybara
|
@@ -133,6 +133,7 @@ files:
|
|
133
133
|
- LICENSE.txt
|
134
134
|
- README.md
|
135
135
|
- lib/capybara-thruster.rb
|
136
|
+
- lib/capybara/dependency_checker.rb
|
136
137
|
- lib/capybara/thruster.rb
|
137
138
|
- lib/capybara/thruster/version.rb
|
138
139
|
homepage: https://github.com/evilmartians/capybara-thruster
|