@@ -8,7 +8,7 @@ module Filters
88 # Check the browser type value - for example, 'FF'
99 # @param [String] str String for testing
1010 # @return [Boolean] If the string has valid browser name characters
11- def self . is_valid_browsername? ( str )
11+ def self . is_valid_browsername? ( str ) # rubocop:disable Naming/PredicatePrefix
1212 return false unless is_non_empty_string? ( str )
1313 return false if str . length > 2
1414 return false if has_non_printable_char? ( str )
@@ -19,7 +19,7 @@ def self.is_valid_browsername?(str)
1919 # Check the Operating System name value - for example, 'Windows XP'
2020 # @param [String] str String for testing
2121 # @return [Boolean] If the string has valid Operating System name characters
22- def self . is_valid_osname? ( str )
22+ def self . is_valid_osname? ( str ) # rubocop:disable Naming/PredicatePrefix
2323 return false unless is_non_empty_string? ( str )
2424 return false if has_non_printable_char? ( str )
2525 return false if str . length < 2
@@ -30,7 +30,7 @@ def self.is_valid_osname?(str)
3030 # Check the Hardware name value - for example, 'iPhone'
3131 # @param [String] str String for testing
3232 # @return [Boolean] If the string has valid Hardware name characters
33- def self . is_valid_hwname? ( str )
33+ def self . is_valid_hwname? ( str ) # rubocop:disable Naming/PredicatePrefix
3434 return false unless is_non_empty_string? ( str )
3535 return false if has_non_printable_char? ( str )
3636 return false if str . length < 2
@@ -41,12 +41,12 @@ def self.is_valid_hwname?(str)
4141 # Verify the browser version string is valid
4242 # @param [String] str String for testing
4343 # @return [Boolean] If the string has valid browser version characters
44- def self . is_valid_browserversion? ( str )
44+ def self . is_valid_browserversion? ( str ) # rubocop:disable Naming/PredicatePrefix
4545 return false unless is_non_empty_string? ( str )
4646 return false if has_non_printable_char? ( str )
4747 return true if str . eql? 'UNKNOWN'
4848 return true if str . eql? 'ALL'
49- return false if !nums_only? ( str ) and !str . match ( /\A (0|[1-9][0-9]{0,3})(\. (0|[1-9][0-9]{0,3})){0,3}\z / )
49+ return false if !nums_only? ( str ) && !str . match ( /\A (0|[1-9][0-9]{0,3})(\. (0|[1-9][0-9]{0,3})){0,3}\z / )
5050 return false if str . length > 20
5151
5252 true
@@ -55,7 +55,7 @@ def self.is_valid_browserversion?(str)
5555 # Verify the os version string is valid
5656 # @param [String] str String for testing
5757 # @return [Boolean] If the string has valid os version characters
58- def self . is_valid_osversion? ( str )
58+ def self . is_valid_osversion? ( str ) # rubocop:disable Naming/PredicatePrefix
5959 return false unless is_non_empty_string? ( str )
6060 return false if has_non_printable_char? ( str )
6161 return true if str . eql? 'UNKNOWN'
@@ -69,7 +69,7 @@ def self.is_valid_osversion?(str)
6969 # Verify the browser/UA string is valid
7070 # @param [String] str String for testing
7171 # @return [Boolean] If the string has valid browser / ua string characters
72- def self . is_valid_browserstring? ( str )
72+ def self . is_valid_browserstring? ( str ) # rubocop:disable Naming/PredicatePrefix
7373 return false unless is_non_empty_string? ( str )
7474 return false if has_non_printable_char? ( str )
7575 return false if str . length > 300
@@ -80,7 +80,7 @@ def self.is_valid_browserstring?(str)
8080 # Verify the cookies are valid
8181 # @param [String] str String for testing
8282 # @return [Boolean] If the string has valid cookie characters
83- def self . is_valid_cookies? ( str )
83+ def self . is_valid_cookies? ( str ) # rubocop:disable Naming/PredicatePrefix
8484 return false unless is_non_empty_string? ( str )
8585 return false if has_non_printable_char? ( str )
8686 return false if str . length > 2000
@@ -91,7 +91,7 @@ def self.is_valid_cookies?(str)
9191 # Verify the system platform is valid
9292 # @param [String] str String for testing
9393 # @return [Boolean] If the string has valid system platform characters
94- def self . is_valid_system_platform? ( str )
94+ def self . is_valid_system_platform? ( str ) # rubocop:disable Naming/PredicatePrefix
9595 return false unless is_non_empty_string? ( str )
9696 return false if has_non_printable_char? ( str )
9797 return false if str . length > 200
@@ -102,7 +102,7 @@ def self.is_valid_system_platform?(str)
102102 # Verify the date stamp is valid
103103 # @param [String] str String for testing
104104 # @return [Boolean] If the string has valid date stamp characters
105- def self . is_valid_date_stamp? ( str )
105+ def self . is_valid_date_stamp? ( str ) # rubocop:disable Naming/PredicatePrefix
106106 return false unless is_non_empty_string? ( str )
107107 return false if has_non_printable_char? ( str )
108108 return false if str . length > 200
@@ -113,7 +113,7 @@ def self.is_valid_date_stamp?(str)
113113 # Verify the CPU type string is valid
114114 # @param [String] str String for testing
115115 # @return [Boolean] If the string has valid CPU type characters
116- def self . is_valid_cpu? ( str )
116+ def self . is_valid_cpu? ( str ) # rubocop:disable Naming/PredicatePrefix
117117 return false unless is_non_empty_string? ( str )
118118 return false if has_non_printable_char? ( str )
119119 return false if str . length > 200
@@ -124,7 +124,7 @@ def self.is_valid_cpu?(str)
124124 # Verify the memory string is valid
125125 # @param [String] str String for testing
126126 # @return [Boolean] If the string has valid memory type characters
127- def self . is_valid_memory? ( str )
127+ def self . is_valid_memory? ( str ) # rubocop:disable Naming/PredicatePrefix
128128 return false unless is_non_empty_string? ( str )
129129 return false if has_non_printable_char? ( str )
130130 return false if str . length > 200
@@ -135,7 +135,7 @@ def self.is_valid_memory?(str)
135135 # Verify the GPU type string is valid
136136 # @param [String] str String for testing
137137 # @return [Boolean] If the string has valid GPU type characters
138- def self . is_valid_gpu? ( str )
138+ def self . is_valid_gpu? ( str ) # rubocop:disable Naming/PredicatePrefix
139139 return false unless is_non_empty_string? ( str )
140140 return false if has_non_printable_char? ( str )
141141 return false if str . length > 200
@@ -148,11 +148,11 @@ def self.is_valid_gpu?(str)
148148 # @return [Boolean] If the string has valid browser plugin characters
149149 # @note This string can be empty if there are no browser plugins
150150 # @todo Verify if the ruby version statement is still necessary
151- def self . is_valid_browser_plugins? ( str )
151+ def self . is_valid_browser_plugins? ( str ) # rubocop:disable Naming/PredicatePrefix
152152 return false unless is_non_empty_string? ( str )
153153 return false if str . length > 1000
154154
155- if str . encoding === Encoding . find ( 'UTF-8' )
155+ if str . encoding == Encoding . find ( 'UTF-8' ) # Style/CaseEquality: Avoid the use of the case equality operator `===`.
156156 ( str =~ /[^\w \d \s ()-.,';_!\302 \256 ]/u ) . nil?
157157 else
158158 ( str =~ /[^\w \d \s ()-.,';_!\302 \256 ]/n ) . nil?
0 commit comments