[Jifty-commit] r4528 - in Net-Jifty: .
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Wed Nov 21 16:56:09 EST 2007
Author: sartak
Date: Wed Nov 21 16:56:06 2007
New Revision: 4528
Modified:
Net-Jifty/ (props changed)
Net-Jifty/Changes
Net-Jifty/README
Net-Jifty/lib/Net/Jifty.pm
Log:
r45515 at onn: sartak | 2007-11-21 16:54:50 -0500
Doc for 0.02
Modified: Net-Jifty/Changes
==============================================================================
--- Net-Jifty/Changes (original)
+++ Net-Jifty/Changes Wed Nov 21 16:56:06 2007
@@ -1,5 +1,9 @@
Revision history for Net-Jifty
+0.02 Wed Nov 21 16:45:38 2007
+ Support for config files
+ Some date/time and email methods
+
0.01 Tue Nov 20 22:25:37 2007
First version, released on an unsuspecting world.
Modified: Net-Jifty/README
==============================================================================
--- Net-Jifty/README (original)
+++ Net-Jifty/README Wed Nov 21 16:56:06 2007
@@ -2,7 +2,7 @@
Net::Jifty - interface to online Jifty applications
VERSION
- Version 0.01 released 20 Nov 07
+ Version 0.02 released 21 Nov 07
SYNOPSIS
use Net::Jifty;
@@ -26,10 +26,22 @@
You can use this module directly, but you'll be better off subclassing
it, such as what we've done for Net::Hiveminder.
+ BUILD
+ Each Net::Jifty object will do the following upon creation:
+
+ Read config
+ ..but only if you "use_config" is set to true.
+
+ Log in
+ ..unless a sid is available, in which case we're already logged in.
+
login
This assumes your site is using Jifty::Plugin::Authentication::Password.
If that's not the case, override this in your subclass.
+ This is called automatically when each Net::Jifty object is constructed
+ (unless a session ID is passed in).
+
call Action, Args
This uses the Jifty "web services" API to perform an action. This is NOT
the REST interface, though it resembles it to some degree.
@@ -44,7 +56,7 @@
parts properly escaped and joined with "/"). Your URL already has
"http://your.site/=/" prepended to it, and ".yml" appended to it, so you
only need to pass something like "model/YourApp.Model.Foo/name", or
- "["model", "YourApp.Model.Foo", "name"]".
+ "[qw/model YourApp.Model.Foo name]".
This will return the data structure returned by the Jifty application,
or throw an error.
@@ -90,6 +102,48 @@
escape Strings
URI escapes each string
+ load_date Date
+ Loads a yyyy-mm-dd date into a DateTime object.
+
+ email_eq Email, Email
+ Compares two email address. Returns true if they're equal, false if
+ they're not.
+
+ is_me Email
+ Returns true if the given email looks like it is the current user's.
+
+ load_config
+ This will return a hash reference of the user's preferences. Because
+ this method is designed for use in small standalone scripts, it has a
+ few peculiarities.
+
+ * It will "warn" if the permissions are too liberal on the config
+ file, and fix them.
+
+ * It will prompt the user for an email and password if necessary.
+ Given the email and password, it will attempt to log in using them.
+ If that fails, then it will try again.
+
+ * Upon successful login, it will write a new config consisting of the
+ options already in the config plus session ID, email, and password.
+
+ config_permissions
+ This will warn about (and fix) config files being readable by group or
+ others.
+
+ read_config_file
+ This transforms the config file to a hashref. It also does any
+ postprocessing needed, such as transforming localhost to 127.0.0.1 (due
+ to an obscure bug, probably in HTTP::Cookies)
+
+ write_config_file
+ This will write the config to disk. This is usually only done when a sid
+ is discovered, but may happen any time.
+
+ prompt_login_info
+ This will ask the user for her email and password. It may do so
+ repeatedly until login is successful.
+
SEE ALSO
Jifty, Net::Hiveminder
Modified: Net-Jifty/lib/Net/Jifty.pm
==============================================================================
--- Net-Jifty/lib/Net/Jifty.pm (original)
+++ Net-Jifty/lib/Net/Jifty.pm Wed Nov 21 16:56:06 2007
@@ -15,11 +15,11 @@
=head1 VERSION
-Version 0.01 released 20 Nov 07
+Version 0.02 released 21 Nov 07
=cut
-our $VERSION = '0.01';
+our $VERSION = '0.02';
=head1 SYNOPSIS
@@ -133,6 +133,24 @@
documentation => "Storage for the user's config",
);
+=head2 BUILD
+
+Each L<Net::Jifty> object will do the following upon creation:
+
+=over 4
+
+=item Read config
+
+..but only if you C<use_config> is set to true.
+
+=item Log in
+
+..unless a sid is available, in which case we're already logged in.
+
+=back
+
+=cut
+
sub BUILD {
my $self = shift;
More information about the Jifty-commit
mailing list