Class: Backupsss::Janitor
- Inherits:
-
Object
- Object
- Backupsss::Janitor
- Defined in:
- lib/backupsss/janitor.rb
Overview
A class for cleaning up backup artifacts
Instance Attribute Summary collapse
-
#driver ⇒ Object
readonly
Returns the value of attribute driver.
-
#retention_count ⇒ Object
readonly
Returns the value of attribute retention_count.
Instance Method Summary collapse
-
#initialize(opts) ⇒ Janitor
constructor
A new instance of Janitor.
- #rm_garbage(file_array) ⇒ Object
- #sift_trash ⇒ Object
Constructor Details
#initialize(opts) ⇒ Janitor
Returns a new instance of Janitor.
8 9 10 11 |
# File 'lib/backupsss/janitor.rb', line 8 def initialize(opts) @driver = opts[:driver] @retention_count = opts[:retention_count] || 0 end |
Instance Attribute Details
#driver ⇒ Object (readonly)
Returns the value of attribute driver.
6 7 8 |
# File 'lib/backupsss/janitor.rb', line 6 def driver @driver end |
#retention_count ⇒ Object (readonly)
Returns the value of attribute retention_count.
6 7 8 |
# File 'lib/backupsss/janitor.rb', line 6 def retention_count @retention_count end |
Instance Method Details
#rm_garbage(file_array) ⇒ Object
19 20 21 22 |
# File 'lib/backupsss/janitor.rb', line 19 def rm_garbage(file_array) file_array.each { |f| throw_out(f) } display_finished end |
#sift_trash ⇒ Object
13 14 15 16 17 |
# File 'lib/backupsss/janitor.rb', line 13 def sift_trash trash = find_trash vocalize_progress(find_treasures, trash) trash end |