class SecretHub::Commands::Repo

Public Instance Methods

delete_command() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 36
def delete_command
  github.delete_secret repo, key
  say "Deleted !txtblu!#{repo} !txtpur!#{key}"
end
list_command() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 24
def list_command
  say "!txtblu!#{repo}:"
  github.secrets(repo).each do |secret|
    say "- !txtpur!#{secret}"
  end
end
save_command() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 31
def save_command       
  github.put_secret repo, key, value
  say "Saved !txtblu!#{repo} !txtpur!#{key}"
end

Private Instance Methods

key() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 47
def key
  args['KEY']
end
repo() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 43
def repo
  args['REPO']
end
value() click to toggle source
# File lib/secret_hub/commands/repo.rb, line 51
def value
  result = args['VALUE'] || ENV[key]
  if result
    result
  else
    raise InvalidInput, "Please provide a value, either in the command line or in the environment variable '#{key}'"
  end
end