Class: StateRecorder
- Inherits:
-
Object
- Object
- StateRecorder
- Defined in:
- lib/backup/state_recorder.rb
Instance Attribute Summary collapse
-
#fathers_since_last_promotion ⇒ Object
Returns the value of attribute fathers_since_last_promotion.
-
#saved_state_folder ⇒ Object
Returns the value of attribute saved_state_folder.
-
#sons_since_last_promotion ⇒ Object
Returns the value of attribute sons_since_last_promotion.
Instance Method Summary collapse
-
#cleanup_snapshots ⇒ Object
cleanup all the snapshots created by madeline.
-
#initialize ⇒ StateRecorder
constructor
A new instance of StateRecorder.
Constructor Details
#initialize ⇒ StateRecorder
Returns a new instance of StateRecorder.
8 9 10 11 |
# File 'lib/backup/state_recorder.rb', line 8 def initialize @sons_since_last_promotion = 0 @fathers_since_last_promotion = 0 end |
Instance Attribute Details
#fathers_since_last_promotion ⇒ Object
Returns the value of attribute fathers_since_last_promotion.
5 6 7 |
# File 'lib/backup/state_recorder.rb', line 5 def fathers_since_last_promotion @fathers_since_last_promotion end |
#saved_state_folder ⇒ Object
Returns the value of attribute saved_state_folder.
6 7 8 |
# File 'lib/backup/state_recorder.rb', line 6 def saved_state_folder @saved_state_folder end |
#sons_since_last_promotion ⇒ Object
Returns the value of attribute sons_since_last_promotion.
4 5 6 |
# File 'lib/backup/state_recorder.rb', line 4 def sons_since_last_promotion @sons_since_last_promotion end |
Instance Method Details
#cleanup_snapshots ⇒ Object
cleanup all the snapshots created by madeline
14 15 16 17 18 19 20 |
# File 'lib/backup/state_recorder.rb', line 14 def cleanup_snapshots files = Dir[saved_state_folder + "/*.snapshot"] files.pop files.sort.each do |f| FileUtils.rm(f, :verbose => false) end end |