[Rt-commit] [svn] r912 - in RT-Client: . lib/LWP/UserAgent lib/RT t

autrijus at pallas.eruditorum.org autrijus at pallas.eruditorum.org
Mon May 17 10:40:50 EDT 2004


Author: autrijus
Date: Mon May 17 10:40:50 2004
New Revision: 912

Added:
   RT-Client/Changes
   RT-Client/README
   RT-Client/t/0-signature.t
Modified:
   RT-Client/   (props changed)
   RT-Client/MANIFEST
   RT-Client/MANIFEST.SKIP
   RT-Client/META.yml
   RT-Client/Makefile.PL
   RT-Client/lib/LWP/UserAgent/RTClient.pm
   RT-Client/lib/RT/Client.pm
Log:
 ----------------------------------------------------------------------
 r4956 at not:  autrijus | 2004-05-17T14:24:09.508780Z
 
 * This be 0.00_01, first CPAN release.
 ----------------------------------------------------------------------


Added: RT-Client/Changes
==============================================================================
--- (empty file)
+++ RT-Client/Changes	Mon May 17 10:40:50 2004
@@ -0,0 +1,3 @@
+[Changes for 0.00_01 - May 17, 2004]
+
+Initial CPAN Release.

Modified: RT-Client/MANIFEST
==============================================================================
--- RT-Client/MANIFEST	(original)
+++ RT-Client/MANIFEST	Mon May 17 10:40:50 2004
@@ -1,4 +1,4 @@
-bin/rt
+Changes
 inc/ExtUtils/AutoInstall.pm
 inc/Module/Install.pm
 inc/Module/Install/AutoInstall.pm
@@ -8,7 +8,6 @@
 inc/Module/Install/Include.pm
 inc/Module/Install/Makefile.pm
 inc/Module/Install/Metadata.pm
-inc/Module/Install/Scripts.pm
 inc/Module/Install/Win32.pm
 inc/Module/Install/WriteAll.pm
 lib/LWP/UserAgent/RTClient.pm
@@ -22,6 +21,8 @@
 MANIFEST			This list of files
 MANIFEST.SKIP
 META.yml
+README
 SIGNATURE
+t/0-signature.t
 t/1-procedural.t
 t/2-oo.t

Modified: RT-Client/MANIFEST.SKIP
==============================================================================
--- RT-Client/MANIFEST.SKIP	(original)
+++ RT-Client/MANIFEST.SKIP	Mon May 17 10:40:50 2004
@@ -1,3 +1,4 @@
+#defaults
 \bRCS\b
 \bCVS\b
 ,v$
@@ -5,7 +6,10 @@
 ^MANIFEST\.bak
 ^Makefile$
 ^blib/
+^bin/
 ^MakeMaker-\d
+^blibdirs
+^pm_to_blib
 ~$
 \.old$
 ^#.*#$

Modified: RT-Client/META.yml
==============================================================================
--- RT-Client/META.yml	(original)
+++ RT-Client/META.yml	Mon May 17 10:40:50 2004
@@ -1,7 +1,7 @@
 name: RT-Client
-version: 0.02
+version: 0.00_01
 abstract: A client of RT from Best Practical Solutions
-author: Jesse Vincent <jesse at bestpractical.com>
+author: Autrijus Tang <autrijus at autrijus.org>
 license: perl
 distribution_type: module
 requires:

Modified: RT-Client/Makefile.PL
==============================================================================
--- RT-Client/Makefile.PL	(original)
+++ RT-Client/Makefile.PL	Mon May 17 10:40:50 2004
@@ -3,12 +3,20 @@
 use strict;
 use inc::Module::Install;
 
+warn << '.';
+### PLEASE NOTE ##############################################
+
+This is *PRE-ALPHA* code.  Using this module for anything
+(except for learning purporses) is strongly discouraged.
+
+##############################################################
+.
+
 name		('RT-Client');
-author		('Jesse Vincent <jesse at bestpractical.com>');
+author		('Autrijus Tang <autrijus at autrijus.org>');
 abstract	('A client of RT from Best Practical Solutions');
 license		('perl');
-version		('0.02');
-install_script	('bin/rt');
+version_from	('lib/RT/Client.pm');
 
 requires(qw(
     XML::Atom		    0.07
@@ -18,6 +26,6 @@
 ));
 
 include('ExtUtils::AutoInstall');
-auto_install();
+auto_install( -config => { force => 1 } );
 
 WriteAll( sign => 1 );

Added: RT-Client/README
==============================================================================
--- (empty file)
+++ RT-Client/README	Mon May 17 10:40:50 2004
@@ -0,0 +1,24 @@
+This is the README file for RT::Client, a client of RT from
+Best Practical Solutions.
+
+Please type "perldoc RT::Client" after installation to see
+the module usage information.
+
+* Installation
+
+RT::Client uses the standard perl module install process:
+
+cpansign -v		# optional; see SIGNATURE for details
+perl Makefile.PL
+make			# or 'nmake' on Win32
+make test
+make install
+
+* Copyright
+
+Copyright 2004 by Autrijus Tang <autrijus at autrijus.org>.
+
+All rights reserved.  You can redistribute and/or modify
+this bundle under the same terms as Perl itself.
+
+See <http://www.perl.com/perl/misc/Artistic.html>.

Modified: RT-Client/lib/LWP/UserAgent/RTClient.pm
==============================================================================
--- RT-Client/lib/LWP/UserAgent/RTClient.pm	(original)
+++ RT-Client/lib/LWP/UserAgent/RTClient.pm	Mon May 17 10:40:50 2004
@@ -5,6 +5,20 @@
 use Digest::MD5 ();
 use LWP::UserAgent ();
 
+=head1 NAME
+
+LWP::UserAgent::RTClient - User Agent for RT-Atom authentication
+
+=head1 SYNOPSIS
+
+(internal use only)
+
+=head1 DESCRIPTION
+
+No user-serviceable parts inside.
+
+=cut
+
 my %ClientOf;
 
 sub new {
@@ -33,3 +47,22 @@
 }
 
 1;
+
+=head1 SEE ALSO
+
+L<RT::Client>
+
+=head1 AUTHORS
+
+Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
+
+=head1 COPYRIGHT
+
+Copyright 2004 by Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>.
+
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
+
+See L<http://www.perl.com/perl/misc/Artistic.html>
+
+=cut

Modified: RT-Client/lib/RT/Client.pm
==============================================================================
--- RT-Client/lib/RT/Client.pm	(original)
+++ RT-Client/lib/RT/Client.pm	Mon May 17 10:40:50 2004
@@ -1,9 +1,40 @@
 package RT::Client;
 
 use 5.006;
-our $VERSION = 0.01;
+our $VERSION = '0.00_01';
 our @ISA = 'XML::Atom::Client';
 
+=head1 NAME
+
+RT::Client - A client of RT from Best Practical Solutions
+
+=head1 VERSION
+
+This document describes version 0.00_01 of RT::Client, released May 17, 2004.
+
+=head1 SYNOPSIS
+
+    use RT::Client;
+
+    my $rt = RT::Client->new('http://root@password:localhost');
+
+    # ...see t/1-procedure.t for details...
+
+=head1 DESCRIPTION
+
+This module is a subclass of B<XML::Atom::Client>.  It implements a
+client API for RT's Atom interface.  Please refer to L<RT::Atom> for
+the server-side specification.
+
+For the time being, the unit tests in the F<t/> directory from the
+CPAN distribution remains the only documentation for this module.
+
+As the version number indicates, this is a very early proof-of-concept
+release for peer review; all interfaces are subject to change, and
+it should not be used in production.
+
+=cut
+
 use strict;
 use warnings;
 
@@ -36,6 +67,12 @@
 field 'errstr';
 field 'handle_error';
 
+=head1 CONSTRUCTORS AND ATTRIBUTES
+
+=head2 new
+
+=cut
+
 sub new {
     my %args = (@_ % 2) ? (URI => @_) : @_;
 
@@ -103,19 +140,46 @@
     return $class->new(Client => $self, Stream => $ref, URI => $res->base);
 }
 
+=head1 OBJECT-ORIENTED INTERFACE
+
+This interface is still under construction.
+
+=head1 PROCEDURE-ORIENTED INTERFACE
+
+The B<RT::Client> object implements seven operations, each taking a
+mandatory B<URI> parameter; see F<t/1-procedural.t> for details.
+
+=head2 describe
+
+=cut
+
 sub describe {
     my $res = $self->_request(@_, method => 'OPTIONS') or return undef;
     return $self->_spawn($res);
 }
 
+=head2 search
+
+Not yet implemented.
+
+=cut
+
 stub 'search';
 
+=head2 get
+
+=cut
+
 sub get {
     my $res = $self->_request(@_, method => 'GET'); # XXX - ditch this asap
     $res = $self->_request(@_, method => 'GET') or return undef;
     return $self->_spawn($res);
 }
 
+=head2 set
+
+=cut
+
 sub set {
     splice(@_, 1, 0, 'content') if (@_ == 2 and $_[0] ne 'URI');
     my $res = $self->_request(@_, method => 'GET'); # XXX - ditch this asap
@@ -123,10 +187,9 @@
     return $self->_spawn($res);
 }
 
-sub remove {
-    my $res = $self->_request(@_, method => 'DELETE') or return undef;
-    return $self->_spawn($res);
-}
+=head2 add
+
+=cut
 
 sub add {
     my ($uri, %args) = $self->_parse_args(@_);
@@ -134,12 +197,25 @@
     return $container->add(%args);
 }
 
+=head2 update
+
+=cut
+
 sub update {
     my ($uri, %args) = $self->_parse_args(@_);
     my $object = $self->describe($uri) or return undef;
     return $object->update(%args);
 }
 
+=head2 remove
+
+=cut
+
+sub remove {
+    my $res = $self->_request(@_, method => 'DELETE') or return undef;
+    return $self->_spawn($res);
+}
+
 sub _parse_args {
     my %args = (@_ % 2) ? (URI => @_) : @_;
     my $uri = delete $args{URI} or die "Must pass a URI";
@@ -207,53 +283,21 @@
 
 1;
 
-__END__
-
-=head1 NAME
-
-RT::Client - A client of RT from Best Practical Solutions
-
-=head1 SYNOPSIS
-
-    use RT::Client;
-
-    my $rt = RT::Client->new('http://root@password:localhost');
-
-    # search
-    my $results = $rt->search(
-        URI     => 'tickets',
-        Query   => "Priority > 5 and Status='new'",
-        OrderBy => 'Subject',
-        Order   => 'DESC',
-    );
+=head1 SEE ALSO
 
-    # narrow search scope
-    $results->search(Query => "Owner='autrijus'");
+L<RT::Atom>, L<XML::Atom::Client>
 
-    # perform actions
-    $results->delete(); # perform action
+=head1 AUTHORS
 
-    # get
-    my $user = $rt->Users('autrijus');
+Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
 
-    # switch identity - superuser only!
-    $rt->current_user('autrijus');
+=head1 COPYRIGHT
 
-    # switch back
-    $rt->current_user($rt->username);
+Copyright 2004 by Autrijus Tang.
 
-    # update
-    my $group = $rt->Groups(3)->update( Disabled => 1 );
+This program is free software; you can redistribute it and/or modify it
+under the same terms as Perl itself.
 
-    # add
-    my $queue = $rt->Queues->add( Name => 'Test Queue' );
-
-=head1 DESCRIPTION
-
-This module implements a client API for RT, based on the Atom API.
-Please refer to L<http://sfork.org/NoAuth/spec.html> for the server-side
-specification.
+See L<http://www.perl.com/perl/misc/Artistic.html>
 
 =cut
-
-# vim: expandtab shiftwidth=4

Added: RT-Client/t/0-signature.t
==============================================================================
--- (empty file)
+++ RT-Client/t/0-signature.t	Mon May 17 10:40:50 2004
@@ -0,0 +1,24 @@
+#!/usr/bin/perl
+
+use strict;
+print "1..1\n";
+
+if (!-s 'SIGNATURE') {
+    print "ok 1 # skip No signature file found\n";
+}
+elsif (!eval { require Module::Signature; 1 }) {
+    print "ok 1 # skip ",
+	    "Next time around, consider installing Module::Signature, ",
+	    "so you can verify the integrity of this distribution.\n";
+}
+elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
+    print "ok 1 # skip ",
+	    "Cannot connect to the keyserver\n";
+}
+else {
+    (Module::Signature::verify() == Module::Signature::SIGNATURE_OK())
+	or print "not ";
+    print "ok 1 # Valid signature\n";
+}
+
+__END__


More information about the Rt-commit mailing list