Sha256: 76de53d8d671f0280613462ecfa6c07e14c1abe1447815e2fe2bf6e738b41787

Contents?: true

Size: 814 Bytes

Versions: 16

Compression:

Stored size: 814 Bytes

Contents

module Webdrone
  class Browser
    def conf
      @conf ||= Conf.new self
    end
  end

  class Conf
    attr_accessor :a0, :timeout, :outdir, :error, :developer, :logger

    def initialize(a0)
      @a0 = a0
      @outdir = "."
      @error = :raise_report
    end

    def timeout=(val)
      @timeout = val
      @a0.driver.manage.timeouts.implicit_wait = val
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end

    def outdir=(val)
      @outdir = val
      FileUtils.mkdir_p val
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end

    def error=(val)
      raise "Invalid value '#{val}' for error" if not [:raise_report, :raise, :ignore].include? val
      @error = val
    rescue => exception
      Webdrone.report_error(@a0, exception)
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
webdrone-1.7.8 lib/webdrone/conf.rb
webdrone-1.7.4 lib/webdrone/conf.rb
webdrone-1.7.2 lib/webdrone/conf.rb
webdrone-1.7.0 lib/webdrone/conf.rb
webdrone-1.6.2 lib/webdrone/conf.rb
webdrone-1.6.0 lib/webdrone/conf.rb
webdrone-1.5.0 lib/webdrone/conf.rb
webdrone-1.4.8 lib/webdrone/conf.rb
webdrone-1.4.6 lib/webdrone/conf.rb
webdrone-1.4.4 lib/webdrone/conf.rb
webdrone-1.4.2 lib/webdrone/conf.rb
webdrone-1.4.0 lib/webdrone/conf.rb
webdrone-1.3.6 lib/webdrone/conf.rb
webdrone-1.3.4 lib/webdrone/conf.rb
webdrone-1.3.2 lib/webdrone/conf.rb
webdrone-1.3.0 lib/webdrone/conf.rb