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

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

Constant Summary collapse

EM_NAMESPACE_URI =

not used?

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

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Extension

Returns a new instance of Extension.



9
10
11
12
13
14
15
# File 'lib/selenium/webdriver/firefox/extension.rb', line 9

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

  @path = path
end

Instance Method Details

#write_to(extensions_dir) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/selenium/webdriver/firefox/extension.rb', line 17

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

  FileUtils.rm_rf ext_path
  FileUtils.mkdir_p File.dirname(ext_path), :mode => 0700
  FileUtils.cp_r root, ext_path
end