Commits

Anonymous committed f038a7f

Add Google Groups

  • Participants
  • Parent commits a200393

Comments (0)

Files changed (5)

File modules/Mail-LMLM/MANIFEST

 lib/Mail/LMLM/Types/Base.pm
 lib/Mail/LMLM/Types/Egroups.pm
 lib/Mail/LMLM/Types/Ezmlm.pm
+lib/Mail/LMLM/Types/GoogleGroups.pm
 lib/Mail/LMLM/Types/Listar.pm
 lib/Mail/LMLM/Types/Listserv.pm
 lib/Mail/LMLM/Types/Mailman.pm

File modules/Mail-LMLM/META.yml

 ---
+abstract: 'List of Mailing Lists Manager'
+author: []
+configure_requires:
+  Module::Build: 0.36
+generated_by: 'Module::Build version 0.3603'
+license: bsd
+meta-spec:
+  url: http://module-build.sourceforge.net/META-spec-v1.4.html
+  version: 1.4
 name: Mail-LMLM
-version: 0.6500
-author: []
-abstract: List of Mailing Lists Manager
-license: bsd
-resources:
-  license: http://www.opensource.org/licenses/bsd-license.php
-requires:
-  Test::More: 0
-configure_requires:
-  Module::Build: 0.34
 provides:
   Mail::LMLM:
     file: lib/Mail/LMLM.pm
-    version: 0.6500
+    version: 0.6600
   Mail::LMLM::Object:
     file: lib/Mail/LMLM/Object.pm
   Mail::LMLM::Render:
     file: lib/Mail/LMLM/Types/Egroups.pm
   Mail::LMLM::Types::Ezmlm:
     file: lib/Mail/LMLM/Types/Ezmlm.pm
+  Mail::LMLM::Types::GoogleGroups:
+    file: lib/Mail/LMLM/Types/GoogleGroups.pm
   Mail::LMLM::Types::Listar:
     file: lib/Mail/LMLM/Types/Listar.pm
   Mail::LMLM::Types::Listserv:
     file: lib/Mail/LMLM/Types/Mailman.pm
   Mail::LMLM::Types::Majordomo:
     file: lib/Mail/LMLM/Types/Majordomo.pm
-generated_by: Module::Build version 0.34
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: 1.4
+requires:
+  Test::More: 0
+resources:
+  license: http://www.opensource.org/licenses/bsd-license.php
+version: 0.6600

File modules/Mail-LMLM/lib/Mail/LMLM.pm

 
 use vars qw($VERSION);
 
-$VERSION = '0.6500';
+$VERSION = '0.6600';
 
 use vars qw(@ISA);
 
 use Mail::LMLM::Types::Majordomo;
 use Mail::LMLM::Types::Listserv;
 use Mail::LMLM::Types::Mailman;
+use Mail::LMLM::Types::GoogleGroups;
 
 use vars qw(%mailing_list_classes);
 
 
 %mailing_list_classes = 
 (
-    map { $_ => $prefix . ucfirst($_) } 
-    ('egroups', 'ezmlm', 'listar', 'majordomo', 'listserv', 'mailman')
+    (
+        map { $_ => $prefix . ucfirst($_) } 
+        ('egroups', 'ezmlm', 'listar', 'majordomo', 'listserv', 'mailman')
+    ),
+    "google" => "GoogleGroups",
 );
 
 use vars qw(@render_what);

File modules/Mail-LMLM/lib/Mail/LMLM/Types/GoogleGroups.pm

+package Mail::LMLM::Types::GoogleGroups;
+
+use strict;
+use warnings;
+
+use Mail::LMLM::Types::Mailman;
+
+use vars qw(@ISA);
+
+@ISA=qw(Mail::LMLM::Types::Mailman);
+
+sub parse_args
+{
+    my $self = shift;
+
+    my $args = shift;
+
+    $self->{'homepage'} = "http://groups.google.com/group/";
+
+    $args = $self->SUPER::parse_args($args);
+    
+    my (@left, $key, $value);
+
+    while (scalar(@$args))
+    {
+        $key = shift(@$args);
+        $value = shift(@$args);
+
+        if ($key =~ /^-?(maintenance[-_]url)$/)
+        {
+            $self->{'maintenance_url'} = $value;
+        }
+        elsif ($key =~ /^-?(owner)$/)
+        {
+            $self->{'owner'} = $value;
+        }
+        else
+        {
+            push @left, $key, $value;
+        }
+    }
+
+    return \@left;
+}
+
+sub get_maintenance_url
+{
+    my $self = shift;
+
+    if (exists($self->{'maintenance_url'}))
+    {
+        return $self->{'maintenance_url'};
+    }
+    else
+    {
+        return $self->{'homepage'} . $self->get_group_base(). "/";
+    }
+        
+}
+
+sub group_form
+{
+    my $self = shift;
+
+    my $add = shift;
+
+    return (
+        ( $self->get_group_base() .
+        ($add ? ("-" . $add) : "") )
+        ,
+        $self->get_hostname()
+        );
+}
+
+sub _get_post_address
+{
+    my $self = shift;
+
+    return $self->group_form();
+}
+
+sub _get_owner_address
+{
+    my $self = shift;
+
+    if ($self->{owner})
+    {
+        return @{$self->{owner}};
+    }
+    else
+    {
+        return $self->group_form("owner");
+    }
+}
+
+1;
+
+__END__
+
+=head1 NAME
+
+Mail::LMLM::Types::GoogleGroups - mailing list type for Google groups mailing
+lists.
+
+=head1 METHODS
+
+=head2 parse_args
+
+Internal method, over-rides the L<Mail::LMLM::Types::Base>.
+
+=head2 get_maintenance_url
+
+Calculates the URL for the Mailman admin web-interface.
+
+=head2 group_form
+
+Calculates the group form.
+
+=head2 render_subscribe
+
+Over-rides the equivalent from L<Mail::LMLM::Types::Base>.
+
+=head2 render_unsubscribe
+
+Over-rides the equivalent from L<Mail::LMLM::Types::Base>.
+
+=head2 render_post
+
+Over-rides the equivalent from L<Mail::LMLM::Types::Base>.
+
+=head2 render_owner
+
+Over-rides the equivalent from L<Mail::LMLM::Types::Base>.
+
+=head2 render_maint_url
+
+Render a maintenance URL. Internal method.
+
+
+=head1 SEE ALSO
+
+L<Mail::LMLM::Types::Base>
+
+=head1 AUTHOR
+
+Shlomi Fish, L<http://www.shlomifish.org/>.
+

File modules/Mail-LMLM/perl-Mail-LMLM.spec

 Name: perl-Mail-LMLM
-Version: 0.6500
+Version: 0.6600
 Release: 1
 Group: Networking/Mail
 Source: http://www.cpan.org/modules/by-authors/id/S/SH/SHLOMIF/Mail-LMLM-%{version}.tar.gz