public Method

Sys.delete(*wildcards)

Remove all files matching wildcard. If a matching file is a directory, it must be empty to be removed. used delete_all to recursively delete directories.

Source Code

# File rake/contrib/sys.rb, line 100
def delete(*wildcards)
  wildcards.each do |wildcard|
    Dir[wildcard].each do |fn|
      if File.directory?(fn)
        log "Deleting directory #{fn}"
        Dir.delete(fn)
      else
        log "Deleting file #{fn}"
        File.delete(fn)
      end
    end
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.