2016-05-09 15:14:46 -04:00
|
|
|
module ContainerRegistry
|
2016-05-04 08:22:54 -04:00
|
|
|
class Registry
|
2016-05-09 15:27:06 -04:00
|
|
|
attr_reader :uri, :client, :path
|
2016-05-04 08:22:54 -04:00
|
|
|
|
|
|
|
def initialize(uri, options = {})
|
2016-05-17 10:41:47 -04:00
|
|
|
@uri = uri
|
|
|
|
@path = options[:path] || default_path
|
2016-05-09 15:14:46 -04:00
|
|
|
@client = ContainerRegistry::Client.new(uri, options)
|
2016-05-04 08:22:54 -04:00
|
|
|
end
|
|
|
|
|
2016-05-17 10:41:47 -04:00
|
|
|
private
|
|
|
|
|
|
|
|
def default_path
|
|
|
|
@uri.sub(/^https?:\/\//, '')
|
|
|
|
end
|
2016-05-04 08:22:54 -04:00
|
|
|
end
|
|
|
|
end
|