diff --git a/lib/ezmlm.rb b/lib/ezmlm.rb index fd40611..9fb3390 100644 --- a/lib/ezmlm.rb +++ b/lib/ezmlm.rb @@ -14,7 +14,7 @@ module Ezmlm # $Id$ # Package version - VERSION = '1.0.2' + VERSION = '1.1.0' # Suck in the components. # diff --git a/lib/ezmlm/list.rb b/lib/ezmlm/list.rb index 6f5dfba..ac9eadd 100644 --- a/lib/ezmlm/list.rb +++ b/lib/ezmlm/list.rb @@ -664,6 +664,16 @@ class Ezmlm::List end + ### Return a Time object for the last activity on the list, or nil + ### if archiving is disabled or there are no posts. + ### + def last_activity + file = self.listdir + 'archnum' + return unless file.exist? + return file.stat.mtime + end + + ### Parse all thread indexes into a single array that can be used ### as a lookup table. ### diff --git a/spec/ezmlm/list_spec.rb b/spec/ezmlm/list_spec.rb index 08d3619..3f0d4b4 100644 --- a/spec/ezmlm/list_spec.rb +++ b/spec/ezmlm/list_spec.rb @@ -236,6 +236,10 @@ describe Ezmlm::List do expect( list.digest_count ).to eq( 10 ) end + it 'knows the date of the most recent posting' do + expect( list.last_activity ).to be_a( Time ) + end + it 'can set a new digest message count' do list.digest_count = 25 expect( list.digest_count ).to eq( 25 )