# HG changeset patch # User Mahlon E. Smith # Date 1494975125 25200 # Node ID 9d59d30685cb56dc9e3015f4b62dda27649f349c # Parent c09ca4007e6c61e46d0b3de820a03acc17f2f47a Fixes for documentation and test directories that didn't make it into the repo. diff -r c09ca4007e6c -r 9d59d30685cb Rakefile --- a/Rakefile Tue May 16 13:58:56 2017 -0700 +++ b/Rakefile Tue May 16 15:52:05 2017 -0700 @@ -23,6 +23,7 @@ select{|line| line =~ /VERSION =/}.first.match(/([\d|.]+)/)[1] task :default => [ :spec, :docs, :package ] +task :spec => [ :compile ] ######################################################################## @@ -34,11 +35,7 @@ spec = Gem::Specification.new do |s| s.email = 'mahlon@martini.nu' s.homepage = 'https://bitbucket.org/mahlon/Ruby-Ezmlm' - s.authors = [ - 'Mahlon E. Smith ', - 'Michael Granger ', - 'Jeremiah Jordan ' - ] + s.authors = [ 'Mahlon E. Smith', 'Michael Granger', 'Jeremiah Jordan' ] s.platform = Gem::Platform::RUBY s.summary = "Interact with Ezmlm-IDX mailing lists." s.name = PROJECT @@ -84,7 +81,7 @@ rdoc.rdoc_dir = 'docs' rdoc.main = "README.rdoc" # rdoc.options = [ '-f', 'fivefish' ] - rdoc.rdoc_files = [ 'lib', *FileList['ext/*/*.c'], *FileList['*.rdoc'] ] + rdoc.rdoc_files = [ 'lib', *FileList['ext/**.c'], *FileList['*.rdoc'], *FileList['*.md'] ] end RDoc::Task.new do |rdoc| diff -r c09ca4007e6c -r 9d59d30685cb USAGE.md --- a/USAGE.md Tue May 16 13:58:56 2017 -0700 +++ b/USAGE.md Tue May 16 15:52:05 2017 -0700 @@ -10,14 +10,14 @@ -------- -*Print the list address for all lists in a directory*: +### Print the list address for all lists in a directory: Ezmlm.each_list( '/lists' ) do |list| puts list.address end -*Check if I'm subscribed to a list, and if so, unsubscribe*: +### Check if I'm subscribed to a list, and if so, unsubscribe: (You don't really have to check first, subscribe and unsubscribe are idempotent.) @@ -31,14 +31,14 @@ puts "The list now has %d subscribers!" % [ list.subscribers.size ] -*Iterate over the subscriber list*: +### Iterate over the subscriber list: list.subscribers.each do |subscriber| # ... end -*Make the list moderated, and add a moderator*: +### Make the list moderated, and add a moderator: list.moderated = true list.add_moderator( 'mahlon@martini.nu' ) @@ -48,7 +48,7 @@ for details. -*Archiving!* +### Archiving! All of the archival pieces take advantage of Ezmlm-IDX extensions. If you want to use these features, you'll want to enable archiving @@ -67,12 +67,12 @@ automatically. -*How many messages are in the archive?*: +### How many messages are in the archive?: list.message_count #=> 123 -*Fetch message number 100 from the archive*: +### Fetch message number 100 from the archive: message = list.message( 100 ) or abort "No such message." @@ -96,7 +96,7 @@ for specifics. -*Iterate over messages in a specific thread*: +### Iterate over messages in a specific thread: Messages know what thread they belong to. Once you have a thread object from a message, it is an enumerable. Iterate or sort on it using @@ -110,7 +110,7 @@ 'authors' and 'each_author' methods. -*Iterate over messages from a specific author:* +### Iterate over messages from a specific author: Messages know who authored them. Once you have an author object from a message, it is an enumerable. Iterate or sort on it using standard Ruby diff -r c09ca4007e6c -r 9d59d30685cb lib/ezmlm.rb --- a/lib/ezmlm.rb Tue May 16 13:58:56 2017 -0700 +++ b/lib/ezmlm.rb Tue May 16 15:52:05 2017 -0700 @@ -1,5 +1,6 @@ # vim: set nosta noet ts=4 sw=4: +require 'pathname' # A Ruby interface to the ezmlm-idx mailing list system. # @@ -9,24 +10,11 @@ # puts "\"%s\" <%s>" % [ list.name, list.address ] # end # -# -# == Version -# -# $Id$ -# -#--- -# -# Please see the file LICENSE in the base directory for licensing details. -# - -require 'pathname' - - -### Toplevel namespace module module Ezmlm + # $Id$ # Package version - VERSION = '1.0.0' + VERSION = '1.0.1' # Suck in the components. # diff -r c09ca4007e6c -r 9d59d30685cb lib/ezmlm/list.rb --- a/lib/ezmlm/list.rb Tue May 16 13:58:56 2017 -0700 +++ b/lib/ezmlm/list.rb Tue May 16 15:52:05 2017 -0700 @@ -2,26 +2,19 @@ # vim: set nosta noet ts=4 sw=4: -# A Ruby interface to a single Ezmlm-idx mailing list directory. -# -# list = Ezmlm::List.new( '/path/to/listdir' ) -# -# -# == Version -# -# $Id$ -# -#--- - require 'pathname' require 'time' require 'etc' require 'ezmlm' unless defined?( Ezmlm ) -### A Ruby interface to an ezmlm-idx mailing list directory -### +# A Ruby interface to a single Ezmlm-idx mailing list directory. +# +# list = Ezmlm::List.new( '/path/to/listdir' ) +# +#--- class Ezmlm::List + # $Id$ # Valid subdirectories/sections for subscriptions. SUBSCRIPTION_DIRS = %w[ deny mod digest allow ] diff -r c09ca4007e6c -r 9d59d30685cb lib/ezmlm/list/author.rb --- a/lib/ezmlm/list/author.rb Tue May 16 13:58:56 2017 -0700 +++ b/lib/ezmlm/list/author.rb Tue May 16 15:52:05 2017 -0700 @@ -1,6 +1,9 @@ #!/usr/bin/ruby # vim: set nosta noet ts=4 sw=4: +require 'pathname' +require 'ezmlm' unless defined?( Ezmlm ) + # A collection of messages authored from a unique user. # @@ -11,20 +14,9 @@ # author.name #=> "Help - navigate on interface?" # author.first.date.to_s #=> "2017-05-07T14:55:05-07:00" # -# -# == Version -# -# $Id$ -# #--- - -require 'pathname' -require 'ezmlm' unless defined?( Ezmlm ) - - -### A collection of messages for a specific author. -### class Ezmlm::List::Author + # $Id$ include Enumerable ### Instantiate a new list of messages given diff -r c09ca4007e6c -r 9d59d30685cb lib/ezmlm/list/message.rb --- a/lib/ezmlm/list/message.rb Tue May 16 13:58:56 2017 -0700 +++ b/lib/ezmlm/list/message.rb Tue May 16 15:52:05 2017 -0700 @@ -1,6 +1,9 @@ #!/usr/bin/ruby # vim: set nosta noet ts=4 sw=4: +require 'pathname' +require 'ezmlm' unless defined?( Ezmlm ) +require 'mail' # An individual list message. # @@ -12,20 +15,9 @@ # This class passes all heavy lifting to the Mail::Message library. # Please see it for specifics on usage. # -# == Version -# -# $Id$ -# #--- - -require 'pathname' -require 'ezmlm' unless defined?( Ezmlm ) -require 'mail' - - -### A Ruby interface to an individual list message. -### class Ezmlm::List::Message + # $Id$ ### Instantiate a new messag from a +list+ and a +message_number+. ### diff -r c09ca4007e6c -r 9d59d30685cb lib/ezmlm/list/thread.rb --- a/lib/ezmlm/list/thread.rb Tue May 16 13:58:56 2017 -0700 +++ b/lib/ezmlm/list/thread.rb Tue May 16 15:52:05 2017 -0700 @@ -1,6 +1,9 @@ #!/usr/bin/ruby # vim: set nosta noet ts=4 sw=4: +require 'pathname' +require 'ezmlm' unless defined?( Ezmlm ) + # A collection of messages for a specific archive thread. # @@ -8,20 +11,9 @@ # thread.subject #=> "Help - navigate on interface?" # thread.first.date.to_s #=> "2017-05-07T14:55:05-07:00" # -# -# == Version -# -# $Id$ -# #--- - -require 'pathname' -require 'ezmlm' unless defined?( Ezmlm ) - - -### A collection of messages for a specific archive thread. -### class Ezmlm::List::Thread + # $Id$ include Enumerable ### Instantiate a new thread of messages given diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/allow/subscribers/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/bounce/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/deny/subscribers/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/digest/bounce/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/digest/subscribers/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/mod/accepted/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/mod/pending/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/mod/rejected/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/mod/subscribers/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/mod/unconfirmed/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/subscribers/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/data/testlist/text/.placeholder diff -r c09ca4007e6c -r 9d59d30685cb spec/spec_helpers.rb --- a/spec/spec_helpers.rb Tue May 16 13:58:56 2017 -0700 +++ b/spec/spec_helpers.rb Tue May 16 15:52:05 2017 -0700 @@ -3,6 +3,7 @@ require 'simplecov' if ENV['COVERAGE'] require 'rspec' require 'fileutils' +require 'tmpdir' require_relative '../lib/ezmlm' @@ -30,7 +31,8 @@ ### Create a copy of a fresh listdir into /tmp. ### def make_listdir - dirname = "/tmp/%s.%d.%0.4f" % [ + dirname = "%s/%s.%d.%0.4f" % [ + Dir.tmpdir, 'ezmlm_list', Process.pid, (Time.now.to_f % 3600),