Class: Dash::Configuration::Registry
- Inherits:
-
Object
- Object
- Dash::Configuration::Registry
show all
- Includes:
- Validation
- Defined in:
- lib/dash/configuration/registry.rb
Instance Method Summary
collapse
Methods included from Validation
#validate!, #validation_yml
Constructor Details
#initialize(config:, secrets:, context: "registry") ⇒ Registry
Returns a new instance of Registry.
4
5
6
7
8
9
|
# File 'lib/dash/configuration/registry.rb', line 4
def initialize(config:, secrets:, context: "registry")
@registry_config = config["registry"] || {}
@secrets = secrets
@context = context
validate! registry_config, context: context, with: Dash::Configuration::Validator::Registry
end
|
Instance Method Details
#local? ⇒ Boolean
23
24
25
|
# File 'lib/dash/configuration/registry.rb', line 23
def local?
server.to_s.match?("^localhost[:$]")
end
|
#local_port ⇒ Object
27
28
29
|
# File 'lib/dash/configuration/registry.rb', line 27
def local_port
local? ? (server.split(":").last.to_i || 80) : nil
end
|
#password ⇒ Object
19
20
21
|
# File 'lib/dash/configuration/registry.rb', line 19
def password
lookup("password")
end
|
#server ⇒ Object
11
12
13
|
# File 'lib/dash/configuration/registry.rb', line 11
def server
registry_config["server"]
end
|
#username ⇒ Object
15
16
17
|
# File 'lib/dash/configuration/registry.rb', line 15
def username
lookup("username")
end
|