Module: Venetian::Upstream

Defined in:
lib/venetian/upstream.rb

Overview

Upstream

Provides platform mappings and URLs for Playwright.

Defined Under Namespace

Classes: PlatformInfo

Constant Summary collapse

NATIVE_PLATFORMS =

map of gem platform strings to Node.js release info

{ "x86_64-linux" => PlatformInfo.new(node_dir: "linux-x64", windows: false),
"aarch64-linux" => PlatformInfo.new(node_dir: "linux-arm64", windows: false),
"x86_64-darwin" => PlatformInfo.new(node_dir: "darwin-x64", windows: false),
"arm64-darwin" => PlatformInfo.new(node_dir: "darwin-arm64", windows: false),
"x64-mingw-ucrt" => PlatformInfo.new(node_dir: "win-x64", windows: true) }.freeze
NPM_REGISTRY_URL =

base for the npm registry, source of the playwright-core package

"https://registry.npmjs.org"
NODE_DIST_URL =

base for Node.js release downloads

"https://nodejs.org/dist"

Class Method Summary collapse

Class Method Details

.base_filesObject

Returns the gemspec files for the base gem.



50
51
52
# File 'lib/venetian/upstream.rb', line 50

def self.base_files
  GEMSPEC.files
end

.build_gemspec_for(platform) ⇒ Object

Builds a gemspec for the given platform, adding the files currently in the native platform directory.



55
56
57
58
59
60
# File 'lib/venetian/upstream.rb', line 55

def self.build_gemspec_for(platform)
  GEMSPEC.dup.tap do |s|
    s.platform = platform
    s.files += Dir["exe/#{platform}/**/*"]
  end
end

.playwright_core_urlObject

Returns the URL to download the playwright-core npm package containing the driver's JS sources.



45
46
47
# File 'lib/venetian/upstream.rb', line 45

def self.playwright_core_url
  "#{NPM_REGISTRY_URL}/playwright-core/-/playwright-core-#{Playwright::COMPATIBLE_PLAYWRIGHT_VERSION}.tgz"
end