Method: Hanami::CLI::URL.call

Defined in:
lib/hanami/cli/url.rb

.call(url) ⇒ Object Also known as: []

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Since:

  • 2.0.0



17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/hanami/cli/url.rb', line 17

def call(url)
  result = url
  result = URI.parse(result).path

  unless valid?(result)
    raise InvalidURLError.new(url)
  end

  result
rescue URI::InvalidURIError
  raise InvalidURLError.new(url)
end