Class: Herve::CLI::RubyCommands::Uninstall
- Inherits:
-
BaseCommand
- Object
- Dry::CLI::Command
- BaseCommand
- Herve::CLI::RubyCommands::Uninstall
- Defined in:
- lib/herve/cli/ruby_commands/uninstall.rb
Instance Attribute Summary
Attributes inherited from BaseCommand
Instance Method Summary collapse
Methods inherited from BaseCommand
Instance Method Details
#call(version:, **options) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/herve/cli/ruby_commands/uninstall.rb', line 13 def call(version:, **) install_dir = Herve.([:install_dir]) raise ConfigError, "install_dir does not exist" unless File.directory?(install_dir) config.ruby_dirs = [install_dir] unless install_dir.nil? ruby = RubyCommands.find_ruby(config, version) raise RubyError, "no matching ruby" if ruby.nil? uninstall_ruby(ruby) end |