module Installer
Browser installation and management for automated testing.
Each browser has its own sub-module with browser-specific platform detection, version resolution, and download logic:
module Async::WebDriver::Installer::Chrome— Chrome for Testing, via the Chrome for Testing JSON API.
Nested
Definitions
def self.cache_path(subdirectory = nil, env = ENV)
Resolve the cache path for the given sub-directory.
Follows the XDG Base Directory Specification, using $XDG_CACHE_HOME
(default: ~/.cache) as the root, with async-webdriver.rb as the
application directory.
Signature
-
parameter
subdirectoryString | Nil Optional sub-directory, e.g.
"chrome".-
parameter
envHash Environment to read
XDG_CACHE_HOMEfrom. Default:ENV.-
returns
String Absolute path.
Implementation
def self.cache_path(subdirectory = nil, env = ENV)
path = File.expand_path("async-webdriver.rb", env.fetch("XDG_CACHE_HOME", "~/.cache"))
if subdirectory
path = File.join(path, subdirectory)
end
return path
end