lib/rubocop/cop/style/special_global_vars.rb in rubocop-0.36.0 vs lib/rubocop/cop/style/special_global_vars.rb in rubocop-0.37.0
- old
+ new
@@ -80,17 +80,17 @@
# For now, we assume that lists are 2 items or less. Easy grammar!
regular_msg = regular.join('` or `')
english_msg = english.join('` or `')
- if regular.length > 0 && english.length > 0
+ if !regular.empty? && !english.empty?
format(MSG_BOTH, english_msg, regular_msg, global_var)
- elsif regular.length > 0
+ elsif !regular.empty?
format(MSG_REGULAR, regular_msg, global_var)
- elsif english.length > 0
+ elsif !english.empty?
format(MSG_ENGLISH, english_msg, global_var)
else
- fail 'Bug in SpecialGlobalVars - global var w/o preferred vars!'
+ raise 'Bug in SpecialGlobalVars - global var w/o preferred vars!'
end
else
format(MSG_REGULAR, preferred_names(global_var).first, global_var)
end
end