diff --git a/Library/Homebrew/cask/lib/hbc/cask_loader.rb b/Library/Homebrew/cask/lib/hbc/cask_loader.rb index 1b231a097e..a0c44d9b41 100644 --- a/Library/Homebrew/cask/lib/hbc/cask_loader.rb +++ b/Library/Homebrew/cask/lib/hbc/cask_loader.rb @@ -54,7 +54,7 @@ module Hbc class FromURILoader < FromPathLoader def self.can_load?(ref) - ref.to_s =~ ::URI.regexp + ref.to_s.match?(::URI.regexp) end def initialize(url) @@ -80,7 +80,7 @@ module Hbc class FromTapLoader < FromPathLoader def self.can_load?(ref) - ref.to_s =~ HOMEBREW_TAP_CASK_REGEX + ref.to_s.match?(HOMEBREW_TAP_CASK_REGEX) end def initialize(tapped_name)