Module: Selenium::WebDriver::ProfileHelper Private
Do not use. This module is for internal use only.
Relationships & Source Files | |
Namespace Children | |
Modules:
| |
Extension / Inclusion / Inheritance Descendants | |
Included In:
| |
Defined in: | rb/lib/selenium/webdriver/common/profile_helper.rb |
Overview
Common methods for Chrome::Profile
and Firefox::Profile
Includers must implement #layout_on_disk
Class Method Summary
- .decoded(json) Internal use only
- .included(base) Internal use only
Instance Method Summary
- #as_json Internal use only
- #encoded Internal use only
- #to_json Internal use only
- #create_tmp_copy(directory) private Internal use only
- #verify_model(model) private Internal use only
Class Method Details
.decoded(json)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 34
def self.decoded(json) JSON.parse(json).fetch('zip') end
.included(base)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 30
def self.included(base) base.extend ClassMethods end
Instance Method Details
#as_json
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 42
def as_json(*) {'zip' => encoded} end
#create_tmp_copy(directory) (private)
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 52
def create_tmp_copy(directory) tmp_directory = Dir.mktmpdir('webdriver-rb-profilecopy') # TODO: must be a better way.. FileUtils.rm_rf tmp_directory FileUtils.mkdir_p File.dirname(tmp_directory), mode: 0o700 FileUtils.cp_r directory, tmp_directory tmp_directory end
#encoded
[ GitHub ]#to_json
[ GitHub ]# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 46
def to_json(*) JSON.generate as_json end
#verify_model(model) (private)
# File 'rb/lib/selenium/webdriver/common/profile_helper.rb', line 63
def verify_model(model) return unless model raise Errno::ENOENT, model unless File.exist?(model) raise Errno::ENOTDIR, model unless File.directory?(model) model end