Class: Rexer::Commands::Reinstall

Inherits:
Object
  • Object
show all
Includes:
ActionCallable
Defined in:
lib/rexer/commands/reinstall.rb

Constant Summary collapse

Action =
Data.define(:install, :uninstall)

Instance Method Summary collapse

Methods included from ActionCallable

#call_action

Constructor Details

#initializeReinstall

Returns a new instance of Reinstall.



8
9
10
# File 'lib/rexer/commands/reinstall.rb', line 8

def initialize
  @lock_definition = Definition::Lock.load_data
end

Instance Method Details

#call(extension_name) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
# File 'lib/rexer/commands/reinstall.rb', line 12

def call(extension_name)
  return if no_lock_file_found

  extension, action = find_extension_with_action(extension_name.to_sym)

  if extension.nil?
    puts "#{extension_name} is not installed"
    return
  end

  reinstall(extension, action)
end