module Sauce
Constants
- MAJOR_VERSION
- PATCH_VERSION
- Selenium_browsers
- Selenium_host
- Selenium_port
- Selenium_url
Local Configuration
Attributes
webdriver_method[RW]
Public Class Methods
clear_config()
click to toggle source
# File lib/sauce/config.rb, line 16 def self.clear_config @cfg = nil end
config() { |get_config| ... }
click to toggle source
# File lib/sauce/config.rb, line 7 def self.config yield get_config end
driver_pool()
click to toggle source
# File lib/sauce/driver_pool.rb, line 2 def self.driver_pool @@driver_pool ||= {} end
get_config(default = false)
click to toggle source
# File lib/sauce/config.rb, line 11 def self.get_config(default = false) get_default = default == :default ? {} : false @cfg ||= Sauce::Config.new(get_default) end
logger()
click to toggle source
Returns the set logger or, if none is set, a default logger
# File lib/sauce/logging.rb, line 9 def self.logger @logger ||= default_logger end
logger=(logger)
click to toggle source
# File lib/sauce/logging.rb, line 4 def self.logger=(logger) @logger = logger end
version()
click to toggle source
# File lib/sauce/version.rb, line 5 def version "#{MAJOR_VERSION}.#{PATCH_VERSION}" end
Private Class Methods
default_logger()
click to toggle source
Creates a default logger when the user hasn't set one. Default logger with be STDOUT unless the `SAUCE_LOGFILE` environment var has been set, in which case that file will be appended to, until it is 10240 bytes, when it will be rotated. This will happen 10 times.
The default logging level is WARN, but can be set with the environment var SAUCE_LOGLEVEL
# File lib/sauce/logging.rb, line 22 def self.default_logger log = ::Logger.new(*default_logger_arguments) log.level = default_logging_level return log end
default_logger_arguments()
click to toggle source
# File lib/sauce/logging.rb, line 28 def self.default_logger_arguments logfile = ENV["SAUCE_LOGFILE"] if logfile unless ENV["TEST_ENV_NUMBER"].nil? logfile = "#{logfile}#{ENV["TEST_ENV_NUMBER"]}" end log = File.open logfile, File::WRONLY | File::APPEND | File::CREAT return [log, 10, 10240] else return [STDOUT] end end
default_logging_level()
click to toggle source
# File lib/sauce/logging.rb, line 43 def self.default_logging_level case ENV.fetch("SAUCE_LOGLEVEL", "").downcase when 'error' Logger::ERROR when 'warn' Logger::WARN when 'info' Logger::INFO when 'debug' Logger::DEBUG else Logger::WARN end end
Private Instance Methods
version()
click to toggle source
# File lib/sauce/version.rb, line 5 def version "#{MAJOR_VERSION}.#{PATCH_VERSION}" end