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



30
31
32
33
34
35
36
37
# File 'lib/rubygems_plugin.rb', line 30

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

    validate_uri!(value)
    value
  end
end