module Plankton::Helpers
Public Instance Methods
opts()
click to toggle source
# File lib/plankton/helpers.rb, line 3 def opts @opts_struct ||= RecursiveOpenStruct.new(options) end
pretty_size(bytes)
click to toggle source
# File lib/plankton/helpers.rb, line 18 def pretty_size(bytes) Filesize.from("#{bytes} B").pretty end
registry()
click to toggle source
# File lib/plankton/helpers.rb, line 7 def registry unless username? || password? return @registry ||= DockerRegistry2.connect(hostname, verbose: verbose?) end @registry ||= DockerRegistry2.connect(hostname, verbose: verbose?, user: username, password: password) end
total_size(tags)
click to toggle source
# File lib/plankton/helpers.rb, line 36 def total_size(tags) pretty_size(tags.reduce(0) { |sum, t| sum + t.layer_size }) end