Follow-up from "Add wiper script to avoid ZD downloads clutter"
The following discussions from !1 (merged) should be addressed:
-
@weimeng started a discussion: (+4 comments) How about using
ARGVso this isn't hardcoded? Or use a constant so folks can configure their downloads directory? -
@weimeng started a discussion: (+1 comment) Purely as a matter of style and neatness, you might want to put everything into a class. Something like:
class DownloadsWiper def initialize(args) @downloads_dir = args.first || (Dir.home + '/Downloads') end def run! delete archive end private def some_helper_methods (...) end def delete (...) end def archive (...) end end DownloadsWiper.new(ARGV).run!
Edited by Katrin Leinweber