148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
|
# File 'lib/apstrings/strings_validator.rb', line 148
def self.validate_special_characters(sf)
variables_regex = /%[hlqLztj]?[@%dDuUxXoOfeEgGcCsSpaAF]/
mismatchs = []
sf.key_values.each {
|e| e.each_pair {
|key,value|
fixed_key = Validator::value_in_master(key)
if fixed_key != nil
striped_key = fixed_key.gsub(/%\d\$/,'%') striped_value = value.gsub(/%\d\$/,'%')
key_variables = striped_key.scan(variables_regex)
value_variables = striped_value.scan(variables_regex)
if !(key_variables.sort == value_variables.sort)
mismatchs << {key => value}
end
else
Log.warn("There is missing key in master file comparing to slavor. As we only check missing keys in slavor file, just ignore. \n ");
end
}
}
mismatchs
end
|