Module: SeleniumSurfer
- Defined in:
- lib/selenium_surfer.rb,
lib/selenium_surfer/robot.rb,
lib/selenium_surfer/errors.rb,
lib/selenium_surfer/version.rb,
lib/selenium_surfer/surf_context.rb,
lib/selenium_surfer/driver_bucket.rb,
lib/selenium_surfer/search_context.rb
Defined Under Namespace
Classes: ConfigurationError, ContextError, DriverBucket, EmptySetError, Robot, SearchContext, SetupError, SurfContext, UnboundContextError, WebDriverError
Constant Summary collapse
- VERSION =
"0.1.3"- @@config =
Configuration defaults
{ :webdriver => nil, :remote_host => 'http://localhost:8080', :remote_timeout => 120, :window_width => 1500, :window_height => 1000 }
Class Method Summary collapse
- .config ⇒ Object
-
.configure(_opts = {}) ⇒ Object
Configure through hash.
-
.configure_with(_path_to_yaml_file) ⇒ Object
Configure through yaml file.
Class Method Details
.config ⇒ Object
37 38 39 |
# File 'lib/selenium_surfer.rb', line 37 def self.config @@config end |
.configure(_opts = {}) ⇒ Object
Configure through hash
20 21 22 |
# File 'lib/selenium_surfer.rb', line 20 def self.configure(_opts = {}) _opts.each { |k,v| @@config[k.to_sym] = v if @@config.has_key? k.to_sym } end |
.configure_with(_path_to_yaml_file) ⇒ Object
Configure through yaml file
25 26 27 28 29 30 31 32 33 34 35 |
# File 'lib/selenium_surfer.rb', line 25 def self.configure_with(_path_to_yaml_file) begin config = YAML::load(IO.read(_path_to_yaml_file)) rescue Errno::ENOENT log(:warning, "YAML configuration file couldn't be found. Using defaults."); return rescue Psych::SyntaxError log(:warning, "YAML configuration file contains invalid syntax. Using defaults."); return end configure(config) end |