Module: Gless
- Defined in:
- lib/gless.rb,
lib/gless/config.rb,
lib/gless/logger.rb,
lib/gless/browser.rb,
lib/gless/session.rb,
lib/gless/base_page.rb,
lib/gless/wrap_watir.rb
Overview
The Gless module itself only defines a setup method; all the meat is in the other classes, especially Session. See the README for a general overview; it lives at github.com/rlpowell/gless , which is also the home of this project.
Defined Under Namespace
Classes: BasePage, Browser, EnvConfig, Logger, Session, WrapWatir
Constant Summary collapse
- VERSION =
The current version number.
'3.0.0'
Class Method Summary collapse
-
.setup(hash = nil) {|config| ... } ⇒ Gless::Logger, ...
Sets up the config, logger and browser instances, the ordering of which is slightly tricky.
Class Method Details
.setup(hash = nil) {|config| ... } ⇒ Gless::Logger, ...
Sets up the config, logger and browser instances, the ordering of which is slightly tricky. If a block is given, the config, after being initialized from the config file, is passed to the block, which should return the new, updated config.
present, this hash is used intead of reading a config file; the config file is totally ignored in this case.
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
# File 'lib/gless.rb', line 24 def self.setup( hash = nil ) # Create the config reading/storage object config = Gless::EnvConfig.new( hash ) config = yield config if block_given? logger = Gless::Logger.new( config.get_default( "notag", :global, :tag ), config.get_default( false, :global, :replay ), config.get_default( '%{home}/public_html/watir_replay/%{tag}', :global, :replay_path ) ) # Get the whole backtrace, please. if config.get :global, :debug ::Cucumber.use_full_backtrace = true ::RSpec.configure do |config| # RSpec automatically cleans stuff out of backtraces; # sometimes this is annoying when trying to debug something e.g. a gem config.backtrace_exclusion_patterns = [] end end # Turn on verbose (info) level logging. if config.get :global, :verbose logger.normal_log.level = ::Logger::INFO if logger.replay_log logger.replay_log.level = ::Logger::INFO end logger.debug "Verbose/info level logging enabled." end # Turn on debug level logging. if config.get :global, :debug logger.normal_log.level = ::Logger::DEBUG if logger.replay_log logger.replay_log.level = ::Logger::DEBUG end logger.debug "Debug level logging enabled." end # Create the browser. browser = Gless::Browser.new( config, logger ) browser..clear return logger, config, browser end |