class Abt::Providers::Harvest::Commands::Clear

Public Class Methods

description() click to toggle source
# File lib/abt/providers/harvest/commands/clear.rb, line 12
def self.description
  "Clear harvest configuration"
end
flags() click to toggle source
# File lib/abt/providers/harvest/commands/clear.rb, line 16
def self.flags
  [
    ["-g", "--global",
     "Clear global instead of local harvest configuration (credentials etc.)"],
    ["-a", "--all", "Clear all harvest configuration"]
  ]
end
usage() click to toggle source
# File lib/abt/providers/harvest/commands/clear.rb, line 8
def self.usage
  "abt clear harvest"
end

Public Instance Methods

perform() click to toggle source
# File lib/abt/providers/harvest/commands/clear.rb, line 24
def perform
  abort("Flags --global and --all cannot be used together") if flags[:global] && flags[:all]

  config.clear_local unless flags[:global]
  config.clear_global if flags[:global] || flags[:all]

  warn("Configuration cleared")
end