Class: RemoveCommand

Inherits:
Command show all
Defined in:
lib/commands.rb

Overview

Remove files #################################

Instance Attribute Summary

Attributes inherited from Command

#path

Instance Method Summary collapse

Methods inherited from Command

#<=>, #run, #transform

Constructor Details

#initialize(*args) ⇒ RemoveCommand

Returns a new instance of RemoveCommand.



130
131
132
# File 'lib/commands.rb', line 130

def initialize *args
  (@filename, @path)=args
end

Instance Method Details

#dry_runObject



136
137
138
# File 'lib/commands.rb', line 136

def dry_run
  "rm #{filename}"
end

#filenameObject



134
# File 'lib/commands.rb', line 134

def filename ; transform @filename ; end

#priorityObject



128
# File 'lib/commands.rb', line 128

def priority ; 3 ; end

#real_runObject



140
141
142
# File 'lib/commands.rb', line 140

def real_run
  FileUtils.rm filename
end