Class: VimGet::Commands::CleanCommand

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

#initializeCleanCommand

Returns a new instance of CleanCommand.



20
21
22
23
# File 'lib/vimget/commands/clean_command.rb', line 20

def initialize
  super('clean', 'clean all distributed files')
  
end

Instance Method Details

#executeObject



25
26
27
28
29
30
31
# File 'lib/vimget/commands/clean_command.rb', line 25

def execute
  dir = VimGet.configure.distfiles_dir
  puts "Cleaing..."
  
  abs_dir = File.expand_path(dir)
  Dir.glob(File.join(abs_dir,"*")).each { |f| File.delete(f) }
end