Class: VimGet::Commands::SyncCommand

Inherits:
BaseCommand show all
Defined in:
lib/vimget/commands/sync_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

#initializeSyncCommand

Returns a new instance of SyncCommand.



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

def initialize
  super('sync', 'Sync with vim site')
end

Instance Method Details

#executeObject



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

def execute
  puts "Syncing..."
  
  db = VimGet.db
  db.search().each do |s|
    puts "-> sync #{s.name}.."
    new_script = VimGet::parse_script_page(s.sid)
    new_script.installed = s.installed
    db.update(new_script)
  end
end