Fix style (Convert if-elsif to case-when)

This commit is contained in:
Maxim Belkin 2020-07-16 13:53:32 +00:00
parent c61aba4ec3
commit f2ddcda85b

View File

@ -15,9 +15,10 @@ class Formula
# Ex. 1: "libONE.so.1" # Ex. 1: "libONE.so.1"
# Ex. 2: %r{(libONE|libTWO)\.so} # Ex. 2: %r{(libONE|libTWO)\.so}
self.class.allowed_missing_libraries.any? do |x| self.class.allowed_missing_libraries.any? do |x|
if x.is_a? Regexp case x
when Regexp
x.match? lib x.match? lib
elsif x.is_a? String when String
lib.include? x lib.include? x
end end
end end