summaryrefslogtreecommitdiff
path: root/lib/container_registry/registry.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/container_registry/registry.rb')
-rw-r--r--lib/container_registry/registry.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/container_registry/registry.rb b/lib/container_registry/registry.rb
index d3b117eeaca..07490de94ba 100644
--- a/lib/container_registry/registry.rb
+++ b/lib/container_registry/registry.rb
@@ -3,13 +3,19 @@ module ContainerRegistry
attr_reader :uri, :client, :path
def initialize(uri, options = {})
- @path = options[:path] || uri
- @uri = URI.parse(uri)
+ @uri = uri
+ @path = options[:path] || default_path
@client = ContainerRegistry::Client.new(uri, options)
end
def [](name)
ContainerRegistry::Repository.new(self, name)
end
+
+ private
+
+ def default_path
+ @uri.sub(/^https?:\/\//, '')
+ end
end
end