Class: VimGet::Commands::UpgradeCommand

Inherits:
BaseCommand show all
Defined in:
lib/vimget/commands/upgrade_command.rb

Constant Summary

Constants inherited from BaseCommand

BaseCommand::PROGRAM

Instance Attribute Summary

Attributes inherited from BaseCommand

#command, #defaults, #options, #options_group, #program_name, #summary

Instance Method Summary collapse

Methods inherited from BaseCommand

#arguments, #invoke, #show_help, #usage

Constructor Details

#initializeUpgradeCommand

Returns a new instance of UpgradeCommand.



22
23
24
# File 'lib/vimget/commands/upgrade_command.rb', line 22

def initialize
  super('upgrade', 'upgrade outdated script(s)')
end

Instance Method Details

#executeObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/vimget/commands/upgrade_command.rb', line 26

def execute
  outdated_scripts = VimGet.db.outdated_scripts
  
  if outdated_scripts.empty? 
    puts "There is no script outdated."
    return
  end
  
  installer = Installer.new(@options)
  outdated_scripts.each do |s|
    installer.upgrade(s)
  end
end