Module: Gemvault::AcceptVaultURI

Defined in:
lib/rubygems_plugin.rb

Overview

Lets .gemv paths bypass RubyGems' URI scheme validation.

Constant Summary collapse

VALID_URI_SCHEMES =
["http", "https", "file", "s3"].freeze

Instance Method Summary collapse

Instance Method Details

#accept_uri_httpObject



21
22
23
24
25
26
27
28
29
# File 'lib/rubygems_plugin.rb', line 21

def accept_uri_http
  Gem::OptionParser.accept Gem::URI::HTTP do |value|
    next value if value.to_s.end_with?(".gemv")

    uri = parse_uri(value)
    validate_scheme!(uri, value)
    value
  end
end