Sha256: 6f04338f35d45fb162a0efdc76d3679655a0152c62bc13339705b86f7be36b8b

Contents?: true

Size: 885 Bytes

Versions: 6

Compression:

Stored size: 885 Bytes

Contents

# frozen_string_literal: true

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

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

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

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

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

    def error=(val)
      raise "Invalid value '#{val}' for error" unless %i[raise_report raise ignore].include? val

      @error = val
    rescue StandardError => error
      Webdrone.report_error(@a0, error)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
webdrone-1.18.2 lib/webdrone/conf.rb
webdrone-1.18.0 lib/webdrone/conf.rb
webdrone-1.16.2 lib/webdrone/conf.rb
webdrone-1.16.0 lib/webdrone/conf.rb
webdrone-1.14.0 lib/webdrone/conf.rb
webdrone-1.12.0 lib/webdrone/conf.rb