rev 1527 - in trunk/Email-Folder: lib/Email/Folder t t/testmh

[prev] [thread] [next] [lurker] [Date index for 2004/08/26]

From: richardc
Subject: rev 1527 - in trunk/Email-Folder: lib/Email/Folder t t/testmh
Date: 16:37 on 26 Aug 2004
Author: richardc
Date: 2004-08-26 16:37:21 +0100 (Thu, 26 Aug 2004)
New Revision: 1527

Added:
   trunk/Email-Folder/lib/Email/Folder/MH.pm
   trunk/Email-Folder/t/03mh.t
   trunk/Email-Folder/t/testmh/
   trunk/Email-Folder/t/testmh/.mh_sequences
   trunk/Email-Folder/t/testmh/1
   trunk/Email-Folder/t/testmh/2
   trunk/Email-Folder/t/testmh/3
   trunk/Email-Folder/t/testmh/4
Log:
Date: Thu, 26 Aug 2004 08:34:59 -0400                                           
From: Ricardo SIGNES <rjbs@xxxx.xxx>                                            
Subject: Email::Folder::MH attached  


Added: trunk/Email-Folder/lib/Email/Folder/MH.pm
===================================================================
--- trunk/Email-Folder/lib/Email/Folder/MH.pm	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/lib/Email/Folder/MH.pm	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,69 @@
+package Email::Folder::MH;
+use strict;
+use Carp;
+use IO::File;
+use Email::Folder::Reader;
+use base 'Email::Folder::Reader';
+
+=head1 NAME
+
+Email::Folder::MH - reads raw RFC822 mails from an mh folder
+
+=head1 SYNOPSIS
+
+This isa Email::Folder::Reader - read about its API there.
+
+=head1 DESCRIPTION
+
+It's yet another email folder reader!  It reads MH folders.
+
+=cut
+
+sub _what_is_there {
+    my $self = shift;
+    my $dir = $self->{_file};
+
+    croak "$dir does not exist"     unless (-e $dir);
+    croak "$dir is not a directory" unless (-d $dir);
+
+    my @messages;
+                opendir(DIR,"$dir") or croak "Could not open '$dir'";
+                foreach my $file (readdir DIR) {
+                        next unless $file =~ /\A\d+\Z/;
+                                push @messages, "$dir/$file";
+                }
+
+    $self->{_messages} = \@messages;
+}
+
+sub next_message {
+    my $self = shift;
+    my $what = $self->{_messages} || $self->_what_is_there;
+
+    my $file = shift @$what or return;
+    local *FILE;
+    open FILE, $file or croak "couldn't open '$file' for reading";
+    join '', <FILE>;
+}
+
+1;
+
+__END__
+
+=head1 AUTHOR
+
+Ricardo SIGNES <C<rjbs@xxxx.xxx>>
+
+This code is just Simon Wistow's Email::Folder::Maildir adapted for C<mh>.
+
+=head1 COPYING
+
+Copyright 2004, Simon Wistow
+
+Distributed under the same terms as Perl itself.
+
+=head1 SEE ALSO
+
+L<Email::LocalDelivery>, L<Email::Folder>
+
+=cut

Added: trunk/Email-Folder/t/03mh.t
===================================================================
--- trunk/Email-Folder/t/03mh.t	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/t/03mh.t	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,23 @@
+#!perl -w
+use strict;
+use Test::More tests => 4;
+
+use_ok("Email::Folder");
+
+my $folder;
+ok($folder = Email::Folder->new('t/testmh/.'));
+
+
+my @messages = $folder->messages;
+is(@messages, 4, "grabbed 4 messages");
+
+my @subjects = sort map { $_->header('Subject') }  @messages;
+
+my @known = (
+             'Alfa bravo charlie delta',
+             'Echo foxtrot gulf hotel',
+             'India juliet kilo lima',
+             'Mike november oscar popa'
+            );
+
+is_deeply(\@subjects, \@known, "they're the messages we expected");

Added: trunk/Email-Folder/t/testmh/.mh_sequences
===================================================================

Added: trunk/Email-Folder/t/testmh/1
===================================================================
--- trunk/Email-Folder/t/testmh/1	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/t/testmh/1	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,37 @@
+Return-Path: <nobody@xxxxx.xxxx.xxx>
+Delivered-To: anonymous-cpan@xxxxxxx.xxx
+Received: (qmail 31554 invoked from network); 29 Feb 2004 13:11:18 -0000
+Received: from unknown (HELO pause.perl.org) (195.149.117.110)
+  by cheshirecat.example.org with SMTP; 29 Feb 2004 13:11:18 -0000
+Received: from pause.perl.org (localhost [127.0.0.1])
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1TDBHcj014491
+	for <anonymous-cpan@xxxxxxx.xxx>; Sun, 29 Feb 2004 14:11:17 +0100
+Received: (from nobody@localhost)
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) id i1TDBHEj014489;
+	Sun, 29 Feb 2004 14:11:17 +0100
+Date: Sun, 29 Feb 2004 14:11:17 +0100
+Message-Id: <200402291311.i1TDBHEj014489@xxxxx.xxxx.xxx>
+Subject: Alfa bravo charlie delta
+Reply-To: modules@xxxx.xxx
+To: anonymous-cpan@xxxxxxx.xxx
+From: "Perl Authors Upload Server" <upload@xxxxx.xxxx.xxx>
+X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
+	cheshirecat.example.org
+X-Spam-Level: 
+X-Spam-Status: No, hits=0.0 required=4.0 tests=none autolearn=no version=2.63
+Status: RO
+Content-Length: 299
+Lines: 12
+
+Record update in the PAUSE uploads database:
+
+       uriid: [R/RJ/RJBS/Math-TotalBuilder-002targz/Math-TotalBuilder-0.02.tar.gz]
+         uri: [fixedMathTB2.tar.gz] was [Math-TotalBuilder-0.02.tar.gz]
+
+Data entered by Ricardo SIGNES (RJBS).
+Please check if they are correct.
+
+Thanks,
+-- 
+The PAUSE
+

Added: trunk/Email-Folder/t/testmh/2
===================================================================
--- trunk/Email-Folder/t/testmh/2	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/t/testmh/2	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,37 @@
+Return-Path: <nobody@xxxxx.xxxx.xxx>
+Delivered-To: anonymous-cpan@xxxxxxx.xxx
+Received: (qmail 31567 invoked from network); 29 Feb 2004 13:11:19 -0000
+Received: from unknown (HELO pause.perl.org) (195.149.117.110)
+  by cheshirecat.example.org with SMTP; 29 Feb 2004 13:11:19 -0000
+Received: from pause.perl.org (localhost [127.0.0.1])
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1TDBIcj014504
+	for <anonymous-cpan@xxxxxxx.xxx>; Sun, 29 Feb 2004 14:11:18 +0100
+Received: (from nobody@localhost)
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) id i1TDBIKc014502;
+	Sun, 29 Feb 2004 14:11:18 +0100
+Date: Sun, 29 Feb 2004 14:11:18 +0100
+Message-Id: <200402291311.i1TDBIKc014502@xxxxx.xxxx.xxx>
+Subject: Echo foxtrot gulf hotel
+Reply-To: modules@xxxx.xxx
+To: anonymous-cpan@xxxxxxx.xxx
+From: "Perl Authors Upload Server" <upload@xxxxx.xxxx.xxx>
+X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
+	cheshirecat.example.org
+X-Spam-Level: 
+X-Spam-Status: No, hits=0.0 required=4.0 tests=none autolearn=no version=2.63
+Status: RO
+Content-Length: 299
+Lines: 12
+
+Record update in the PAUSE uploads database:
+
+       uriid: [R/RJ/RJBS/Math-TotalBuilder-002targz/Math-TotalBuilder-0.02.tar.gz]
+         uri: [fixedMathTB2.tar.gz] was [Math-TotalBuilder-0.02.tar.gz]
+
+Data entered by Ricardo SIGNES (RJBS).
+Please check if they are correct.
+
+Thanks,
+-- 
+The PAUSE
+

Added: trunk/Email-Folder/t/testmh/3
===================================================================
--- trunk/Email-Folder/t/testmh/3	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/t/testmh/3	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,39 @@
+Return-Path: <nobody@xxxxx.xxxx.xxx>
+Delivered-To: anonymous-cpan@xxxxxxx.xxx
+Received: (qmail 31617 invoked from network); 29 Feb 2004 13:16:22 -0000
+Received: from unknown (HELO pause.perl.org) (195.149.117.110)
+  by cheshirecat.example.org with SMTP; 29 Feb 2004 13:16:22 -0000
+Received: from pause.perl.org (localhost [127.0.0.1])
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1TDGLcj014556
+	for <anonymous-cpan@xxxxxxx.xxx>; Sun, 29 Feb 2004 14:16:21 +0100
+Received: (from nobody@localhost)
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) id i1TDGLl2014553;
+	Sun, 29 Feb 2004 14:16:21 +0100
+Date: Sun, 29 Feb 2004 14:16:21 +0100
+Message-Id: <200402291316.i1TDGLl2014553@xxxxx.xxxx.xxx>
+Subject: India juliet kilo lima
+Reply-To: modules@xxxx.xxx
+To: "Ricardo SIGNES" <anonymous-cpan@xxxxxxx.xxx>
+From: "Perl Authors Upload Server" <upload@xxxxx.xxxx.xxx>
+X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
+	cheshirecat.example.org
+X-Spam-Level: 
+X-Spam-Status: No, hits=0.0 required=4.0 tests=none autolearn=no version=2.63
+Status: RO
+Content-Length: 545
+Lines: 14
+
+According to a request entered by Ricardo SIGNES the following files and
+the symlinks pointing to them have been scheduled for deletion. They
+will expire after 72 hours and then be deleted by a cronjob. Until then
+you can undelete them via
+https://pause.perl.org/pause/authenquery?ACTION=delete_files or
+http://pause.perl.org/pause/authenquery?ACTION=delete_files
+
+$CPAN/authors/id/R/RJ/RJBS/fixedMathTB2targz/fixedMathTB2.tar.gz
+
+Note: to encourage deletions, all of past CPAN glory is collected on
+http://history.perl.org/backpan/
+
+The Pause
+

Added: trunk/Email-Folder/t/testmh/4
===================================================================
--- trunk/Email-Folder/t/testmh/4	2004-06-17 20:39:12 UTC (rev 1526)
+++ trunk/Email-Folder/t/testmh/4	2004-08-26 15:37:21 UTC (rev 1527)
@@ -0,0 +1,40 @@
+Return-Path: <nobody@xxxxx.xxxx.xxx>
+Delivered-To: anonymous-cpan@xxxxxxx.xxx
+Received: (qmail 31929 invoked from network); 29 Feb 2004 13:55:15 -0000
+Received: from unknown (HELO pause.perl.org) (195.149.117.110)
+  by cheshirecat.example.org with SMTP; 29 Feb 2004 13:55:15 -0000
+Received: from pause.perl.org (localhost [127.0.0.1])
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) with ESMTP id i1TDtEcj015049
+	for <anonymous-cpan@xxxxxxx.xxx>; Sun, 29 Feb 2004 14:55:14 +0100
+Received: (from nobody@localhost)
+	by pause.perl.org (8.12.3/8.12.3/Debian-6.6) id i1TDtEH2015046;
+	Sun, 29 Feb 2004 14:55:14 +0100
+Date: Sun, 29 Feb 2004 14:55:14 +0100
+Message-Id: <200402291355.i1TDtEH2015046@xxxxx.xxxx.xxx>
+Subject: Mike november oscar popa
+Reply-To: modules@xxxx.xxx
+To: "Ricardo SIGNES" <anonymous-cpan@xxxxxxx.xxx>
+From: "Perl Authors Upload Server" <upload@xxxxx.xxxx.xxx>
+X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
+	cheshirecat.example.org
+X-Spam-Level: 
+X-Spam-Status: No, hits=0.0 required=4.0 tests=none autolearn=no version=2.63
+Status: RO
+Content-Length: 614
+Lines: 15
+
+According to a request entered by Ricardo SIGNES the following files and
+the symlinks pointing to them have been scheduled for deletion. They
+will expire after 72 hours and then be deleted by a cronjob. Until then
+you can undelete them via
+https://pause.perl.org/pause/authenquery?ACTION=delete_files or
+http://pause.perl.org/pause/authenquery?ACTION=delete_files
+
+WARNING: CHECKSUMS not erasable: R/RJ/RJBS/fixedMathTB2targz/CHECKSUMS
+$CPAN/authors/id/R/RJ/RJBS/fixedMathTB2targz/fixedMathTB2.meta
+
+Note: to encourage deletions, all of past CPAN glory is collected on
+http://history.perl.org/backpan/
+
+The Pause
+

Generated at 17:00 on 26 Aug 2004 by mariachi 0.52