Sha256: bdb490594fed65f05aea626c8ed7cc8b3febd07e23e82a4cdd9e427b1f6058ba
Contents?: true
Size: 626 Bytes
Versions: 15
Compression:
Stored size: 626 Bytes
Contents
# frozen_string_literal: true module Browser module DetectVersion private def detect_version?(actual_version, expected_version) return true unless expected_version return false if expected_version && !actual_version expected_version = parse_version(expected_version) actual_version = parse_version(actual_version) Gem::Requirement.create(expected_version) .satisfied_by?(Gem::Version.create(actual_version)) rescue ArgumentError false end private def parse_version(version) version.is_a?(Numeric) ? version.to_s : version end end end
Version data entries
15 entries across 15 versions & 1 rubygems