module Plankton::EnvVars

Public Instance Methods

confirm?() click to toggle source
# File lib/plankton/env_vars.rb, line 36
def confirm?
  opts.confirm
end
hostname() click to toggle source
# File lib/plankton/env_vars.rb, line 3
def hostname
  host = (ENV.fetch('REGISTRY_CLI_HOSTNAME', nil) || opts.hostname)
  if host.nil? || host == 'hostname'
    raise EnvVarNotFoundError, 'Docker Registry hostname'
  end
  host = host.dup.prepend('https://') unless %r{^https?://} =~ host
  host.gsub(%r{/*$}, '').strip
end
password() click to toggle source
# File lib/plankton/env_vars.rb, line 22
def password
  pass = (ENV.fetch('REGISTRY_CLI_PASSWORD', nil) || opts.password)
  return nil if pass.nil?
  pass.gsub(%r{/*$}, '').strip
end
password?() click to toggle source
# File lib/plankton/env_vars.rb, line 28
def password?
  !password.nil?
end
username() click to toggle source
# File lib/plankton/env_vars.rb, line 12
def username
  user = (ENV.fetch('REGISTRY_CLI_USERNAME', nil) || opts.username)
  return nil if user.nil?
  user.gsub(%r{/*$}, '').strip
end
username?() click to toggle source
# File lib/plankton/env_vars.rb, line 18
def username?
  !username.nil?
end
verbose?() click to toggle source
# File lib/plankton/env_vars.rb, line 32
def verbose?
  opts.verbose
end