Class: DeleteOldRevisionsHelper
- Inherits:
-
Object
- Object
- DeleteOldRevisionsHelper
- Defined in:
- lib/helpers/maintenance-helpers.rb
Constant Summary collapse
- AUTHOR =
'Automatic Revision Remover'
Instance Method Summary collapse
-
#initialize(wiki, event_to_check_on = :day, age_to_wipe_at = 60*60*24*365, minimum_revisions = 20) ⇒ DeleteOldRevisionsHelper
constructor
Default wakes up each day at midnight and wipes all revisions more than 100 days old if there are more than 20 revisions in the page.
Constructor Details
#initialize(wiki, event_to_check_on = :day, age_to_wipe_at = 60*60*24*365, minimum_revisions = 20) ⇒ DeleteOldRevisionsHelper
Default wakes up each day at midnight and wipes all revisions more than 100 days old if there are more than 20 revisions in the page
32 33 34 35 36 37 |
# File 'lib/helpers/maintenance-helpers.rb', line 32 def initialize( wiki, event_to_check_on = :day, age_to_wipe_at = 60*60*24*365, minimum_revisions = 20 ) @wiki = wiki @age_to_wipe_at = age_to_wipe_at @maximum_revisions = minimum_revisions @wiki.watch_for(event_to_check_on) { check_and_delete_revisions } end |