Method deprecated or moved
This method is deprecated or moved on the latest stable version.
The last existing version (v2.3.8) is shown here.
These similar methods exist in v7.1.3.2:
file(relative_source, relative_destination, file_options = {})
public
Remove a file if
it exists and is a file.
Show source
def file(relative_source, relative_destination, file_options = {})
destination = destination_path(relative_destination)
if File.exist?(destination)
logger.rm relative_destination
unless options[:pretend]
if options[:svn]
if options[:svn][relative_destination]
system("svn revert #{destination}")
FileUtils.rm(destination)
else
system("svn rm #{destination}")
end
elsif options[:git]
if options[:git][:new][relative_destination]
system("git reset HEAD #{relative_destination}")
FileUtils.rm(destination)
elsif options[:git][:modified][relative_destination]
system("git rm -f #{relative_destination}")
else
system("git rm #{relative_destination}")
end
else
FileUtils.rm(destination)
end
end
else
logger.missing relative_destination
return
end
end