Project

osx_trash

0.0
No commit activity in last 3 years
No release in over 3 years
The OSX Trash gem will take a filepath containing paths to files that should be moved to the OSX trash. The list can be a little noisy, with things that will go away with `strip`. When instantiating the class, you can pass a hash of file: with the pathname, or paths: with an array of paths.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 2.0
~> 10.0
 Project Readme

OSX Trash

Ruby class and CLI app for moving files to the OSX Trash

Summary

The OSX Trash gem will take a filepath containing paths to files that should be moved to the OSX trash. The list can be a little noisy, with things that will go away with strip. When instantiatin the class, you can pass a hash of file: with the pathname, or paths: with an array. }

This gem relies on Applescript (osax), which all Apple computers should have.

Usage

require 'osx_trash'
OSX.trash file:path_to_file_list

When running the gem locally, send_to_trash may move files that are in a watched folder, such as by Dropbox or Google Filestream. These programs may raise a Finder dialog to confirm moving them. You will have to click "OK" for each one. This may cause problems on remote / headless systems. Please file an issue with bug report, or a PR. Thanks.

You can also call from the CLI:

gem install osx_trash

trash /path/to/a/file.jpg

trash_all /path/to/file-with-list-of-paths.txt

I think that zsh may interfere with recognizing bin paths of installed gems. If you have this issue, or a fix, please open an Issue on the repo. Thanks.

Development

After checking out the repo, run bin/setup to install dependencies. You can also run bin/console for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/NewAlexandria/osx_trash. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the OsxTrash project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.