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

Instance Method Details

#random_chrome_build_numberString

Returns a random Chrome build number.

Returns:

  • (String)

    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_versionString

Returns a random Chrome version string.

Returns:

  • (String)

    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_versionString

Returns a random IE version string.

Returns:

  • (String)

    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_versionString

Returns a random Opera version number.

Returns:

  • (String)

    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_versionString

Returns a random Presto version string.

Returns:

  • (String)

    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_version2String

Returns a random second part Presto version string.

Returns:

  • (String)

    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_numberString

Returns a random Safari build number.

Returns:

  • (String)

    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_versionString

Returns a random Safari version number.

Returns:

  • (String)

    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_versionString

Returns a random Trident version string.

Returns:

  • (String)

    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