Class: VimGet::Commands::UpgradeCommand
- Inherits:
-
BaseCommand
- Object
- BaseCommand
- VimGet::Commands::UpgradeCommand
- Defined in:
- lib/vimget/commands/upgrade_command.rb
Constant Summary
Constants inherited from BaseCommand
Instance Attribute Summary
Attributes inherited from BaseCommand
#command, #defaults, #options, #options_group, #program_name, #summary
Instance Method Summary collapse
- #arguments ⇒ Object
-
#execute ⇒ Object
do the upgrading action.
-
#initialize ⇒ UpgradeCommand
constructor
A new instance of UpgradeCommand.
- #usage ⇒ Object
Methods inherited from BaseCommand
Constructor Details
#initialize ⇒ UpgradeCommand
Returns a new instance of UpgradeCommand.
21 22 23 |
# File 'lib/vimget/commands/upgrade_command.rb', line 21 def initialize super('upgrade', 'upgrade outdated script(s)') end |
Instance Method Details
#arguments ⇒ Object
29 30 31 |
# File 'lib/vimget/commands/upgrade_command.rb', line 29 def arguments "SCRIPT the name of script to upgrade" end |
#execute ⇒ Object
do the upgrading action
34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/vimget/commands/upgrade_command.rb', line 34 def execute args = fetch_arguments 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 |
#usage ⇒ Object
25 26 27 |
# File 'lib/vimget/commands/upgrade_command.rb', line 25 def usage "#{@program_name} [SCRIPT SCRIPT...]" end |