Class: Gemvault::CLI::Commands::Remove

Inherits:
Gemvault::CLI::Command show all
Defined in:
lib/gemvault/cli/commands/remove.rb

Overview

gemvault remove subcommand. Parses argv into a GemReference and asks the vault to remove matching gems.

Instance Method Summary collapse

Instance Method Details

#run(vault, name, positional_version = nil) ⇒ Object



28
29
30
31
32
33
34
# File 'lib/gemvault/cli/commands/remove.rb', line 28

def run(vault, name, positional_version = nil)
  ref = Gemvault::GemReference.parse(name, version: options[:version] || positional_version)
  with_vault(vault) { |v| report_removal(v.remove(ref)) }
rescue Gemvault::GemReference::NonExactVersionError => e
  print_error(e.message)
  exit(1)
end