Class: Backupsss::Janitor

Inherits:
Object
  • Object
show all
Defined in:
lib/backupsss/janitor.rb

Overview

A class for cleaning up backup artifacts

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#driverObject (readonly)

Returns the value of attribute driver.



6
7
8
# File 'lib/backupsss/janitor.rb', line 6

def driver
  @driver
end

#retention_countObject (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_trashObject



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