Class: Venetian::Upstream::PlatformInfo

Inherits:
Data
  • Object
show all
Defined in:
lib/venetian/upstream.rb

Overview

Describes how to assemble the Playwright driver for a single gem platform.

node_dir

the platform infix used in Node.js release archive names (e.g. "linux-x64")

windows

whether this platform's Node.js archive is a Windows build (.zip, node.exe)

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#node_dirObject (readonly)

Returns the value of attribute node_dir

Returns:

  • (Object)

    the current value of node_dir



14
15
16
# File 'lib/venetian/upstream.rb', line 14

def node_dir
  @node_dir
end

#windowsObject (readonly)

Returns the value of attribute windows

Returns:

  • (Object)

    the current value of windows



14
15
16
# File 'lib/venetian/upstream.rb', line 14

def windows
  @windows
end

Instance Method Details

#executable_nameObject

Returns the filename of the Node executable inside the assembled driver.



16
17
18
# File 'lib/venetian/upstream.rb', line 16

def executable_name
  windows ? "node.exe" : "node"
end

#node_archive_extensionObject

Returns the file extension of the Node.js release archive for this platform.



21
22
23
# File 'lib/venetian/upstream.rb', line 21

def node_archive_extension
  windows ? "zip" : "tar.gz"
end

#node_url_for(version) ⇒ Object

Returns the URL to download the Node.js release archive for the given version.



26
27
28
# File 'lib/venetian/upstream.rb', line 26

def node_url_for(version)
  "#{NODE_DIST_URL}/v#{version}/node-v#{version}-#{node_dir}.#{node_archive_extension}"
end