Sha256: 34c6ec0600ae082374453e537edc1f08554609debc109126b65e746df25fd22f

Contents?: true

Size: 876 Bytes

Versions: 2

Compression:

Stored size: 876 Bytes

Contents

module Watir
  include Watir::Exception

# Directory containing the watir.rb file
  @@dir = File.expand_path(File.dirname(__FILE__))

# Like regular Ruby "until", except that a TimeOutException is raised
# if the timeout is exceeded. Timeout is IE.attach_timeout.
  def self.until_with_timeout # block
    Wait.until(IE.attach_timeout) { yield }
  end

  @@autoit = nil

  def self.autoit
    unless @@autoit
      begin
        @@autoit = WIN32OLE.new('AutoItX3.Control')
      rescue WIN32OLERuntimeError
        _register('AutoItX3.dll')
        @@autoit = WIN32OLE.new('AutoItX3.Control')
      end
    end
    @@autoit
  end

  def self._register(dll)
    system("regsvr32.exe /s "    + "#{@@dir}/#{dll}".gsub('/', '\\'))
  end

  def self._unregister(dll)
    system("regsvr32.exe /s /u " + "#{@@dir}/#{dll}".gsub('/', '\\'))
  end

end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
watir-1.6.7 lib/watir/module.rb
watir-1.6.7.rc1 lib/watir/module.rb