Class: Gemvault::CLI::Commands::Remove
- Inherits:
-
Gemvault::CLI::Command
- Object
- CommandKit::Command
- Gemvault::CLI::Command
- Gemvault::CLI::Commands::Remove
- 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: [:version] || positional_version) with_vault(vault) { |v| report_removal(v.remove(ref)) } rescue Gemvault::GemReference::NonExactVersionError => e print_error(e.) exit(1) end |