[Jifty-commit] r4558 - in Net-Jifty: .

jifty-commit at lists.jifty.org jifty-commit at lists.jifty.org
Wed Nov 28 17:07:51 EST 2007


Author: sartak
Date: Wed Nov 28 17:07:51 2007
New Revision: 4558

Modified:
   Net-Jifty/   (props changed)
   Net-Jifty/README
   Net-Jifty/lib/Net/Jifty.pm

Log:
 r45721 at onn:  sartak | 2007-11-28 17:06:34 -0500
 Doc updates, get rid of a temporary hack


Modified: Net-Jifty/README
==============================================================================
--- Net-Jifty/README	(original)
+++ Net-Jifty/README	Wed Nov 28 17:07:51 2007
@@ -26,6 +26,11 @@
     You can use this module directly, but you'll be better off subclassing
     it, such as what we've done for Net::Hiveminder.
 
+    This module also provides a number of convenient methods for writing
+    short scripts. For example, passing "use_config => 1" to "new" will look
+    at the config file for the username and password (or SID) of the user.
+    If neither is available, it will prompt the user for them.
+
   BUILD
     Each Net::Jifty object will do the following upon creation:
 
@@ -48,6 +53,15 @@
 
     This module currently only uses this to log in.
 
+  form_url_encoded_args ARGS
+    This will take a hash containing arguments and convert those arguments
+    into URL encoded form. I.e., (x => 1, y => 2, z => 3) becomes:
+
+      x=1&y=2&z=3
+
+    These are then ready to be appened to the URL on a GET or placed into
+    the content of a PUT.
+
   method METHOD, URL[, ARGS]
     This will perform a GET, POST, PUT, DELETE, etc using the internal
     LWP::UserAgent object.
@@ -145,12 +159,18 @@
     This will ask the user for her email and password. It may do so
     repeatedly until login is successful.
 
+  email_of ID
+    Retrieve user "ID"'s email address.
+
 SEE ALSO
     Jifty, Net::Hiveminder
 
 AUTHOR
     Shawn M Moore, "<sartak at bestpractical.com>"
 
+CONTRIBUTORS
+    Andrew Sterling Hanenkamp, "<hanenkamp at gmail.com>"
+
 BUGS
     Please report any bugs or feature requests to "bug-net-jifty at
     rt.cpan.org", or through the web interface at

Modified: Net-Jifty/lib/Net/Jifty.pm
==============================================================================
--- Net-Jifty/lib/Net/Jifty.pm	(original)
+++ Net-Jifty/lib/Net/Jifty.pm	Wed Nov 28 17:07:51 2007
@@ -46,6 +46,11 @@
 You can use this module directly, but you'll be better off subclassing it, such
 as what we've done for L<Net::Hiveminder>.
 
+This module also provides a number of convenient methods for writing short
+scripts. For example, passing C<< use_config => 1 >> to C<new> will look at
+the config file for the username and password (or SID) of the user. If neither
+is available, it will prompt the user for them.
+
 =cut
 
 has site => (
@@ -103,7 +108,7 @@
         my $args = shift;
 
         my $ua = LWP::UserAgent->new;
-        
+
         $ua->cookie_jar({});
         push @{ $ua->requests_redirectable }, qw( POST PUT DELETE );
 
@@ -238,13 +243,11 @@
     my $self = shift;
     my %args = @_;
 
-    my $uri;
+    my $uri = '';
     while (my ($key, $value) = each %args) {
-        $uri .= '&' . join '=', map { $self->escape($_) } $key, $value;
+        $uri .= join('=', map { $self->escape($_) } $key, $value) . '&';
     }
-
-    # it's easier than keeping a flag of "did we already append?"
-    $uri =~ s/^&//;
+    chop $uri;
 
     return $uri;
 }
@@ -516,9 +519,6 @@
     my $self = shift;
     my $ymd  = shift;
 
-    # XXX: this is a temporary hack until Hiveminder is pulled live
-    $ymd =~ s/ 00:00:00$//;
-
     my ($y, $m, $d) = $ymd =~ /^(\d\d\d\d)-(\d\d)-(\d\d)$/
         or confess "Invalid date passed to load_date: $ymd. Expected yyyy-mm-dd.";
 
@@ -708,7 +708,7 @@
 Before we get started, please enter your @{[ $self->site ]}
 username and password.
 
-This information will be stored in @{[ $self->config_file ]}, 
+This information will be stored in @{[ $self->config_file ]},
 should you ever need to change it.
 
 END_WELCOME
@@ -763,6 +763,10 @@
 
 Shawn M Moore, C<< <sartak at bestpractical.com> >>
 
+=head1 CONTRIBUTORS
+
+Andrew Sterling Hanenkamp, C<< <hanenkamp at gmail.com> >>
+
 =head1 BUGS
 
 Please report any bugs or feature requests to


More information about the Jifty-commit mailing list