lib/browser/platform.rb in browser-2.1.0 vs lib/browser/platform.rb in browser-2.2.0

- old
+ new

@@ -1,6 +1,20 @@ # frozen_string_literal: true +require "browser/platform/base" +require "browser/platform/ios" +require "browser/platform/linux" +require "browser/platform/windows" +require "browser/platform/mac" +require "browser/platform/windows_phone" +require "browser/platform/windows_mobile" +require "browser/platform/firefox_os" +require "browser/platform/blackberry" +require "browser/platform/android" +require "browser/platform/other" +require "browser/platform/chrome_os" +require "browser/platform/adobe_air" + module Browser class Platform include DetectVersion attr_reader :ua @@ -52,15 +66,15 @@ def linux? id == :linux end - def mac? - id == :mac + def mac?(expected_version = nil) + id == :mac && detect_version?(version, expected_version) end - def windows? - id == :windows + def windows?(expected_version = nil) + id == :windows && detect_version?(version, expected_version) end def firefox_os? id == :firefox_os end