Class: Capsium::Registry::Remote

Inherits:
Registry
  • Object
show all
Defined in:
lib/capsium/registry/remote.rb,
sig/capsium/registry/remote.rbs

Overview

A read-only static registry behind an https base URL (plain http for loopback hosts only).

Constant Summary collapse

OPEN_TIMEOUT =

Returns:

  • (Integer)
5
READ_TIMEOUT =

Returns:

  • (Integer)
15
MAX_REDIRECTS =

Returns:

  • (Integer)
5
LOOPBACK_NETWORKS =

Returns:

  • (Array[untyped])
[IPAddr.new("127.0.0.0/8"), IPAddr.new("::1/128")].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url) ⇒ Remote

Returns a new instance of Remote.

Parameters:

  • base_url (String)


25
26
27
28
29
# File 'lib/capsium/registry/remote.rb', line 25

def initialize(base_url)
  super()
  @base_url = base_url.to_s.sub(%r{/+\z}, "")
  validate_scheme!(request_uri(INDEX_FILE))
end

Instance Attribute Details

#base_urlString (readonly)

Returns the value of attribute base_url.

Returns:

  • (String)


23
24
25
# File 'lib/capsium/registry/remote.rb', line 23

def base_url
  @base_url
end

Instance Method Details

#locationString

Returns:

  • (String)


31
# File 'lib/capsium/registry/remote.rb', line 31

def location = base_url