Class: Minibidi::Firefox

Inherits:
Object
  • Object
show all
Defined in:
lib/minibidi/firefox_launcher.rb

Class Method Summary collapse

Class Method Details

.discover_binaryObject

Raises:



14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/minibidi/firefox_launcher.rb', line 14

def self.discover_binary
  # check if macOS
  if RUBY_PLATFORM =~ /darwin/
    if File.exist?("/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox")
      return "/Applications/Firefox Developer Edition.app/Contents/MacOS/firefox"
    end
  elsif RUBY_PLATFORM =~ /linux/
    if File.exist?("/usr/bin/firefox-devedition")
      return "/usr/bin/firefox-devedition"
    end
  end

  raise LaunchError, 'Firefox Developer Edition is not found. Please install it from https://www.mozilla.org/firefox/developer/'
end

.launch(&block) ⇒ Object



10
11
12
# File 'lib/minibidi/firefox_launcher.rb', line 10

def self.launch(&block)
  FirefoxLauncher.new.launch(&block)
end