New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

trash_lib

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trash_lib

  • 1.0.2
  • Rubygems
  • Socket score

Version published
Maintainers
1
Created
Source

💡 About

This is a library for system file's trash in FreeDesktop Trash compliant environments.

📥 Installation

Install the gem and add to the application's Gemfile by executing:

bundle add trash_lib

If bundler is not being used to manage dependencies, install the gem by executing:

gem install trash_lib

⌨️ Usage

In Ruby do:

require 'trash'

Put files in trash:

Trash.put 'path/to/file'
Trash.put 'file1', 'file2', 'file3'

Empty the trash:

Trash.empty

List trashed files:

Trash.list
#=> [#<Trash::Entry:file1>,
     #<Trash::Entry:file2>,
     #<Trash::Entry:file3>]

trash_file = Trash.list.last

Returns the original path for file:

trash_file.origin  #=> 'original/path/to/file'

Returns the deletion time for file:

trash_file.dtime  #=> 2023-08-15 19:15:32.119439287 +0700

Restore file to original path:

trash_file.restore

Permanently delete the file:

trash_file.delete

💌 Credits

  • Trashy by Klaatu
  • Trash-CLI by Andrea Francia

FAQs

Package last updated on 16 Aug 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc