Module: Geordi::FirefoxForSelenium
- Extended by:
- Interaction
- Defined in:
- lib/geordi/firefox_for_selenium.rb
Defined Under Namespace
Classes: Installer
Constant Summary
collapse
- FIREFOX_FOR_SELENIUM_BASE_PATH =
Pathname.new('~/bin/firefoxes').expand_path
- FIREFOX_FOR_SELENIUM_PROFILE_NAME =
'firefox-for-selenium'
- FIREFOX_VERSION_FILE =
Pathname.new('.firefox-version')
Class Method Summary
collapse
announce, fail, note, note_cmd, prompt, strip_heredoc, success, warn
Class Method Details
.binary(version, name = "firefox") ⇒ Object
40
41
42
|
# File 'lib/geordi/firefox_for_selenium.rb', line 40
def self.binary(version, name = "firefox")
path(version).join(name)
end
|
.install(version) ⇒ Object
13
14
15
|
# File 'lib/geordi/firefox_for_selenium.rb', line 13
def self.install(version)
Installer.new(version).run
end
|
.path(version) ⇒ Object
36
37
38
|
# File 'lib/geordi/firefox_for_selenium.rb', line 36
def self.path(version)
FIREFOX_FOR_SELENIUM_BASE_PATH.join(version)
end
|
.path_from_config ⇒ Object
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
|
# File 'lib/geordi/firefox_for_selenium.rb', line 17
def self.path_from_config
version = FIREFOX_VERSION_FILE.exist? && File.read(FIREFOX_VERSION_FILE).strip
if version and version != 'system'
unless FirefoxForSelenium.binary(version).exist?
warn "Firefox #{ version } not found"
note strip_heredoc(" Install it with\n geordi firefox --setup \#{ version }\n INSTRUCTIONS\n\n prompt 'Run tests anyway?', 'n', /y|yes/ or fail 'Cancelled.'\n end\n\n path(version)\n end\nend\n")
|
.setup_firefox ⇒ Object
44
45
46
47
48
49
50
51
|
# File 'lib/geordi/firefox_for_selenium.rb', line 44
def self.setup_firefox
path = path_from_config
if path
ENV['PATH'] = "#{path}:#{ENV['PATH']}"
note 'Firefox for Selenium set up'
end
end
|