Module: Wpxf::Versioning::BrowserVersions
- Included in:
- Net::UserAgent
- Defined in:
- lib/wpxf/versioning/browser_versions.rb
Overview
Provides functionality for generating random browser versions.
Instance Method Summary collapse
-
#random_chrome_build_number ⇒ String
A random Chrome build number.
-
#random_chrome_version ⇒ String
A random Chrome version string.
-
#random_ie_version ⇒ String
A random IE version string.
-
#random_opera_version ⇒ String
A random Opera version number.
-
#random_presto_version ⇒ String
A random Presto version string.
-
#random_presto_version2 ⇒ String
A random second part Presto version string.
-
#random_safari_build_number ⇒ String
A random Safari build number.
-
#random_safari_version ⇒ String
A random Safari version number.
-
#random_trident_version ⇒ String
A random Trident version string.
Instance Method Details
#random_chrome_build_number ⇒ String
Returns a random Chrome build number.
46 47 48 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 46 def random_chrome_build_number "#{rand(531..536)}.#{rand(0..2)}" end |
#random_chrome_version ⇒ String
Returns a random Chrome version string.
18 19 20 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 18 def random_chrome_version "#{rand(13..15)}.0.#{rand(800..899)}.0" end |
#random_ie_version ⇒ String
Returns a random IE version string.
8 9 10 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 8 def random_ie_version "#{rand(7..9)}.0" end |
#random_opera_version ⇒ String
Returns a random Opera version number.
51 52 53 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 51 def random_opera_version "#{rand(8..9)}.#{rand(10..99)}" end |
#random_presto_version ⇒ String
Returns a random Presto version string.
23 24 25 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 23 def random_presto_version "2.9.#{rand(160..190)}" end |
#random_presto_version2 ⇒ String
Returns a random second part Presto version string.
28 29 30 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 28 def random_presto_version2 "#{rand(10..12)}.00" end |
#random_safari_build_number ⇒ String
Returns a random Safari build number.
33 34 35 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 33 def random_safari_build_number "#{rand(531..535)}.#{rand(1..50)}.#{rand(1..7)}" end |
#random_safari_version ⇒ String
Returns a random Safari version number.
38 39 40 41 42 43 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 38 def random_safari_version [ "#{rand(4..5)}.#{rand(0..1)}", "#{rand(4..5)}.0.#{rand(1..5)}" ].sample end |
#random_trident_version ⇒ String
Returns a random Trident version string.
13 14 15 |
# File 'lib/wpxf/versioning/browser_versions.rb', line 13 def random_trident_version "#{rand(3..5)}.#{rand(0..1)}" end |