Class: Selenium::WebDriver::Firefox::Extension Private

Inherits:
Object
  • Object
show all
Defined in:
lib/selenium/webdriver/firefox/extension.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Constant Summary collapse

NAMESPACE =

This constant is part of a private API. You should avoid using this constant if possible, as it may be removed or be changed in the future.

API:

  • private

'http://www.mozilla.org/2004/em-rdf#'.freeze

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Extension

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of Extension.

API:

  • private



30
31
32
33
34
35
36
37
# File 'lib/selenium/webdriver/firefox/extension.rb', line 30

def initialize(path)
  unless File.exist?(path)
    raise Error::WebDriverError, "could not find extension at #{path.inspect}"
  end

  @path             = path
  @should_reap_root = false
end

Instance Method Details

#write_to(extensions_dir) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



39
40
41
42
43
44
45
46
47
48
# File 'lib/selenium/webdriver/firefox/extension.rb', line 39

def write_to(extensions_dir)
  root_dir = create_root
  ext_path = File.join extensions_dir, read_id_from_install_rdf(root_dir)

  FileUtils.rm_rf ext_path
  FileUtils.mkdir_p File.dirname(ext_path), mode: 0700
  FileUtils.cp_r root_dir, ext_path

  FileReaper.reap(root_dir) if @should_reap_root
end