auto_cleaner v0.7.3
auto_cleaner
Auto::Cleaner class takes responsibility for removing temporary files, directories and running custom cleaning procedures on exit
Installation
-
Add the dependency to your
shard.yml
:dependencies: auto_cleaner: github: DRVTiny/auto_cleaner
-
Run
shards install
Usage
require "auto_cleaner"
ac = Auto::Cleaner.new
ac.add_file( File.tempfile("prefix", ".tmp").path )
send_message_to = {host: "myserver.example.com", account: "somebody@example.com"}
ac.add_proc(send_message_to) do |useful_info|
puts "Cleaning in progress"
puts "After all we need to send message about cleaning status to..."
pp useful_info
1
end
# you can call this method directly, but it will be called
# automagically on application exit
# if you call this method explicitly, then all lists of objects to be
# cleaned on exit will be emptied
ac.make_mrproper
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/DRVTiny/auto_cleaner/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Andrey A. Konovalov - creator and maintainer
Repository
auto_cleaner
Owner
Statistic
- 0
- 0
- 0
- 0
- 0
- over 5 years ago
- May 7, 2019
License
MIT License
Links
Synced at
Fri, 22 Nov 2024 20:15:32 GMT
Languages