venetian 0.2.1 → 0.2.2
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/README.md +1 -1
- data/lib/venetian/executable.rb +6 -2
- data/lib/venetian/upstream.rb +35 -18
- data/lib/venetian/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 3ee00e1fcd1d1b3976326488aa3eaa280ef4f90d12df08f19dace106544caa9c
|
|
4
|
+
data.tar.gz: 424a96d951611a582d5308f8039757c5924eaf5d35bc9afa4b66ba4552285e09
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 01ccabe77ade214053540011f0c57c13fde15ccd65417f932d10e0901d91f72ab38a48dcc73891eb4efb3cd7e7c877bd3e5787b84bd38cd677b42d13df989ecc
|
|
7
|
+
data.tar.gz: 332c96c6d356616a18f6c4ecb599bb18fa370ecd4038311052fd8a406f740cba29aac82d4376a0fd400bda460ee5906d34edf9dd565bf10e782e99d7b67420dc
|
data/README.md
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Venetian
|
|
2
2
|
|
|
3
3
|
Want stable system tests with Playwright, but don't want a Heath Robinson/Rube Goldberg setup in CI to try to keep the Ruby gem and Node
|
|
4
|
-
package in sync? This gem packages a Node executable plus the common Playwright package,
|
|
4
|
+
package in sync? This gem packages a Node executable plus the common Playwright package, in the same way Playwright is packaged for other
|
|
5
5
|
languages.
|
|
6
6
|
|
|
7
7
|
## Installation
|
data/lib/venetian/executable.rb
CHANGED
|
@@ -143,12 +143,16 @@ module Venetian
|
|
|
143
143
|
return custom_exe_path if ENV.key?(INSTALL_DIR_ENV_VAR)
|
|
144
144
|
|
|
145
145
|
Upstream::NATIVE_PLATFORMS.select { |platform, _| Gem::Platform.match_gem?(Gem::Platform.new(platform), gem_name) }
|
|
146
|
-
.collect { |platform,
|
|
146
|
+
.collect { |platform, info| File.join(exe_dir, platform, info.executable_name) }
|
|
147
147
|
.detect { |candidate| File.exist?(candidate) }
|
|
148
148
|
end
|
|
149
149
|
|
|
150
150
|
def custom_exe_path
|
|
151
|
-
File.join(exe_dir,
|
|
151
|
+
File.join(exe_dir, custom_exe_name).then { |path| path if File.exist?(path) }
|
|
152
|
+
end
|
|
153
|
+
|
|
154
|
+
def custom_exe_name
|
|
155
|
+
Gem.win_platform? ? "node.exe" : "node"
|
|
152
156
|
end
|
|
153
157
|
|
|
154
158
|
def gem_platforms_unsupported?
|
data/lib/venetian/upstream.rb
CHANGED
|
@@ -7,26 +7,43 @@ module Venetian
|
|
|
7
7
|
#
|
|
8
8
|
# Provides platform mappings and URLs for Playwright.
|
|
9
9
|
module Upstream
|
|
10
|
-
#
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
10
|
+
# Describes how to assemble the Playwright driver for a single gem platform.
|
|
11
|
+
#
|
|
12
|
+
# +node_dir+:: the platform infix used in Node.js release archive names (e.g. "linux-x64")
|
|
13
|
+
# +windows+:: whether this platform's Node.js archive is a Windows build (.zip, node.exe)
|
|
14
|
+
PlatformInfo = Data.define(:node_dir, :windows) do
|
|
15
|
+
# Returns the filename of the Node executable inside the assembled driver.
|
|
16
|
+
def executable_name
|
|
17
|
+
windows ? "node.exe" : "node"
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
# Returns the file extension of the Node.js release archive for this platform.
|
|
21
|
+
def node_archive_extension
|
|
22
|
+
windows ? "zip" : "tar.gz"
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
# Returns the URL to download the Node.js release archive for the given version.
|
|
26
|
+
def node_url_for(version)
|
|
27
|
+
"#{NODE_DIST_URL}/v#{version}/node-v#{version}-#{node_dir}.#{node_archive_extension}"
|
|
28
|
+
end
|
|
25
29
|
end
|
|
26
30
|
|
|
27
|
-
#
|
|
28
|
-
|
|
29
|
-
|
|
31
|
+
# map of gem platform strings to Node.js release info
|
|
32
|
+
NATIVE_PLATFORMS = { "x86_64-linux" => PlatformInfo.new(node_dir: "linux-x64", windows: false),
|
|
33
|
+
"aarch64-linux" => PlatformInfo.new(node_dir: "linux-arm64", windows: false),
|
|
34
|
+
"x86_64-darwin" => PlatformInfo.new(node_dir: "darwin-x64", windows: false),
|
|
35
|
+
"arm64-darwin" => PlatformInfo.new(node_dir: "darwin-arm64", windows: false),
|
|
36
|
+
"x64-mingw-ucrt" => PlatformInfo.new(node_dir: "win-x64", windows: true) }.freeze
|
|
37
|
+
|
|
38
|
+
# base for the npm registry, source of the playwright-core package
|
|
39
|
+
NPM_REGISTRY_URL = "https://registry.npmjs.org"
|
|
40
|
+
|
|
41
|
+
# base for Node.js release downloads
|
|
42
|
+
NODE_DIST_URL = "https://nodejs.org/dist"
|
|
43
|
+
|
|
44
|
+
# Returns the URL to download the playwright-core npm package containing the driver's JS sources.
|
|
45
|
+
def self.playwright_core_url
|
|
46
|
+
"#{NPM_REGISTRY_URL}/playwright-core/-/playwright-core-#{Playwright::COMPATIBLE_PLAYWRIGHT_VERSION}.tgz"
|
|
30
47
|
end
|
|
31
48
|
|
|
32
49
|
# Returns the gemspec files for the base gem.
|
data/lib/venetian/version.rb
CHANGED