Class: DeleteDerivedData::Trash
- Inherits:
-
Object
- Object
- DeleteDerivedData::Trash
- Defined in:
- lib/delete_derived_data/trash.rb
Class Method Summary collapse
Class Method Details
.empty_securely_trash ⇒ Object
18 19 20 21 22 23 |
# File 'lib/delete_derived_data/trash.rb', line 18 def self.empty_securely_trash puts "Telling Finder to securely empty trash... " IO.popen("osascript", "w") do |stdin| stdin.puts %Q{tell app "Finder" to empty trash with security} end end |
.empty_trash ⇒ Object
11 12 13 14 15 16 |
# File 'lib/delete_derived_data/trash.rb', line 11 def self.empty_trash puts "Telling Finder to empty trash... " IO.popen("osascript", "w") do |stdin| stdin.puts %Q{tell app "Finder" to empty trash} end end |
.move_to_trash(file) ⇒ Object
4 5 6 7 8 9 |
# File 'lib/delete_derived_data/trash.rb', line 4 def self.move_to_trash(file) puts "Telling Finder to move the file #{file} to trash... " IO.popen("osascript", "w") do |stdin| stdin.puts %Q{tell app "Finder" to move the POSIX file "#{file}" to trash} end end |