Class: Capsium::Registry::Remote
- Inherits:
-
Registry
- Object
- Registry
- Capsium::Registry::Remote
- 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 =
5- READ_TIMEOUT =
15- MAX_REDIRECTS =
5- LOOPBACK_NETWORKS =
[IPAddr.new("127.0.0.0/8"), IPAddr.new("::1/128")].freeze
Instance Attribute Summary collapse
-
#base_url ⇒ String
readonly
Returns the value of attribute base_url.
Instance Method Summary collapse
-
#initialize(base_url) ⇒ Remote
constructor
A new instance of Remote.
- #location ⇒ String
Constructor Details
#initialize(base_url) ⇒ Remote
Returns a new instance of Remote.
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_url ⇒ String (readonly)
Returns the value of attribute base_url.
23 24 25 |
# File 'lib/capsium/registry/remote.rb', line 23 def base_url @base_url end |
Instance Method Details
#location ⇒ String
31 |
# File 'lib/capsium/registry/remote.rb', line 31 def location = base_url |