Sha256: b0369be05c460d0dbb69e393c1a7e9a334e51002687f5716e96483aeb8d99052

Contents?: true

Size: 1005 Bytes

Versions: 3

Compression:

Stored size: 1005 Bytes

Contents

require 'nokogiri'
require 'open-uri'

module Webdrivers
  class MSWebdriver < Common
    class << self

      def current
        version = %x(ver)
        version[/\d+\.\d+\.\d+/][/[^\.]\d+$/]
      end

      def latest
        # unknown; have to always download
      end

      private

      def normalize(string)
        string.match(/(\d+)\.(\d+\.\d+)/).to_a.map {|v| v.tr('.', '') }[1..-1].join('.').to_f
      end

      def file_name
        "MicrosoftWebDriver.exe"
      end

      def download_url(_version = nil)
        raise StandardError, "Can not reach site" unless site_available?

        if current.to_i >= 16257
          'https://download.microsoft.com/download/1/4/1/14156DA0-D40F-460A-B14D-1B264CA081A5/MicrosoftWebDriver.exe'
        else
          'https://download.microsoft.com/download/3/2/D/32D3E464-F2EF-490F-841B-05D53C848D15/MicrosoftWebDriver.exe'
        end
      end

      def base_url
        'https://www.microsoft.com/en-us/download'
      end

    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webdrivers-3.0.1 lib/webdrivers/mswebdriver.rb
webdrivers-3.0.0 lib/webdrivers/mswebdriver.rb
webdrivers-3.0.0.beta3 lib/webdrivers/mswebdriver.rb