Merge pull request #6742 from MikeMcQuaid/cask_loader_uri
cask_loader: fix URI detection.
This commit is contained in:
commit
13a249a426
@ -79,7 +79,13 @@ module Cask
|
||||
class FromURILoader < FromPathLoader
|
||||
def self.can_load?(ref)
|
||||
uri_regex = ::URI::DEFAULT_PARSER.make_regexp
|
||||
ref.to_s.match?(Regexp.new('\A' + uri_regex.source + '\Z', uri_regex.options))
|
||||
return false unless ref.to_s.match?(Regexp.new('\A' + uri_regex.source + '\Z', uri_regex.options))
|
||||
|
||||
uri = URI(ref)
|
||||
return false unless uri
|
||||
return false unless uri.path
|
||||
|
||||
true
|
||||
end
|
||||
|
||||
attr_reader :url
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user