Async::WebDriverSourceAsyncWebDriverInstaller

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:

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 subdirectory String | Nil

Optional sub-directory, e.g. "chrome".

parameter env Hash

Environment to read XDG_CACHE_HOME from. 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