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 35 36 37 |
# File 'lib/gemvault/cli/commands/remove.rb', line 28 def run(vault, name, positional_version = nil) begin version = [:version] || positional_version reference = Gemvault::GemReference.parse(name, version:) remove_matching(vault:, reference:) rescue Gemvault::GemReference::NonExactVersionError => e print_error(e.) exit(1) end end |