[Jifty-commit] jifty branch, moose, created. 04c83d3430e386e2587d4438222ee7d5b97fb3f4
Jifty commits
jifty-commit at lists.jifty.org
Thu Dec 10 14:09:46 EST 2009
The branch, moose has been created
at 04c83d3430e386e2587d4438222ee7d5b97fb3f4 (commit)
- Log -----------------------------------------------------------------
commit 03816003b9f55cae57638aa2eeaa2e231e6fd05c
Author: Audrey Tang <audreyt at audreyt.org>
Date: Thu Jul 13 19:33:16 2006 +0000
* Create the "moose" branch (for lack of a better name) for an experiment at:
- Jifty::Action::Param
- Jifty::Action::Schema
- REST-based Action Reflection+Discovery
- Improved constraints for validator generation
- and much more.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1558 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 5937aea8de79776b1e173a4cda62066c8b6eb6cf
Merge: 0381600 95709cf
Author: Audrey Tang <audreyt at audreyt.org>
Date: Fri Jul 14 23:23:30 2006 +0000
Merge from /jifty/trunk:1574
r16009 at T (orig r1564): trs | 2006-07-13 19:24:25 -0400
r14371 at zot: tom | 2006-07-13 19:24:06 -0400
More serious failure message, and don't imply that it's necessarily the server's fault.
r16010 at T (orig r1565): trs | 2006-07-13 19:37:20 -0400
r14373 at zot: tom | 2006-07-13 19:37:09 -0400
scrollToShow the calendar widget
r16011 at T (orig r1566): clkao | 2006-07-13 20:33:42 -0400
Misc cleanups.
r16021 at T (orig r1568): trs | 2006-07-14 00:19:42 -0400
r14414 at zot: tom | 2006-07-14 00:19:28 -0400
Only set active child on create if we have a request
r16022 at T (orig r1569): jesse | 2006-07-14 04:11:02 -0400
r13922 at pinglin: jesse | 2006-07-14 03:28:08 -0400
* Stop notification from flipping out if you use a scalar as the to
r13923 at pinglin: jesse | 2006-07-14 03:42:07 -0400
* fix the compile failure
r13924 at pinglin: jesse | 2006-07-14 03:42:34 -0400
* basic smoke test for jifty's notifications
r16023 at T (orig r1570): nelhage | 2006-07-14 15:09:11 -0400
Don't upgrade the database versions with schema --print. I'm not sure
if there's a good way to persuade JDBI to give us the SQL to print, so
we're just spitting out a warning for now, but that's better than the
old behavior.
r16024 at T (orig r1571): nelhage | 2006-07-14 15:09:58 -0400
Accidentally checked in a warn
r16025 at T (orig r1572): nelhage | 2006-07-14 15:13:58 -0400
Let's not blow up if an action has a result that's an unblessed
reference.
r16026 at T (orig r1573): nelhage | 2006-07-14 15:18:42 -0400
Jesse informs me UNIVERSAL::isa is the wrong thing. This should have the right effect.
r16045 at T (orig r1574): jesse | 2006-07-14 19:12:17 -0400
r13964 at pinglin: jesse | 2006-07-14 19:12:07 -0400
* Switched Jifty::Web::url to use uri.pm rather than "heuristics"
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1575 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 05ab972c1d09fd3fa8e51ce17187597bca6e4e4b
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 00:57:46 2006 +0000
* Moosification #1: Action and Action::Record
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1577 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index fd0c24f..1fd3db9 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -17,9 +17,15 @@ for how to return values from actions.
=cut
-use base qw/Jifty::Object Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors(qw(moniker argument_values order result sticky_on_success sticky_on_failure));
+use base qw/Jifty::Object/;
+use Moose;
+has moniker => qw( is rw isa Str );
+has argument_values => qw( is rw isa HashRef );
+has order => qw( is rw isa Int );
+has result => qw( is rw isa Jifty::Result );
+has sticky_on_success => qw( is rw isa Bool );
+has sticky_on_failure => qw( is rw isa Bool );
+no Moose;
=head1 COMMON METHODS
diff --git a/lib/Jifty/Action/Record.pm b/lib/Jifty/Action/Record.pm
index bfcac82..885b4b9 100644
--- a/lib/Jifty/Action/Record.pm
+++ b/lib/Jifty/Action/Record.pm
@@ -21,8 +21,10 @@ method.
=cut
use base qw/Jifty::Action/;
-
-__PACKAGE__->mk_accessors(qw(record _cached_arguments));
+use Moose;
+has record => qw( is rw isa Jifty::Record );
+has _cached_arguments => qw( is rw isa HashRef );
+no Moose;
=head1 METHODS
commit 7f1b9a91c113b0cf06e12279fe2a0c9564b8dc09
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 00:58:35 2006 +0000
* add Moose to dependencies in Makefile.PL
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1578 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index 3db766e..c1185f9 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -43,6 +43,7 @@ requires('Module::CoreList');
requires('Module::Install::Admin' => '0.50');
requires('Module::Pluggable' => '2.95');
requires('Module::Refresh' => '0.09');
+requires('Moose' => '0.11');
requires('Params::Validate');
requires('Pod::Simple'); #Pod::Simple::Text
requires('String::Koremutake');
commit 3b21f55f35c6da3143a68438161e23c6daf10efb
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 01:25:26 2006 +0000
* Moosification, step #3
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1579 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/API.pm b/lib/Jifty/API.pm
index 13c6e02..766358b 100644
--- a/lib/Jifty/API.pm
+++ b/lib/Jifty/API.pm
@@ -11,11 +11,13 @@ make up a Jifty application's API
=cut
use Jifty::Everything;
-use base qw/Class::Accessor::Fast Jifty::Object/;
+use base qw/Jifty::Object/;
require Module::Pluggable;
-__PACKAGE__->mk_accessors(qw(action_limits));
+use Moose;
+has action_limits => qw( is rw isa ArrayRef );
+no Moose;
=head1 METHODS
diff --git a/lib/Jifty/Collection.pm b/lib/Jifty/Collection.pm
index 005d360..a9d21b4 100644
--- a/lib/Jifty/Collection.pm
+++ b/lib/Jifty/Collection.pm
@@ -32,7 +32,7 @@ the C<pager> method to B<get> information related to paging.
=cut
-use base qw/Jifty::Object Jifty::DBI::Collection Class::Accessor::Fast/;
+use base qw/Jifty::Object Jifty::DBI::Collection/;
use Data::Page;
=head1 MODEL
@@ -46,7 +46,9 @@ not to B<set> it; use C<set_page_info> to set paging information.
=cut
-__PACKAGE__->mk_accessors(qw(pager));
+use Moose;
+has pager => qw( is rw isa Data::Page );
+no Moose;
=head2 add_record
diff --git a/lib/Jifty/Config.pm b/lib/Jifty/Config.pm
index 9753573..157eefe 100644
--- a/lib/Jifty/Config.pm
+++ b/lib/Jifty/Config.pm
@@ -21,11 +21,11 @@ use Hash::Merge;
Hash::Merge::set_behavior('RIGHT_PRECEDENT');
use File::Basename();
-use base qw/Class::Accessor::Fast/;
-
use vars qw/$CONFIG/;
-__PACKAGE__->mk_accessors(qw/stash/);
+use Moose;
+has stash => qw( is rw isa HashRef );
+no Moose;
=head1 METHODS
diff --git a/lib/Jifty/Continuation.pm b/lib/Jifty/Continuation.pm
index 57e24ec..4d2ba7a 100644
--- a/lib/Jifty/Continuation.pm
+++ b/lib/Jifty/Continuation.pm
@@ -39,11 +39,12 @@ L<Jifty::Dispatcher>.
use Jifty::Everything;
use Storable 'dclone';
-use base qw/Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors(qw(id parent
- request response code
- ));
+use Moose;
+has id => qw( is rw isa Str );
+has parent => qw( is rw isa Any ); # Jifty::Continuation | Str
+has request => qw( is rw isa Jifty::Request );
+has response => qw( is rw isa Jifty::Response );
+has code => qw( is rw isa CodeRef );
=head2 new PARAMHASH
diff --git a/lib/Jifty/CurrentUser.pm b/lib/Jifty/CurrentUser.pm
index f6e6001..9aaccfd 100644
--- a/lib/Jifty/CurrentUser.pm
+++ b/lib/Jifty/CurrentUser.pm
@@ -3,9 +3,13 @@ use strict;
package Jifty::CurrentUser;
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
-__PACKAGE__->mk_accessors(qw(is_superuser is_bootstrap_user user_object));
+use Moose;
+has is_superuser => qw( is rw isa Bool );
+has is_bootstrap_user => qw( is rw isa Bool );
+has user_object => qw( is rw isa Object );
+no Moose;
=head1 NAME
diff --git a/lib/Jifty/Handler.pm b/lib/Jifty/Handler.pm
index 802dc16..5bef56a 100644
--- a/lib/Jifty/Handler.pm
+++ b/lib/Jifty/Handler.pm
@@ -24,7 +24,6 @@ handlers.
=cut
-use base qw/Class::Accessor::Fast/;
use Module::Refresh ();
BEGIN {
@@ -47,7 +46,14 @@ BEGIN {
-__PACKAGE__->mk_accessors(qw(mason dispatcher static_handler cgi apache stash));
+use Moose;
+has mason => qw( is rw isa Jifty::View::Mason::Handler );
+has dispatcher => qw( is rw isa Any );
+has static_handler => qw( is rw isa Jifty::View::Static::Handler );
+has cgi => qw( is rw isa Object );
+has apache => qw( is rw isa Object );
+has stash => qw( is rw isa HashRef );
+no Moose;
=head2 new
diff --git a/lib/Jifty/LetMe.pm b/lib/Jifty/LetMe.pm
index 7b5b4ce..a76af8c 100755
--- a/lib/Jifty/LetMe.pm
+++ b/lib/Jifty/LetMe.pm
@@ -6,9 +6,16 @@ use Digest::MD5 ();
use Math::BigInt::Calc;
use String::Koremutake ();
-use base qw/Jifty::Object Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors ( qw/checksum_provided email path args until user/);
+use base qw/Jifty::Object/;
+
+use Moose;
+has checksum_provided => qw( is rw isa Str );
+has email => qw( is rw isa Str );
+has path => qw( is rw isa Str );
+has args => qw( is rw isa HashRef );
+has until => qw( is rw isa Str );
+has user => qw( is rw isa Object );
+no Moose;
=head1 NAME
diff --git a/lib/Jifty/Notification.pm b/lib/Jifty/Notification.pm
index b5ec3be..2c5720c 100644
--- a/lib/Jifty/Notification.pm
+++ b/lib/Jifty/Notification.pm
@@ -3,13 +3,21 @@ use strict;
package Jifty::Notification;
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
use Email::Send ();
use Email::Simple ();
use Email::Simple::Creator ();
-__PACKAGE__->mk_accessors(
- qw/body preface footer subject from _recipients _to_list to/);
+use Moose;
+has body => qw( is rw isa Str );
+has preface => qw( is rw isa Str );
+has footer => qw( is rw isa Str );
+has subject => qw( is rw isa Str );
+has from => qw( is rw isa Str );
+has to => qw( is rw isa Str );
+has _recipients => qw( is rw isa ArrayRef );
+has _to_list => qw( is rw isa ArrayRef );
+no Moose;
=head1 USAGE
diff --git a/lib/Jifty/Request.pm b/lib/Jifty/Request.pm
index 72fbb0f..f7768e6 100644
--- a/lib/Jifty/Request.pm
+++ b/lib/Jifty/Request.pm
@@ -3,8 +3,16 @@ use strict;
package Jifty::Request;
-use base qw/Jifty::Object Class::Accessor::Fast/;
-__PACKAGE__->mk_accessors(qw(_top_request arguments just_validating path continuation_id continuation_type continuation_path));
+use base qw/Jifty::Object/;
+use Moose;
+has _top_request => qw( is rw isa Jifty::Request );
+has arguments => qw( is rw isa HashRef );
+has just_validating => qw( is rw isa Bool );
+has path => qw( is rw isa Str );
+has continuation_id => qw( is rw isa Str );
+has continuation_type => qw( is rw isa Str );
+has continuation_path => qw( is rw isa Str );
+no Moose;
use Jifty::JSON;
use Jifty::YAML;
diff --git a/lib/Jifty/Response.pm b/lib/Jifty/Response.pm
index e66c730..f0ee149 100644
--- a/lib/Jifty/Response.pm
+++ b/lib/Jifty/Response.pm
@@ -15,9 +15,11 @@ L<Jifty::Result> objects of each L<Jifty::Action> that ran.
=cut
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
-__PACKAGE__->mk_accessors(qw(error));
+use Moose;
+has error => qw( is rw isa Str );
+no Moose;
=head2 new
commit 44af35996c7759addff85fb3ddf8f32181657671
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 01:55:36 2006 +0000
* Moosification #3 - all but form fields are moosified
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1581 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Request.pm b/lib/Jifty/Request.pm
index f7768e6..1c265cc 100644
--- a/lib/Jifty/Request.pm
+++ b/lib/Jifty/Request.pm
@@ -846,8 +846,15 @@ sub top_request {
}
package Jifty::Request::Action;
-use base 'Class::Accessor::Fast';
-__PACKAGE__->mk_accessors( qw/moniker arguments class order active modified has_run/);
+use Moose;
+has moniker => qw( is rw isa Str );
+has arguments => qw( is rw isa HashRef );
+has class => qw( is rw isa Str ); # Class, actually
+has order => qw( is rw isa Int );
+has active => qw( is rw isa Bool );
+has modified => qw( is rw isa Bool );
+has has_run => qw( is rw isa Bool );
+no Moose;
=head2 Jifty::Request::Action
@@ -891,8 +898,10 @@ sub delete {
package Jifty::Request::StateVariable;
-use base 'Class::Accessor::Fast';
-__PACKAGE__->mk_accessors (qw/key value/);
+use Moose;
+has key => qw( is rw isa Str );
+has value => qw( is rw isa Str );
+no Moose;
=head2 Jifty::Request::StateVariable
diff --git a/lib/Jifty/Result.pm b/lib/Jifty/Result.pm
index 9856920..8b64e72 100644
--- a/lib/Jifty/Result.pm
+++ b/lib/Jifty/Result.pm
@@ -17,9 +17,14 @@ L<Jifty::Response> object.
use Jifty::Everything;
-use base qw/Jifty::Object Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors(qw(failure action_class message _content));
+use base qw/Jifty::Object/;
+
+use Moose;
+has failure => qw( is rw isa Bool );
+has action_class => qw( is rw isa Str ); # Class
+has message => qw( is rw isa Str );
+has _content => qw( is rw isa HashRef );
+no Moose;
=head2 new
diff --git a/lib/Jifty/Script/App.pm b/lib/Jifty/Script/App.pm
index 9c12f81..f3f3ee5 100644
--- a/lib/Jifty/Script/App.pm
+++ b/lib/Jifty/Script/App.pm
@@ -2,14 +2,18 @@ use warnings;
use strict;
package Jifty::Script::App;
-use base qw'App::CLI::Command Class::Accessor::Fast';
+use base qw/App::CLI::Command/;
use File::Copy;
use Jifty::Config;
use Jifty::YAML;
use File::Basename;
-__PACKAGE__->mk_accessors(qw/prefix dist_name mod_name/);
+use Moose;
+has prefix => qw( is rw isa Str );
+has dist_name => qw( is rw isa Str );
+has mod_name => qw( is rw isa Str );
+no Moose;
=head1 NAME
diff --git a/lib/Jifty/Script/Plugin.pm b/lib/Jifty/Script/Plugin.pm
index c7da455..259cef4 100644
--- a/lib/Jifty/Script/Plugin.pm
+++ b/lib/Jifty/Script/Plugin.pm
@@ -2,14 +2,19 @@ use warnings;
use strict;
package Jifty::Script::Plugin;
-use base qw'App::CLI::Command Class::Accessor::Fast';
+use base qw/App::CLI::Command/;
use File::Copy;
use Jifty::Config;
use Jifty::YAML;
use File::Basename;
-__PACKAGE__->mk_accessors(qw/prefix dist_name mod_name lib_dir/);
+use Moose;
+has prefix => qw( is rw isa Str );
+has dist_name => qw( is rw isa Str );
+has mod_name => qw( is rw isa Str );
+has lib_dir => qw( is rw isa Str );
+no Moose;
=head1 NAME
diff --git a/lib/Jifty/Script/Po.pm b/lib/Jifty/Script/Po.pm
index 8b1ce79..0a8bdd0 100644
--- a/lib/Jifty/Script/Po.pm
+++ b/lib/Jifty/Script/Po.pm
@@ -2,7 +2,7 @@ use warnings;
use strict;
package Jifty::Script::Po;
-use base qw'App::CLI::Command Class::Accessor::Fast';
+use base qw/App::CLI::Command/;
use File::Copy;
use Jifty::Config;
@@ -14,7 +14,9 @@ our $MIME = MIME::Types->new();
our $LMExtract = Locale::Maketext::Extract->new;
use constant USE_GETTEXT_STYLE => 1;
-__PACKAGE__->mk_accessors(qw/language/);
+use Moose;
+has language => qw( is rw isa Str );
+no Moosep;
=head1 NAME
diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index 76318c6..e925f5c 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -19,10 +19,14 @@ use Digest::MD5 qw(md5_hex);
use base qw/Class::Accessor::Fast Class::Data::Inheritable Jifty::Object/;
use vars qw/$SERIAL @JS_INCLUDES/;
-
-__PACKAGE__->mk_accessors(
- qw(next_page request response session temporary_current_user _current_user)
-);
+use Moose;
+has next_page => qw( is rw isa Str );
+has request => qw( is rw isa Jifty::Request );
+has response => qw( is rw isa Jifty::Response );
+has session => qw( is rw isa Jifty::Web::Session );
+has temporary_current_user => qw( is rw isa Object );
+has _current_user => qw( is rw isa Object );
+no Moose;
__PACKAGE__->mk_classdata($_)
for qw(cached_css cached_css_digest
diff --git a/lib/Jifty/Web/Form.pm b/lib/Jifty/Web/Form.pm
index 0917339..13a98b2 100644
--- a/lib/Jifty/Web/Form.pm
+++ b/lib/Jifty/Web/Form.pm
@@ -5,7 +5,13 @@ package Jifty::Web::Form;
use base qw/Jifty::Object Class::Accessor::Fast/;
-__PACKAGE__->mk_accessors(qw(actions printed_actions name call is_open));
+use Moose;
+has actions => qw( is rw isa Any );
+has printed_actions => qw( is rw isa Any );
+has name => qw( is rw isa Str );
+has call => qw( is rw isa Str );
+has is_open => qw( is rw isa Bool );
+no Moose;
=head2 new ARGS
diff --git a/lib/Jifty/Web/Menu.pm b/lib/Jifty/Web/Menu.pm
index aabc1b3..1b45ba3 100644
--- a/lib/Jifty/Web/Menu.pm
+++ b/lib/Jifty/Web/Menu.pm
@@ -1,9 +1,14 @@
package Jifty::Web::Menu;
-use base qw/Class::Accessor::Fast/;
use URI;
-__PACKAGE__->mk_accessors(qw(label parent sort_order link escape_label class));
+use Moose;
+has label => qw( is rw isa Str );
+has parent => qw( is rw isa Jifty::Web::Menu );
+has sort_order => qw( is rw isa Int );
+has link => qw( is rw isa Jifty::Web::Link );
+has escape_label => qw( is rw isa Bool );
+no Moose;
=head2 new PARAMHASH
diff --git a/lib/Jifty/Web/PageRegion.pm b/lib/Jifty/Web/PageRegion.pm
index c40cb76..ea14f65 100644
--- a/lib/Jifty/Web/PageRegion.pm
+++ b/lib/Jifty/Web/PageRegion.pm
@@ -14,9 +14,15 @@ can be updated via AJAX or via query parameters.
=cut
-use base qw/Jifty::Object Class::Accessor::Fast/;
-__PACKAGE__->mk_accessors(qw(name default_path default_arguments qualified_name parent region_wrapper));
-use Jifty::JSON;
+use base qw/Jifty::Object/;
+use Moose;
+has name => qw( is rw isa Str );
+has default_path => qw( is rw isa Str );
+has default_arguments => qw( is rw isa HashRef );
+has qualified_name => qw( is rw isa Str );
+has parent => qw( is rw isa Jifty::Web::PageRegion );
+has region_wrapper => qw( is rw isa Bool ); # XXX - bad name
+no Moose;
=head2 new PARAMHASH
diff --git a/t/03-form-protocol.t b/t/03-form-protocol.t
index 577e10b..b0d9102 100644
--- a/t/03-form-protocol.t
+++ b/t/03-form-protocol.t
@@ -18,6 +18,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -45,6 +47,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -53,6 +57,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -83,6 +89,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -91,6 +99,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -120,6 +130,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -149,6 +161,8 @@ actions:
class: DoSomething
active: 0
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -157,6 +171,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -186,6 +202,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -194,6 +212,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -226,6 +246,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -234,6 +256,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -266,6 +290,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -274,6 +300,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
@@ -301,6 +329,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -327,6 +357,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -352,6 +384,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 96
something: else
@@ -380,6 +414,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -388,6 +424,8 @@ actions:
class: DoThat
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: feepy
@@ -420,6 +458,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 23
something: else
@@ -428,6 +468,8 @@ actions:
class: DoSomething
active: 1
has_run: 0
+ order: ~
+ modified: ~
arguments:
id: 42
something: bla
commit 0dd895317ef165592b6067abc299aef1a74db8c9
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 02:03:24 2006 +0000
* Moosification #4 - Jifty::Request
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1582 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Request.pm b/lib/Jifty/Request.pm
index 1c265cc..d93f218 100644
--- a/lib/Jifty/Request.pm
+++ b/lib/Jifty/Request.pm
@@ -914,8 +914,13 @@ A small package that encapsulates the bits of a state variable:
=cut
package Jifty::Request::Fragment;
-use base 'Class::Accessor::Fast';
-__PACKAGE__->mk_accessors( qw/name path wrapper arguments parent/ );
+use Moose;
+has name => qw( is rw isa Str );
+has path => qw( is rw isa Str );
+has wrapper => qw( is rw isa Bool ); # XXX - bad name
+has arguments => qw( is rw isa HashRef );
+has parent => qw( is rw isa Any );
+no Moose;
=head2 Jifty::Request::Fragment
commit 51baf4701b4a14ef33c659f5d3e5cc7a142a1121
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 03:23:13 2006 +0000
* Class::Accessor now goes away.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1583 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index c1185f9..e377ba0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,6 @@ requires(perl => '5.8.3');
requires('App::CLI' => 0.03 ); # App::CLI::Command::Help App::CLI::Command
requires('Cache::Cache'); #Cache::FileCache
requires('Calendar::Simple');
-requires('Class::Accessor'); # Class::Accessor::Fast
requires('Class::Accessor::Named');
requires('Class::Container');
requires('Class::Data::Inheritable');
diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index e925f5c..2720607 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -16,7 +16,7 @@ use CGI::Cookie;
use XML::Writer;
use CSS::Squish;
use Digest::MD5 qw(md5_hex);
-use base qw/Class::Accessor::Fast Class::Data::Inheritable Jifty::Object/;
+use base qw/Class::Data::Inheritable Jifty::Object/;
use vars qw/$SERIAL @JS_INCLUDES/;
use Moose;
diff --git a/lib/Jifty/Web/Form.pm b/lib/Jifty/Web/Form.pm
index 13a98b2..46e0303 100644
--- a/lib/Jifty/Web/Form.pm
+++ b/lib/Jifty/Web/Form.pm
@@ -3,7 +3,7 @@ use strict;
package Jifty::Web::Form;
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
use Moose;
has actions => qw( is rw isa Any );
diff --git a/lib/Jifty/Web/Form/Clickable.pm b/lib/Jifty/Web/Form/Clickable.pm
index d9175fb..e766567 100644
--- a/lib/Jifty/Web/Form/Clickable.pm
+++ b/lib/Jifty/Web/Form/Clickable.pm
@@ -23,13 +23,18 @@ L<Jifty::Web::Form::Element/accessors>.
=cut
-sub accessors {
- shift->SUPER::accessors,
- qw(url escape_label tooltip continuation call returns submit preserve_state render_as_button render_as_link);
-}
-__PACKAGE__->mk_accessors(
- qw(url escape_label tooltip continuation call returns submit preserve_state render_as_button render_as_link)
-);
+use Moose;
+has url => qw( is rw isa Str );
+has escape_label => qw( is rw isa Bool );
+has tooltip => qw( is rw isa Str );
+has continuation => qw( is rw isa Any ); # Jifty::Continuation | Str
+has call => qw( is rw isa Any ); # Jifty::Continuation | Str
+has returns => qw( is rw isa HashRef );
+has submit => qw( is rw isa ArrayRef );
+has preserve_state => qw( is rw isa Str );
+has render_as_button => qw( is rw isa Str );
+has render_as_link => qw( is rw isa Str );
+no Moose;
=head2 new PARAMHASH
@@ -166,7 +171,8 @@ sub new {
}
}
- for my $field ( $self->accessors() ) {
+ for my $attr ( $self->meta->compute_all_applicable_attributes ) {
+ my $field = $attr->name;
$self->$field( $args{$field} ) if exists $args{$field};
}
@@ -430,8 +436,13 @@ sub complete_url {
sub _defined_accessor_values {
my $self = shift;
- return { map { my $val = $self->$_; defined $val ? ($_ => $val) : () }
- $self->SUPER::accessors };
+ my @superclasses = $self->meta->superclasses;
+ my @attrs = map { $_->meta->compute_all_applicable_attributes } @superclasses;
+ return { map {
+ my $name = $_->name;
+ my $val = $self->$name;
+ defined $val ? ($name => $val) : ()
+ } @attrs };
}
=head2 as_link
diff --git a/lib/Jifty/Web/Form/Element.pm b/lib/Jifty/Web/Form/Element.pm
index 0f3a563..d6384b9 100644
--- a/lib/Jifty/Web/Form/Element.pm
+++ b/lib/Jifty/Web/Form/Element.pm
@@ -105,9 +105,18 @@ can be used to change the duration of the effect, for instance.
=cut
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
use Jifty::JSON;
+use Moose;
+has onclick => qw( is rw isa Any );
+has class => qw( is rw isa Str default ) => '';
+has key_binding => qw( is rw isa Str );
+has id => qw( is rw isa Str );
+has label => qw( is rw isa Str );
+has tooltip => qw( is rw isa Str );
+no Moose;
+
=head2 handlers
Currently, the only supported event handlers are C<onclick>.
@@ -119,17 +128,6 @@ error from your browser.
sub handlers { qw(onclick); }
-=head2 accessors
-
-Any descendant of L<Jifty::Web::Form::Element> should be able to
-accept any of the event handlers (above) as one of the keys to its
-C<new> parameter hash.
-
-=cut
-
-sub accessors { shift->handlers, qw(class key_binding id label tooltip) }
-__PACKAGE__->mk_accessors(qw(onclick class key_binding id label tooltip));
-
=head2 javascript
Returns the javascript necessary to make the events happen.
diff --git a/lib/Jifty/Web/Form/Field.pm b/lib/Jifty/Web/Form/Field.pm
index c928850..0c40c60 100644
--- a/lib/Jifty/Web/Form/Field.pm
+++ b/lib/Jifty/Web/Form/Field.pm
@@ -1,28 +1,38 @@
-=begin properties
-
-constructor
-canonicalizer
-available_values
-ajax_validates
-autocompleter
-
-default_value
-valid_values
-validator
-render_as
-label
-hints
-length
-mandatory
-
-=end properties
-
-=cut
-
use warnings;
use strict;
package Jifty::Web::Form::Field;
+use Moose;
+has name => qw( is rw isa Str );
+has label => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ return $self->name;
+};
+has input_name => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ my $action = $self->action;
+ return $action ? $self->action->form_field_name( $self->name )
+ : '';
+};
+has type => qw( is rw isa Str default text );
+has sticky => qw( is rw isa Str );
+has sticky_value => qw( is rw isa Any );
+has default_value => qw( is rw isa Any );
+has action => qw( is rw isa Any weak_ref 1 );
+has mandatory => qw( is rw isa Str );
+has ajax_validates => qw( is rw isa Str );
+has ajax_canonicalizes => qw( is rw isa Str );
+has autocompleter => qw( is rw isa CodeRef );
+has preamble => qw( is rw isa Str );
+has hints => qw( is rw isa Str );
+has render_mode => qw( is rw isa Str default update );
+has length => qw( is rw isa Str );
+has element_id => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ return $self->input_name."-".Jifty->web->serial;
+};
+no Moose;
+
=head1 NAME
@@ -47,32 +57,28 @@ use Scalar::Util;
use HTML::Entities;
use overload '""' => sub { shift->render}, bool => sub { 1 };
-=head2 new
+=head2 accessors
+
+Lists the accessors that are able to be called from within a call to
+C<new>. Subclasses should extend this list.
+
+=cut
+
+=head2 BUILD
Creates a new L<Jifty::Web::Form::Field> (possibly magically blessing into a subclass).
Should only be called from C<< $action->arguments >>.
=cut
-sub new {
- my $class = shift;
- my $self = $class->SUPER::new(
- { type => 'text',
- class => '',
- input_name => '',
- default_value => '',
- sticky_value => '',
- render_mode => 'update' });
+sub BUILD {
+ my $self = shift;
my $args = ref($_[0]) ? $_[0] : {@_};
my $subclass = ucfirst($args->{render_as} || $args->{type} || 'text');
$subclass = 'Jifty::Web::Form::Field::' . $subclass unless $subclass =~ /::/;
bless $self, $subclass if Jifty::Util->require($subclass);
- for my $field ( $self->accessors() ) {
- $self->$field( $args->{$field} ) if exists $args->{$field};
- }
-
# If they key and/or value imply that this argument is going to be
# a mapped argument, then do the mapping and mark the field as hidden.
my ($key, $value) = Jifty::Request::Mapper->query_parameters($self->input_name, $self->current_value);
@@ -93,16 +99,6 @@ sub new {
}
-=head2 accessors
-
-Lists the accessors that are able to be called from within a call to
-C<new>. Subclasses should extend this list.
-
-=cut
-
-sub accessors { shift->SUPER::accessors(), qw(name label input_name type sticky sticky_value default_value action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints render_mode length _element_id); }
-__PACKAGE__->mk_accessors(qw(name _label _input_name type sticky sticky_value default_value _action mandatory ajax_validates ajax_canonicalizes autocompleter preamble hints render_mode length _element_id));
-
=head2 name [VALUE]
Gets or sets the name of the field. This is seperate from the name of
@@ -177,22 +173,6 @@ based on the moniker of the action and the name of the form.
=cut
-sub input_name {
- my $self = shift;
-
-# If we've been explicitly handed a name, we should run with it.
-# Otherwise, we should ask our action, how to turn our "name"
-# into a form input name.
-
- my $ret = $self->_input_name(@_);
- return $ret if $ret;
-
- my $action = $self->action;
- return $action ? $self->action->form_field_name( $self->name )
- : '';
-}
-
-
=head2 fallback_name
Return the form field's fallback name. This should be used to create a
@@ -226,14 +206,6 @@ object.
=cut
-sub label {
- my $self = shift;
- my $val = $self->_label(@_);
- defined $val ? $val : $self->name;
-
-}
-
-
=head2 element_id
Returns a unique C<id> attribute for this field based on the field name. This is
@@ -242,11 +214,6 @@ consistent for the life of the L<Jifty::Web::Form::Field> object but isn't predi
=cut
-sub element_id {
- my $self = shift;
- return $self->_element_id || $self->_element_id( $self->input_name ."-".Jifty->web->serial);
-}
-
=head2 action [VALUE]
Gets or sets the L<Jifty::Action> object that this
@@ -256,16 +223,6 @@ L<Jifty::Web::Form::Field/form_field>.
=cut
-sub action {
- my $self = shift;
- my $action = $self->_action(@_);
-
- # If we're setting the action, we need to weaken
- # the reference to not get caught in a loop
- Scalar::Util::weaken( $self->{_action} ) if @_;
- return $action;
-}
-
=head2 current_value
Gets the current value we should be using for this form field.
diff --git a/lib/Jifty/Web/Form/Field/Button.pm b/lib/Jifty/Web/Form/Field/Button.pm
index e1beaf9..744b7a0 100644
--- a/lib/Jifty/Web/Form/Field/Button.pm
+++ b/lib/Jifty/Web/Form/Field/Button.pm
@@ -4,7 +4,10 @@ use strict;
package Jifty::Web::Form::Field::Button;
use base qw/Jifty::Web::Form::Field/;
-__PACKAGE__->mk_accessors(qw/button_as_link/);
+
+use Moose;
+has button_as_link => qw( is rw isa Bool );
+no Moose;
=head2 accessors
@@ -14,8 +17,6 @@ button is reworked in javascript to appear as a link.
=cut
-sub accessors { shift->SUPER::accessors(), 'button_as_link' }
-
=head2 render_widget
Renders the button widget.
diff --git a/lib/Jifty/Web/Form/Field/Checkbox.pm b/lib/Jifty/Web/Form/Field/Checkbox.pm
index d1c4db8..521dd14 100644
--- a/lib/Jifty/Web/Form/Field/Checkbox.pm
+++ b/lib/Jifty/Web/Form/Field/Checkbox.pm
@@ -4,7 +4,10 @@ use strict;
package Jifty::Web::Form::Field::Checkbox;
use base qw/Jifty::Web::Form::Field/;
-__PACKAGE__->mk_accessors(qw/checked value/);
+use Moose;
+has checked => qw( is rw isa Bool );
+has value => qw( is rw isa Str );
+no Moose;
=head2 accessors
@@ -14,8 +17,6 @@ L<Jifty::Web::Form::Field>'s default accessors. C<value> defaults to
=cut
-sub accessors { shift->SUPER::accessors(), 'checked' , 'value' }
-
=head2 render_widget
Renders the checkbox widget.
diff --git a/lib/Jifty/Web/Form/Field/Textarea.pm b/lib/Jifty/Web/Form/Field/Textarea.pm
index 42f76e4..0a61574 100644
--- a/lib/Jifty/Web/Form/Field/Textarea.pm
+++ b/lib/Jifty/Web/Form/Field/Textarea.pm
@@ -5,7 +5,10 @@ package Jifty::Web::Form::Field::Textarea;
use base qw/Jifty::Web::Form::Field/;
-__PACKAGE__->mk_accessors(qw(rows cols));
+use Moose;
+has rows => qw( is rw isa Int );
+has cols => qw( is rw isa Int );
+no Moose;
=head2 accessors
@@ -14,8 +17,6 @@ L<Jifty::Web::Form::Field>'s default accessors.
=cut
-sub accessors { shift->SUPER::accessors(), 'rows', 'cols' }
-
=head2 render_widget
Renders the textarea widget.
diff --git a/lib/Jifty/Web/Form/Link.pm b/lib/Jifty/Web/Form/Link.pm
index 15b8f66..e274ebf 100644
--- a/lib/Jifty/Web/Form/Link.pm
+++ b/lib/Jifty/Web/Form/Link.pm
@@ -15,10 +15,17 @@ generates L<Jifty::Web::Form::Link>s.
=cut
+use Moose;
+has url => qw( is rw isa Str lazy 1 default ) => sub { $ENV{PATH_INFO} };
+has escape_label => qw( is rw isa Bool default 1 );
+has tooltip => qw( is rw isa Str );
+has target => qw( is rw isa Str );
+no Moose;
+
use base 'Jifty::Web::Form::Element';
# Since we don't inherit from Form::Field, we don't otherwise stringify
-use overload '""' => sub { shift->render}, bool => sub { 1 };
+use overload '""' => sub { shift->render }, bool => sub { 1 };
=head2 accessors
@@ -28,9 +35,6 @@ L<Jifty::Web::Form::Element/accessors>.
=cut
-sub accessors { shift->SUPER::accessors(), qw(url escape_label tooltip target); }
-__PACKAGE__->mk_accessors(qw(url escape_label tooltip target));
-
=head2 new PARAMHASH
Creates a new L<Jifty::Web::Form::Link> object. Possible arguments to
@@ -63,24 +67,6 @@ Any parameter which L<Jifty::Web::Form::Element/new> can take.
=cut
-sub new {
- my $class = shift;
- my $self = $class->SUPER::new(
- { url => $ENV{PATH_INFO},
- label => "Click me!",
- tooltip => undef,
- escape_label => 1,
- class => '',
- target => '' }
- );
- my $args = ref($_[0]) ? $_[0] : {@_};
-
- for my $field ( keys %$args ) {
- $self->$field( $args->{$field} );
- }
-
- return $self;
-}
=head2 url [URL]
diff --git a/lib/Jifty/Web/Menu.pm b/lib/Jifty/Web/Menu.pm
index 1b45ba3..0a7a2c4 100644
--- a/lib/Jifty/Web/Menu.pm
+++ b/lib/Jifty/Web/Menu.pm
@@ -1,15 +1,15 @@
package Jifty::Web::Menu;
-use URI;
-
use Moose;
has label => qw( is rw isa Str );
-has parent => qw( is rw isa Jifty::Web::Menu );
+has parent => qw( is rw isa Jifty::Web::Menu weak_ref 1 );
has sort_order => qw( is rw isa Int );
-has link => qw( is rw isa Jifty::Web::Link );
+has link => qw( is rw isa Any ); # Jifty::Web::Link;
has escape_label => qw( is rw isa Bool );
no Moose;
+use URI;
+
=head2 new PARAMHASH
Creates a new L<Jifty::Web::Menu> object. Possible keys in the
@@ -22,8 +22,7 @@ each option's use.
sub new {
my $package = shift;
# Class::Accessor only wants a hashref;
- $package->SUPER::new( ref($_[0]) eq 'HASH' ? @_ : {@_} );
-
+ $package->meta->new_object( ref($_[0]) eq 'HASH' ? %{$_[0]} : @_ );
}
commit d8c32e3999259b520af9b32155121c213a8760b6
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 05:39:01 2006 +0000
* compat with accessor
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1584 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index e377ba0..8e2f5bd 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,6 +6,7 @@ requires(perl => '5.8.3');
requires('App::CLI' => 0.03 ); # App::CLI::Command::Help App::CLI::Command
requires('Cache::Cache'); #Cache::FileCache
requires('Calendar::Simple');
+requires('Class::Accessor');
requires('Class::Accessor::Named');
requires('Class::Container');
requires('Class::Data::Inheritable');
diff --git a/lib/Jifty/Object.pm b/lib/Jifty/Object.pm
index 1e90734..739f0f2 100644
--- a/lib/Jifty/Object.pm
+++ b/lib/Jifty/Object.pm
@@ -3,6 +3,7 @@ use strict;
package Jifty::Object;
+use base qw(Class::Accessor::Fast); # compat only
use Log::Log4perl;
use HTML::Entities;
use Carp;
commit bfef85988b36dde9687bd1783289692f1c894f1c
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 05:41:59 2006 +0000
* add back Class::Accessor::Fast for BTDT
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1585 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index 8e2f5bd..e877950 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,7 @@ requires(perl => '5.8.3');
requires('App::CLI' => 0.03 ); # App::CLI::Command::Help App::CLI::Command
requires('Cache::Cache'); #Cache::FileCache
requires('Calendar::Simple');
-requires('Class::Accessor');
+requires('Class::Accessor::Fast');
requires('Class::Accessor::Named');
requires('Class::Container');
requires('Class::Data::Inheritable');
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index 1fd3db9..82bf303 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -18,6 +18,7 @@ for how to return values from actions.
use base qw/Jifty::Object/;
+use base qw(Class::Accessor::Fast); # compat only
use Moose;
has moniker => qw( is rw isa Str );
has argument_values => qw( is rw isa HashRef );
diff --git a/lib/Jifty/Notification.pm b/lib/Jifty/Notification.pm
index 2c5720c..db388cb 100644
--- a/lib/Jifty/Notification.pm
+++ b/lib/Jifty/Notification.pm
@@ -4,6 +4,7 @@ use strict;
package Jifty::Notification;
use base qw/Jifty::Object/;
+use base qw(Class::Accessor::Fast); # compat only
use Email::Send ();
use Email::Simple ();
use Email::Simple::Creator ();
diff --git a/lib/Jifty/Object.pm b/lib/Jifty/Object.pm
index 739f0f2..1e90734 100644
--- a/lib/Jifty/Object.pm
+++ b/lib/Jifty/Object.pm
@@ -3,7 +3,6 @@ use strict;
package Jifty::Object;
-use base qw(Class::Accessor::Fast); # compat only
use Log::Log4perl;
use HTML::Entities;
use Carp;
commit 7de31491ef072613296e551bacb2e39f023792ca
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 05:46:55 2006 +0000
* Remove Class::Accessor::Fast again for a _mk_accessor compat.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1586 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index e877950..e377ba0 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -6,7 +6,6 @@ requires(perl => '5.8.3');
requires('App::CLI' => 0.03 ); # App::CLI::Command::Help App::CLI::Command
requires('Cache::Cache'); #Cache::FileCache
requires('Calendar::Simple');
-requires('Class::Accessor::Fast');
requires('Class::Accessor::Named');
requires('Class::Container');
requires('Class::Data::Inheritable');
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index 82bf303..1fd3db9 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -18,7 +18,6 @@ for how to return values from actions.
use base qw/Jifty::Object/;
-use base qw(Class::Accessor::Fast); # compat only
use Moose;
has moniker => qw( is rw isa Str );
has argument_values => qw( is rw isa HashRef );
diff --git a/lib/Jifty/Notification.pm b/lib/Jifty/Notification.pm
index db388cb..2c5720c 100644
--- a/lib/Jifty/Notification.pm
+++ b/lib/Jifty/Notification.pm
@@ -4,7 +4,6 @@ use strict;
package Jifty::Notification;
use base qw/Jifty::Object/;
-use base qw(Class::Accessor::Fast); # compat only
use Email::Send ();
use Email::Simple ();
use Email::Simple::Creator ();
diff --git a/lib/Jifty/Object.pm b/lib/Jifty/Object.pm
index 1e90734..da25989 100644
--- a/lib/Jifty/Object.pm
+++ b/lib/Jifty/Object.pm
@@ -8,6 +8,11 @@ use HTML::Entities;
use Carp;
use Scalar::Util qw(refaddr);
+sub mk_accessor {
+ my $class = shift;
+ $class->meta->_process_attribute($_ => qw( is rw )) for @_;
+}
+
=head1 Jifty::Object
C<Jifty::Object> is the superclass of most of Jifty's objects. It is
commit c83bcbb4d8b97dc767daaf3fec8e49ab4f3d5301
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 05:47:36 2006 +0000
* mk_accessors, not mk_accessor
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1587 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Object.pm b/lib/Jifty/Object.pm
index da25989..a7d0463 100644
--- a/lib/Jifty/Object.pm
+++ b/lib/Jifty/Object.pm
@@ -8,7 +8,7 @@ use HTML::Entities;
use Carp;
use Scalar::Util qw(refaddr);
-sub mk_accessor {
+sub mk_accessors {
my $class = shift;
$class->meta->_process_attribute($_ => qw( is rw )) for @_;
}
commit 615de89961b1e75541015e7f9d8406520dcb654f
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 06:10:34 2006 +0000
* fix type constraint: "to" is not Str
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1588 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Notification.pm b/lib/Jifty/Notification.pm
index 2c5720c..c0884ef 100644
--- a/lib/Jifty/Notification.pm
+++ b/lib/Jifty/Notification.pm
@@ -14,7 +14,7 @@ has preface => qw( is rw isa Str );
has footer => qw( is rw isa Str );
has subject => qw( is rw isa Str );
has from => qw( is rw isa Str );
-has to => qw( is rw isa Str );
+has to => qw( is rw isa Any ); # Object to deliver to
has _recipients => qw( is rw isa ArrayRef );
has _to_list => qw( is rw isa ArrayRef );
no Moose;
commit b4c6d313a00174b14db11dcae32da276094b436b
Merge: 615de89 d9cfaed
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Sat Jul 15 06:15:31 2006 +0000
Merge from /jifty/trunk:1580
r13970 at pinglin (orig r1576): jpeacock | 2006-07-14 20:32:39 -0400
r1270 at dsl092-168-024: jpeacock | 2006-07-14 20:31:25 -0400
Resolve inconsistent filenames vs packages
r13974 at pinglin (orig r1580): jesse | 2006-07-14 21:27:28 -0400
r13968 at pinglin: jesse | 2006-07-14 21:27:22 -0400
* Proper port support on urls. Thanks to jpeacock.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1589 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 1d839c618cb610e599502d22fa150600781f82d0
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 15 06:19:47 2006 +0000
* more constraint relaxing
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1590 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Web/Form.pm b/lib/Jifty/Web/Form.pm
index 46e0303..fd6d4b9 100644
--- a/lib/Jifty/Web/Form.pm
+++ b/lib/Jifty/Web/Form.pm
@@ -9,7 +9,7 @@ use Moose;
has actions => qw( is rw isa Any );
has printed_actions => qw( is rw isa Any );
has name => qw( is rw isa Str );
-has call => qw( is rw isa Str );
+has call => qw( is rw isa Any ); # Str | Jifty::Continuation
has is_open => qw( is rw isa Bool );
no Moose;
commit 2e0a0f908e47a06567550021156c4dc8cb5997c9
Author: Jesse Vincent <jesse at bestpractical.com>
Date: Sat Jul 15 06:37:20 2006 +0000
* Mor erelaxing ( for now)
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1591 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Response.pm b/lib/Jifty/Response.pm
index f0ee149..d6e8b97 100644
--- a/lib/Jifty/Response.pm
+++ b/lib/Jifty/Response.pm
@@ -18,7 +18,7 @@ L<Jifty::Result> objects of each L<Jifty::Action> that ran.
use base qw/Jifty::Object/;
use Moose;
-has error => qw( is rw isa Str );
+has error => qw( is rw isa Any ); # Str? XXX TODO
no Moose;
=head2 new
diff --git a/lib/Jifty/Web/Form/Clickable.pm b/lib/Jifty/Web/Form/Clickable.pm
index e766567..2e9db46 100644
--- a/lib/Jifty/Web/Form/Clickable.pm
+++ b/lib/Jifty/Web/Form/Clickable.pm
@@ -24,7 +24,7 @@ L<Jifty::Web::Form::Element/accessors>.
=cut
use Moose;
-has url => qw( is rw isa Str );
+has url => qw( is rw isa Any ); # Str | URI
has escape_label => qw( is rw isa Bool );
has tooltip => qw( is rw isa Str );
has continuation => qw( is rw isa Any ); # Jifty::Continuation | Str
commit f6fbd21c7f472d6906025247b5f8d74cc2798de6
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 17 04:57:27 2006 +0000
* basic menu test.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1592 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/t/09-menu.t b/t/09-menu.t
new file mode 100644
index 0000000..af142a9
--- /dev/null
+++ b/t/09-menu.t
@@ -0,0 +1,26 @@
+#!/usr/bin/perl
+
+use warnings;
+use strict;
+
+use Test::More qw(no_plan);
+
+use_ok('Jifty');
+use_ok('Jifty::Web::Menu');
+
+my $output;
+$ENV{REQUEST_URI} = '';
+no warnings qw( redefine once );
+*Jifty::Web::out = sub { $output .= $_[1] };
+*Jifty::Web::request = sub { bless {}, 'FakeRequest' };
+*FakeRequest::path = sub { '/' };
+*FakeRequest::continuation = sub { undef };
+*_ = sub { $_[0] };
+
+my $top = Jifty::Web::Menu->new;
+$top->child('Home' => url => "/", sort_order => 0);
+$top->child('Item1' => url => "/1/", sort_order => 1);
+$top->child('Item2' => url => "/2/", sort_order => 2);
+
+$top->render_as_menu;
+like($output, qr{ "/" .* Home .* "/1/" .* Item1 .* "/2/" .* Item2 }sx, "menu rendered");
commit 45010fd2a3450ba3af467175720f48ee2f3809d9
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 17 04:57:45 2006 +0000
* fix Jifty::Web::Menu declaration; the original mk_accessor was sloppy.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1593 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Web/Menu.pm b/lib/Jifty/Web/Menu.pm
index 0a7a2c4..6895381 100644
--- a/lib/Jifty/Web/Menu.pm
+++ b/lib/Jifty/Web/Menu.pm
@@ -1,6 +1,9 @@
package Jifty::Web::Menu;
use Moose;
+has url => qw( is rw isa Any ); # URI | Str
+has active => qw( is rw isa Bool );
+has class => qw( is rw isa Str );
has label => qw( is rw isa Str );
has parent => qw( is rw isa Jifty::Web::Menu weak_ref 1 );
has sort_order => qw( is rw isa Int );
commit 3b14cec77f204695a880f297d55c8e48b1d7266b
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 17 06:32:18 2006 +0000
* Introduce the Jifty::Param class, foundation for introspectable parameters.
* Jifty::Action - fix misdocumentation about "ajax_canonicalizes" (it is
used in ::Field, not a param-specific slot), and begin to add in PARAMS
plumbing. I'd like to factor out the schema-creation magick entirely
into its own module.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1597 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index 1fd3db9..af87e2d 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -17,7 +17,7 @@ for how to return values from actions.
=cut
-use base qw/Jifty::Object/;
+use base qw/Jifty::Object Class::Data::Inheritable/;
use Moose;
has moniker => qw( is rw isa Str );
has argument_values => qw( is rw isa HashRef );
@@ -27,6 +27,8 @@ has sticky_on_success => qw( is rw isa Bool );
has sticky_on_failure => qw( is rw isa Bool );
no Moose;
+__PACKAGE__->mk_classdata(qw/PARAMS/);
+
=head1 COMMON METHODS
=head2 new
@@ -157,21 +159,13 @@ being expected to be set later.
Defaults to false.
-=item ajax_canonicalizes
-
-This key takes a boolean value that determines if the value displayed in
-the form field is updated via AJAX with the result returned by this argument's
-L<canonicalize|Jifty::Manual::Glossary/canonicalize> function.
-
-Defaults to false.
-
=back
=cut
sub arguments {
my $self= shift;
- return {}
+ return($self->PARAMS || {});
}
=head2 run
diff --git a/lib/Jifty/Param.pm b/lib/Jifty/Param.pm
new file mode 100644
index 0000000..a4771bf
--- /dev/null
+++ b/lib/Jifty/Param.pm
@@ -0,0 +1,25 @@
+use warnings;
+use strict;
+
+package Jifty::Param;
+
+=head1 NAME
+
+Jifty::Param - Parameters for Jifty actions
+
+=head1 DESCRIPTION
+
+C<Jifty::Action> is the meat of the L<Jifty> framework; it controls
+how form elements interact with the underlying model. See also
+L<Jifty::Action::Record> for data-oriented actions, L<Jifty::Result>
+for how to return values from actions.
+
+=cut
+
+
+use base qw/Jifty::Web::Form::Field/;
+use Moose;
+has constructor => qw( is rw isa Bool ); # XXX - bad name
+no Moose;
+
+1;
commit 6ee6d5e4a76f828c36c3cbd7c849daed6f4068de
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 17 20:02:31 2006 +0000
* Support for declarative parameters via PARAM hash, which may
contain deferred values.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1601 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index e377ba0..04613c5 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -45,6 +45,7 @@ requires('Module::Refresh' => '0.09');
requires('Moose' => '0.11');
requires('Params::Validate');
requires('Pod::Simple'); #Pod::Simple::Text
+requires('Scalar::Defer');
requires('String::Koremutake');
requires('Test::Base' => 0.44); # Test::Base::Filter
requires('Test::HTTP::Server::Simple' => '0.02');
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index af87e2d..38f93c8 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -371,12 +371,12 @@ sub _form_widget {
# form_fields overrides stickiness of what the user last entered.
$self->{_private_form_fields_hash}{$arg_name}
= Jifty::Web::Form::Field->new(
+ %$field_info,
action => $self,
name => $args{'argument'},
sticky => $sticky,
sticky_value => $self->argument_value($args{'argument'}),
render_mode => $args{'render_mode'},
- %$field_info,
%args
);
@@ -783,7 +783,7 @@ sub _validate_argument {
{
return $self->validation_error(
- $field => q{That doesn't look like a correct value} );
+ $field => _("That doesn't look like a correct value") );
}
# ... but still check through a validator function even if it's in the list
diff --git a/lib/Jifty/Param.pm b/lib/Jifty/Param.pm
index a4771bf..c60d0d8 100644
--- a/lib/Jifty/Param.pm
+++ b/lib/Jifty/Param.pm
@@ -9,17 +9,16 @@ Jifty::Param - Parameters for Jifty actions
=head1 DESCRIPTION
-C<Jifty::Action> is the meat of the L<Jifty> framework; it controls
-how form elements interact with the underlying model. See also
-L<Jifty::Action::Record> for data-oriented actions, L<Jifty::Result>
-for how to return values from actions.
-
=cut
use base qw/Jifty::Web::Form::Field/;
use Moose;
-has constructor => qw( is rw isa Bool ); # XXX - bad name
+has constructor => qw( is rw isa Bool ); # XXX - bad name
+has valid_values => qw( is rw isa Any ); # XXX - coercion
+has available_values => qw( is rw isa Any ); # XXX - coercion
no Moose;
+sub BUILDALL { 1; }
+
1;
diff --git a/lib/Jifty/Web.pm b/lib/Jifty/Web.pm
index bad142b..9220ed1 100644
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@ -439,9 +439,10 @@ sub new_action {
# isn't a "shouldn't happen"
return unless Jifty::Util->require( $class );
+ local $@;
my $action;
# XXX TODO bullet proof
- eval { $action = $class->new( %args, arguments => {%arguments} ); };
+ eval { $action = $class->new( %args, arguments => \%arguments ); };
if ($@) {
my $err = $@;
$self->log->fatal($err);
commit 6a67f3800ab754dfbdca130aa0832c3f3d1bf16e
Merge: 6ee6d5e 0c777c1
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 17 20:02:54 2006 +0000
Merge from /jifty/trunk:1599
r16333 at T (orig r1598): srl | 2006-07-17 12:48:20 -0400
r16334 at T (orig r1599): srl | 2006-07-17 12:49:44 -0400
r6181 at lightning: srl | 2006-07-17 12:47:49 -0400
Add more explicit POD with an example.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1602 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 464f84466350a4fe00c425cd2f66ca9da4e68a4a
Author: Audrey Tang <audreyt at audreyt.org>
Date: Tue Jul 18 01:04:45 2006 +0000
* Declarative schema landed.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1603 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index 04613c5..e96d7bf 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -20,6 +20,7 @@ requires('Email::LocalDelivery');
requires('Email::Send' => '1.99_01'); # Email::Send::Jifty::Test
requires('Email::Simple');
requires('Email::Simple::Creator');
+requires('Exporter::Lite');
requires('File::Find::Rule');
requires('File::MMagic');
requires('File::ShareDir');
@@ -43,6 +44,7 @@ requires('Module::Install::Admin' => '0.50');
requires('Module::Pluggable' => '2.95');
requires('Module::Refresh' => '0.09');
requires('Moose' => '0.11');
+requires('Object::Declare');
requires('Params::Validate');
requires('Pod::Simple'); #Pod::Simple::Text
requires('Scalar::Defer');
diff --git a/lib/Jifty/Param/Schema.pm b/lib/Jifty/Param/Schema.pm
new file mode 100644
index 0000000..675c231
--- /dev/null
+++ b/lib/Jifty/Param/Schema.pm
@@ -0,0 +1,28 @@
+package Jifty::Param::Schema;
+
+use Jifty::I18N;
+use Jifty::Param;
+use Scalar::Defer;
+use Object::Declare ['Jifty::Param'];
+use Exporter::Lite;
+use Class::Data::Inheritable;
+
+our @EXPORT = qw( defer lazy param schema from );
+
+sub schema (&) {
+ my $code = shift;
+ my $from = caller;
+ local *_ = sub {
+ my $args = \@_;
+ defer { local *_; Jifty::I18N->new; _(@$args) };
+ };
+
+ Class::Data::Inheritable::mk_classdata($from => qw/PARAMS/);
+ $from->PARAMS( &declare($code) );
+
+ no strict 'refs';
+ push @{$from . '::ISA'}, 'Jifty::Action';
+ return;
+}
+
+1;
commit 2699d4f72b37413990ae1e8db5f5a67d517ef0af
Author: Audrey Tang <audreyt at audreyt.org>
Date: Tue Jul 18 01:21:58 2006 +0000
* Update t/*/lib/*/Action/* to demo the new schema syntax.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1604 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/lib/Jifty/Param/Schema.pm b/lib/Jifty/Param/Schema.pm
index 675c231..a20c4e8 100644
--- a/lib/Jifty/Param/Schema.pm
+++ b/lib/Jifty/Param/Schema.pm
@@ -12,6 +12,8 @@ our @EXPORT = qw( defer lazy param schema from );
sub schema (&) {
my $code = shift;
my $from = caller;
+
+ no warnings 'redefine';
local *_ = sub {
my $args = \@_;
defer { local *_; Jifty::I18N->new; _(@$args) };
diff --git a/t/Continuations/lib/Continuations/Action/CrossBridge.pm b/t/Continuations/lib/Continuations/Action/CrossBridge.pm
index f51b917..5a2c579 100644
--- a/t/Continuations/lib/Continuations/Action/CrossBridge.pm
+++ b/t/Continuations/lib/Continuations/Action/CrossBridge.pm
@@ -1,14 +1,13 @@
package Continuations::Action::CrossBridge;
-use base qw/Jifty::Action/;
+use Jifty::Param::Schema;
+use Jifty::Action schema {
-sub arguments {
- {
- name => {},
- quest => {},
- colour => {valid_values => ["Blue, I mean greeeeeen!", "Green"]},
- }
-}
+param 'name';
+param 'quest';
+param 'colour' => valid_values are ("Blue, I mean greeeeeen!", "Green");
+
+};
sub validate_quest {
my $self = shift;
diff --git a/t/Mapper/lib/Mapper/Action/CrossBridge.pm b/t/Mapper/lib/Mapper/Action/CrossBridge.pm
index 900ff48..f441f00 100644
--- a/t/Mapper/lib/Mapper/Action/CrossBridge.pm
+++ b/t/Mapper/lib/Mapper/Action/CrossBridge.pm
@@ -1,14 +1,13 @@
package Mapper::Action::CrossBridge;
-use base qw/Jifty::Action/;
+use Jifty::Param::Schema;
+use Jifty::Action schema {
-sub arguments {
- {
- name => { default_value => "something" },
- quest => {},
- colour => {valid_values => ["Blue, I mean greeeeeen!", "Green"]},
- }
-}
+param name => default_value is 'something';
+param 'quest';
+param colour => valid_values are ("Blue, I mean greeeeeen!", "Green");
+
+};
sub validate_quest {
my $self = shift;
diff --git a/t/TestApp/lib/TestApp/Action/DoSomething.pm b/t/TestApp/lib/TestApp/Action/DoSomething.pm
index 3911807..9e41793 100644
--- a/t/TestApp/lib/TestApp/Action/DoSomething.pm
+++ b/t/TestApp/lib/TestApp/Action/DoSomething.pm
@@ -1,16 +1,14 @@
package TestApp::Action::DoSomething;
-use base qw/Jifty::Action/;
-
-sub arguments {
- return({
- email => {
- label => 'Email',
- ajax_canonicalizes => 1,
- ajax_validates => 1,
- }
- });
-}
+use Jifty::Param::Schema;
+use Jifty::Action schema {
+
+param email =>
+ label is 'Email',
+ is ajax_canonicalizes,
+ is ajax_validates;
+
+};
sub canonicalize_email {
my $self = shift;
commit 84b4996dad12c8eefebb508b3aac29a9d8661d54
Author: Audrey Tang <audreyt at audreyt.org>
Date: Tue Jul 18 01:47:14 2006 +0000
* Declarative Param is now auto-ordering; the sort_order field is
defaulted to the order as they are generated.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1605 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index e96d7bf..bb0950c 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,7 +44,7 @@ requires('Module::Install::Admin' => '0.50');
requires('Module::Pluggable' => '2.95');
requires('Module::Refresh' => '0.09');
requires('Moose' => '0.11');
-requires('Object::Declare');
+requires('Object::Declare' => '0.05');
requires('Params::Validate');
requires('Pod::Simple'); #Pod::Simple::Text
requires('Scalar::Defer');
diff --git a/lib/Jifty/Param.pm b/lib/Jifty/Param.pm
index c60d0d8..b6225d4 100644
--- a/lib/Jifty/Param.pm
+++ b/lib/Jifty/Param.pm
@@ -17,8 +17,10 @@ use Moose;
has constructor => qw( is rw isa Bool ); # XXX - bad name
has valid_values => qw( is rw isa Any ); # XXX - coercion
has available_values => qw( is rw isa Any ); # XXX - coercion
+has sort_order => qw( is rw isa Int );
no Moose;
+# Inhibit the reblessing inherent in Jifty::Web::Form::Field->BUILD
sub BUILDALL { 1; }
1;
diff --git a/lib/Jifty/Param/Schema.pm b/lib/Jifty/Param/Schema.pm
index a20c4e8..313151b 100644
--- a/lib/Jifty/Param/Schema.pm
+++ b/lib/Jifty/Param/Schema.pm
@@ -20,7 +20,12 @@ sub schema (&) {
};
Class::Data::Inheritable::mk_classdata($from => qw/PARAMS/);
- $from->PARAMS( &declare($code) );
+ my @params = &declare($code);
+ my $count = 100; # arbitrary number
+ foreach my $param (@params) {
+ $param->sort_order($count++) if ref($param) and !defined($param->sort_order);
+ }
+ $from->PARAMS({ @params });
no strict 'refs';
push @{$from . '::ISA'}, 'Jifty::Action';
commit 927c8baa951cecd131dce30a5499656d224715bd
Merge: 84b4996 d090a63
Author: Audrey Tang <audreyt at audreyt.org>
Date: Wed Jul 19 01:47:13 2006 +0000
Merge from /jifty/trunk:1607
r16365 at T (orig r1606): nelhage | 2006-07-18 10:25:55 -0400
J::Web::redirect can take a Clickable as arg, so make goto do that, instead of passing a URL with parameters, which doesn't work right
r16391 at T (orig r1607): jesse | 2006-07-18 21:44:35 -0400
r14160 at pinglin: jesse | 2006-07-18 21:43:13 -0400
* packaging plan updates
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1608 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --cc lib/Jifty/Web.pm
index 9220ed1,98277b9..8c003c8
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@@ -16,17 -16,14 +16,18 @@@ use CGI::Cookie
use XML::Writer;
use CSS::Squish;
use Digest::MD5 qw(md5_hex);
+ use Carp qw(carp);
-use base qw/Class::Accessor::Fast Class::Data::Inheritable Jifty::Object/;
+use base qw/Class::Data::Inheritable Jifty::Object/;
use vars qw/$SERIAL @JS_INCLUDES/;
-
-__PACKAGE__->mk_accessors(
- qw(next_page request response session temporary_current_user _current_user)
-);
+use Moose;
+has next_page => qw( is rw isa Str );
+has request => qw( is rw isa Jifty::Request );
+has response => qw( is rw isa Jifty::Response );
+has session => qw( is rw isa Jifty::Web::Session );
+has temporary_current_user => qw( is rw isa Object );
+has _current_user => qw( is rw isa Object );
+no Moose;
__PACKAGE__->mk_classdata($_)
for qw(cached_css cached_css_digest
commit 4bd889acb3e69c15de554cc278d82844a24c5b2c
Merge: 927c8ba 4d0cdaf
Author: Audrey Tang <audreyt at audreyt.org>
Date: Fri Jul 21 01:32:45 2006 +0000
Merge from /jifty/trunk:1631
r16396 at T (orig r1612): audreyt | 2006-07-19 00:05:21 -0400
* 0th sketch at "jifty deps"
r16397 at T (orig r1613): audreyt | 2006-07-19 00:07:56 -0400
* Deps: yay it work snow
r16398 at T (orig r1614): audreyt | 2006-07-19 00:08:49 -0400
* be a bit lessnoisy
r16399 at T (orig r1615): audreyt | 2006-07-19 00:14:01 -0400
* try recurse=1
r16415 at T (orig r1616): jesse | 2006-07-19 00:17:03 -0400
r14175 at pinglin: jesse | 2006-07-19 00:16:44 -0400
* Auto-accept cpan's wisdom about prompts
r16418 at T (orig r1619): nelhage | 2006-07-19 16:57:34 -0400
Adding support for placeholders, grayed-out text in form fields that is written in with JS and vanishes on focus
r16419 at T (orig r1620): nelhage | 2006-07-19 16:58:34 -0400
textareas can have placeholders, too; Style them appropriately as well
r16420 at T (orig r1621): nelhage | 2006-07-19 17:07:58 -0400
Support multi-line placeholders
r16421 at T (orig r1622): nelhage | 2006-07-19 17:08:29 -0400
Add the class before we set the text, so that it appears grayed-out, rather than appearing and *then* graying out
r16422 at T (orig r1623): nelhage | 2006-07-19 17:10:01 -0400
I should get better at not checking in warnings.
r16423 at T (orig r1624): nelhage | 2006-07-19 17:41:51 -0400
Not submitting placeholder values when we submit forms or AJAX
r16439 at T (orig r1625): trs | 2006-07-20 13:08:32 -0400
r14590 at zot: tom | 2006-07-20 13:08:09 -0400
Don't fade autocomplete in and out, just show and hide it
r16440 at T (orig r1626): nelhage | 2006-07-20 13:21:48 -0400
Let's not blow up if we have placeholders on an input without a form
r16441 at T (orig r1627): trs | 2006-07-20 13:25:05 -0400
r14592 at zot: tom | 2006-07-20 13:24:52 -0400
Trailing commas are not good for JS in Safari
r16442 at T (orig r1628): trs | 2006-07-20 13:38:37 -0400
r14596 at zot: tom | 2006-07-20 13:38:27 -0400
Add a tooltip to the dismiss link and hide the dotted border
r16457 at T (orig r1629): nelhage | 2006-07-20 15:45:26 -0400
Upping JSON::Syck version dependency. 0.14 fixes escaping in single-quoted strings.
r16458 at T (orig r1630): nelhage | 2006-07-20 17:08:55 -0400
After autocomplete, trigger a validation.
r16459 at T (orig r1631): nelhage | 2006-07-20 20:45:32 -0400
Adding the CSS browser selector trick from http://rafael.adm.br/css_browser_selector/ to Jifty
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1632 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --cc lib/Jifty/Web/Form/Field.pm
index 0c40c60,8b91e81..69a9805
--- a/lib/Jifty/Web/Form/Field.pm
+++ b/lib/Jifty/Web/Form/Field.pm
@@@ -2,37 -24,6 +2,38 @@@ use warnings
use strict;
package Jifty::Web::Form::Field;
+use Moose;
+has name => qw( is rw isa Str );
+has label => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ return $self->name;
+};
+has input_name => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ my $action = $self->action;
+ return $action ? $self->action->form_field_name( $self->name )
+ : '';
+};
+has type => qw( is rw isa Str default text );
+has sticky => qw( is rw isa Str );
+has sticky_value => qw( is rw isa Any );
+has default_value => qw( is rw isa Any );
+has action => qw( is rw isa Any weak_ref 1 );
+has mandatory => qw( is rw isa Str );
+has ajax_validates => qw( is rw isa Str );
+has ajax_canonicalizes => qw( is rw isa Str );
+has autocompleter => qw( is rw isa CodeRef );
+has preamble => qw( is rw isa Str );
+has hints => qw( is rw isa Str );
+has render_mode => qw( is rw isa Str default update );
+has length => qw( is rw isa Str );
++has placeholder => qw( is rw isa Str );
+has element_id => qw( is rw isa Str lazy 1 default ) => sub {
+ my $self = shift;
+ return $self->input_name."-".Jifty->web->serial;
+};
+no Moose;
+
=head1 NAME
commit 2fcc6637fb240678b7fb3d48079926701ae27fd7
Merge: 4bd889a 69bf7ea
Author: Audrey Tang <audreyt at audreyt.org>
Date: Fri Jul 21 07:04:21 2006 +0000
Merge from /jifty/trunk:1637
r16465 at T (orig r1634): audreyt | 2006-07-21 01:52:37 -0400
* Declarative Jifty Parameters.
* See Jifty::Param and Jifty::Param::Schema for the new syntax.
* Also added dependencies for Jifty::Script::Deps and declarative parameters.
* Also updated test applications to use declarative parameters.
r16466 at T (orig r1635): audreyt | 2006-07-21 02:50:59 -0400
* Introduce aliases. See Jifty::Param::Schema for the table.
r16468 at T (orig r1637): audreyt | 2006-07-21 03:02:56 -0400
* Jifty::Manual::Actions -- update the worldview to reflect the
parameters/arguments concept split.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1638 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --cc lib/Jifty/Action.pm
index 38f93c8,0a4caf8..16a3777
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@@ -17,17 -17,10 +17,18 @@@ for how to return values from actions
=cut
-use base qw/Jifty::Object Class::Accessor::Fast Class::Data::Inheritable/;
+use base qw/Jifty::Object Class::Data::Inheritable/;
+use Moose;
+has moniker => qw( is rw isa Str );
+has argument_values => qw( is rw isa HashRef );
+has order => qw( is rw isa Int );
+has result => qw( is rw isa Jifty::Result );
+has sticky_on_success => qw( is rw isa Bool );
+has sticky_on_failure => qw( is rw isa Bool );
+no Moose;
-__PACKAGE__->mk_accessors(qw(moniker argument_values order result sticky_on_success sticky_on_failure));
+__PACKAGE__->mk_classdata(qw/PARAMS/);
+ __PACKAGE__->mk_classdata(qw/PARAMS/);
=head1 COMMON METHODS
commit 0767c6ae47c1afaa7995386a91ab71db666de454
Author: Audrey Tang <audreyt at audreyt.org>
Date: Fri Jul 21 07:10:15 2006 +0000
* moose branch: fix some merge errors.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1639 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --git a/Makefile.PL b/Makefile.PL
index d0e734d..b3630b4 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -44,6 +44,7 @@ requires('Module::Install::Admin' => '0.50');
requires('Module::Pluggable' => '2.95');
requires('Module::Refresh' => '0.09');
requires('Module::ScanDeps');
+requires('Moose');
requires('Object::Declare' => '0.13');
requires('PAR::Dist::FromCPAN');
requires('Params::Validate');
diff --git a/lib/Jifty/Action.pm b/lib/Jifty/Action.pm
index 16a3777..363faee 100644
--- a/lib/Jifty/Action.pm
+++ b/lib/Jifty/Action.pm
@@ -28,7 +28,6 @@ has sticky_on_failure => qw( is rw isa Bool );
no Moose;
__PACKAGE__->mk_classdata(qw/PARAMS/);
-__PACKAGE__->mk_classdata(qw/PARAMS/);
=head1 COMMON METHODS
commit 69eb6691fcb74f1b301fb093c5738194c483ca46
Merge: 0767c6a 39d5ced
Author: Audrey Tang <audreyt at audreyt.org>
Date: Fri Jul 21 15:52:15 2006 +0000
Merge from /jifty/trunk:1640
r16471 at T (orig r1640): audreyt | 2006-07-21 10:45:56 -0400
* oops, forgot to add Jifty::Param to commit.
clkao++ audreyt--
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1641 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --cc lib/Jifty/Param.pm
index b6225d4,981db77..eec95c6
--- a/lib/Jifty/Param.pm
+++ b/lib/Jifty/Param.pm
@@@ -12,15 -67,33 +67,25 @@@ This is usually implicitly generated b
=cut
-use base qw/Jifty::Web::Form::Field Class::Accessor::Fast/;
-use constant ACCESSORS => qw(constructor valid_values available_values sort_order);
+use base qw/Jifty::Web::Form::Field/;
+use Moose;
+has constructor => qw( is rw isa Bool ); # XXX - bad name
+has valid_values => qw( is rw isa Any ); # XXX - coercion
+has available_values => qw( is rw isa Any ); # XXX - coercion
+has sort_order => qw( is rw isa Int );
+no Moose;
-__PACKAGE__->mk_accessors(ACCESSORS);
++=head2 BUILDALL
+
-sub accessors { (shift->SUPER::accessors(), ACCESSORS) }
++Controls the logic of creating a new L<Jifty::Param> object. Note that
++unlike L<Jifty::Web::Form::Field>, the object is never magically reblessed
++into a subclass.
+
-=head2 new
-
-Creates a new L<Jifty::Param> object. Note that unlike L<Jifty::Web::Form::Field>,
-the object is never magically reblessed into a subclass. Should only be called
-implicitly from a L<Jifty::Param::Schema> declaration.
++Should only be called implicitly from a L<Jifty::Param::Schema> declaration.
+
+ =cut
+
-# Inhibit the reblessing inherent in Jifty::Web::Form::Field->new
-sub new {
- my $class = shift;
- $class->Class::Accessor::Fast::new({
- type => 'text',
- class => '',
- input_name => '',
- default_value => '',
- sticky_value => '',
- render_mode => 'update',
- @_,
- });
-}
+# Inhibit the reblessing inherent in Jifty::Web::Form::Field->BUILD
+sub BUILDALL { 1; }
1;
commit 801c20ad209ab33c28216a30e082b6f62a617a96
Merge: 69eb669 d1ea4cb
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Jul 22 05:15:50 2006 +0000
Merge from /jifty/trunk:1645
r16488 at T (orig r1643): zev | 2006-07-21 15:46:50 -0400
r11795 at truegrounds: zev | 2006-07-21 15:46:38 -0400
* added a path option to Jifty::Web->url
* added url tests
r16489 at T (orig r1644): zev | 2006-07-21 16:43:46 -0400
r11822 at truegrounds: zev | 2006-07-21 16:43:41 -0400
* added url test
r16490 at T (orig r1645): zev | 2006-07-21 18:02:35 -0400
r11824 at truegrounds: zev | 2006-07-21 18:02:28 -0400
* changed all instances of '/usr/bin/perl' to '/usr/bin/env perl'
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1647 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit a0dc75b1707cc3c2693b081f49212a1b1dd59295
Merge: 801c20a bfdeed6
Author: Audrey Tang <audreyt at audreyt.org>
Date: Tue Jul 25 05:28:01 2006 +0000
Merge from /jifty/trunk:1665
r16518 at T (orig r1648): jesse | 2006-07-22 16:26:09 -0700
r14349 at pinglin: jesse | 2006-07-22 16:18:11 -0700
* Dispatcher fixes to deal with the better canonicalization we started doing in
0.60707
r16530 at T (orig r1649): jesse | 2006-07-22 17:15:34 -0700
r14354 at pinglin: jesse | 2006-07-22 16:40:40 -0700
* Even though Jifty::Web uses URIs internally, external code shouldn't be forced to
(This API change broke things after the last release)
r16531 at T (orig r1650): jesse | 2006-07-22 17:15:44 -0700
r14355 at pinglin: jesse | 2006-07-22 16:46:10 -0700
* MANIFEST updates
r16532 at T (orig r1651): jesse | 2006-07-22 17:15:52 -0700
r14356 at pinglin: jesse | 2006-07-22 17:15:20 -0700
* 0.60722
r16536 at T (orig r1652): ishigaki | 2006-07-22 20:53:25 -0700
* Win32 complains when you try to unlink open DB
r16576 at T (orig r1653): nelhage | 2006-07-24 09:20:26 -0700
If we don't have XMLHttpRequest, fall back on page loads
r16577 at T (orig r1654): trs | 2006-07-24 09:38:06 -0700
r14612 at zot: tom | 2006-07-21 12:21:50 -0400
* Fix placeholders on browser forward/back
* Replace hard tabs with spaces for consistency
r16578 at T (orig r1655): trs | 2006-07-24 09:38:11 -0700
r16579 at T (orig r1656): trs | 2006-07-24 09:38:19 -0700
r14730 at zot: tom | 2006-07-24 12:33:48 -0400
Gzip compress the squished CSS and JS if possible. The static handler usually deals with this, but we're not serving squished CSS/JS from the static root.
r16583 at T (orig r1657): trs | 2006-07-24 10:43:12 -0700
r14737 at zot: tom | 2006-07-24 13:42:59 -0400
Show calendar widget on focus and hide it on blur
r16585 at T (orig r1659): jesse | 2006-07-24 13:14:23 -0700
r14364 at pinglin: jesse | 2006-07-22 22:26:16 -0700
* Don't blow up when trying to check if action mixins are autogenerated
r16586 at T (orig r1660): jesse | 2006-07-24 13:14:32 -0700
r14366 at pinglin: jesse | 2006-07-24 13:13:49 -0700
* oscon
r16587 at T (orig r1661): trs | 2006-07-24 13:47:11 -0700
r14739 at zot: tom | 2006-07-24 16:46:53 -0400
Fix the element selected in the region
r16588 at T (orig r1662): audreyt | 2006-07-24 15:52:21 -0700
* Jifty::ClassLoader - Make Jifty::Handle a CL'ed module as well,
so MyApp::Handle can implement scary magick of its own.
r16589 at T (orig r1663): audreyt | 2006-07-24 16:04:13 -0700
* Jifty->web->return in void context is now an immediate return.
r16590 at T (orig r1664): audreyt | 2006-07-24 16:11:40 -0700
* Dispatcher: Support tangent($url) as sugar for Jifty->web->tangent(url=>$url).
* Dispatcher: Allow "**" in glob pattern to mean anychar including slash.
r16591 at T (orig r1665): audreyt | 2006-07-24 16:12:31 -0700
* Jifty::Manual::Continuations: reflect tangent() in the manual.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1666 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 095948d4bd59aaa20996b5992d0207719c124a9e
Merge: a0dc75b a2e0490
Author: Audrey Tang <audreyt at audreyt.org>
Date: Mon Jul 31 07:35:23 2006 +0000
Merge from /jifty/trunk:1710
r16679 at 12-46-55-49 (orig r1667): trs | 2006-07-25 10:52:25 -0700
r14751 at zot: tom | 2006-07-25 13:48:15 -0400
Fix bug that didn't allow calendar months to be changed
r16680 at 12-46-55-49 (orig r1668): audreyt | 2006-07-25 12:59:57 -0700
* Jifty::Web::Session::ClientSide - Client-side sessions.
r16682 at 12-46-55-49 (orig r1669): trs | 2006-07-25 13:06:52 -0700
r14755 at zot: tom | 2006-07-25 16:06:44 -0400
Fix typo
r16683 at 12-46-55-49 (orig r1670): audreyt | 2006-07-25 13:30:34 -0700
* Jifty::Web::Session::ClientSide: Re-assemble split cookies (>4K) correctly.
"logout" now works transparently.
r16695 at 12-46-55-49 (orig r1671): srl | 2006-07-25 14:01:18 -0700
r6427 at kootenai: srl | 2006-07-25 16:58:14 -0400
Clarify POD.
r16696 at 12-46-55-49 (orig r1672): srl | 2006-07-25 14:01:21 -0700
r6428 at kootenai: srl | 2006-07-25 16:59:05 -0400
Autoformat message bodies for notifications.
r16697 at 12-46-55-49 (orig r1673): zev | 2006-07-25 15:25:50 -0700
r11919 at truegrounds: zev | 2006-07-25 18:25:37 -0400
* doc fix
r16698 at 12-46-55-49 (orig r1674): ishigaki | 2006-07-26 07:43:45 -0700
* Win32 requires File::ShareDir 0.04
r16707 at 12-46-55-49 (orig r1679): jesse | 2006-07-26 14:44:49 -0700
r14517 at pinglin: jesse | 2006-07-26 14:42:59 -0700
* oscon talk final version
r16723 at 12-46-55-49 (orig r1680): audreyt | 2006-07-26 21:29:52 -0700
* mimetype for oscon talk
r16730 at 12-46-55-49 (orig r1681): nelhage | 2006-07-27 11:21:33 -0700
Plugin static roots should take precendence over jifty's
r16731 at 12-46-55-49 (orig r1682): nelhage | 2006-07-27 11:36:31 -0700
Removing profiling code from behaviour.js
r16733 at 12-46-55-49 (orig r1684): nelhage | 2006-07-27 14:23:23 -0700
Adding a ProfileBehaviour plugin to aid profiling Javascript
Behaviours (see app_behaviour.js in the Jifty source for some more
information)
r16739 at 12-46-55-49 (orig r1685): trs | 2006-07-28 10:01:43 -0700
r14863 at zot: tom | 2006-07-28 13:00:52 -0400
Make the POD name match the actual package name
r16743 at 12-46-55-49 (orig r1686): jesse | 2006-07-28 18:32:40 -0700
* fixing a resource fork issue
r16744 at 12-46-55-49 (orig r1687): jesse | 2006-07-28 18:32:58 -0700
* fixing a resource fork issue
r16745 at 12-46-55-49 (orig r1688): audreyt | 2006-07-28 19:16:31 -0700
* Dispatcher did not have a ->{cgi}, so ->method certainly could not
work. Use the env variable for now.
r16746 at 12-46-55-49 (orig r1689): audreyt | 2006-07-28 19:21:02 -0700
* skeleton for plugin rest
r16747 at 12-46-55-49 (orig r1690): audreyt | 2006-07-28 19:55:59 -0700
* REST Dispatcher skeleton that actually works
...now actually moving stuff from RPS to it...
r16748 at 12-46-55-49 (orig r1691): jesse | 2006-07-28 20:45:20 -0700
r14603 at pinglin: jesse | 2006-07-28 20:44:35 -0700
* Basic placeholder for REST plugin tests
r16749 at 12-46-55-49 (orig r1692): audreyt | 2006-07-28 20:50:42 -0700
* REST Dispatcher: model list reflection
r16750 at 12-46-55-49 (orig r1693): audreyt | 2006-07-28 20:52:21 -0700
* Jifty.pm: Change all __PACKAGE__ to Jifty.
* Jifty::ClassLoader: provide ->models accessor to list the model classes.
r16751 at 12-46-55-49 (orig r1694): audreyt | 2006-07-28 20:55:46 -0700
* __jifty/admin: use ->models reflection to build the nav bar.
r16752 at 12-46-55-49 (orig r1695): audreyt | 2006-07-28 20:57:02 -0700
* ditto for the index.
r16753 at 12-46-55-49 (orig r1696): audreyt | 2006-07-28 21:04:30 -0700
* even less code for jifty admin console
r16754 at 12-46-55-49 (orig r1697): audreyt | 2006-07-28 21:18:54 -0700
* admin models: Add the ->isa('Jifty::Record') back
r16755 at 12-46-55-49 (orig r1698): jesse | 2006-07-28 21:24:32 -0700
r14611 at pinglin: jesse | 2006-07-28 21:23:41 -0700
* First tests!
r16756 at 12-46-55-49 (orig r1699): jesse | 2006-07-28 21:34:40 -0700
r14615 at pinglin: jesse | 2006-07-28 21:34:25 -0700
* test for audrey's next unimplemented feature 'describe this model class'
r16757 at 12-46-55-49 (orig r1700): jesse | 2006-07-28 21:36:26 -0700
r14617 at pinglin: jesse | 2006-07-28 21:36:12 -0700
* tests were wrong. hard to see that before we have runnign code
r16758 at 12-46-55-49 (orig r1701): jesse | 2006-07-28 22:03:22 -0700
r14619 at pinglin: jesse | 2006-07-28 21:58:47 -0700
* Next REST Test pass
r16759 at 12-46-55-49 (orig r1702): audreyt | 2006-07-28 22:08:46 -0700
* Jifty::Plugin::REST::Dispatcher - model fetch actually works!
r16761 at 12-46-55-49 (orig r1703): srl | 2006-07-29 05:26:32 -0700
Removed Text::Autoformat dependency and usage.
r16800 at 12-46-55-49 (orig r1704): audreyt | 2006-07-29 20:07:11 -0700
* Jifty::Plugin::REST - test passes; release it! :)
r16801 at 12-46-55-49 (orig r1705): audreyt | 2006-07-29 20:12:59 -0700
* squash some uninitialized warnings when emitting empty columns
r16804 at 12-46-55-49 (orig r1706): audreyt | 2006-07-30 00:40:06 -0700
* Jifty::Dispatcher: abort(404) now works as the doc promised.
r16805 at 12-46-55-49 (orig r1707): audreyt | 2006-07-30 00:45:34 -0700
* J::P::REST::Dispatcher - all GET model URLs work, with 404s.
r16806 at 12-46-55-49 (orig r1708): audreyt | 2006-07-30 00:46:03 -0700
* Update the REST plugin tests to match.
r16807 at 12-46-55-49 (orig r1709): audreyt | 2006-07-30 11:15:06 -0700
* MIME type fixup:
application/json
application/x-perl
text/x-yaml
r16814 at 12-46-55-49 (orig r1710): trs | 2006-07-30 22:36:03 -0700
r14982 at zot: tom | 2006-07-31 01:12:32 -0400
Update the dismiss button styles
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1712 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
commit 04c83d3430e386e2587d4438222ee7d5b97fb3f4
Merge: 095948d a05ba7b
Author: Audrey Tang <audreyt at audreyt.org>
Date: Sat Aug 5 09:18:48 2006 +0000
Merge from /jifty/trunk:1761
r16827 at T (orig r1713): nelhage | 2006-08-01 02:45:19 +0800
Jifty::Web::state_variables no longer prefixes keys with J:V- before
returning them, and Clickables now serialize the *outgoing* state
vars, instead of the previous request's.
r16828 at T (orig r1714): nelhage | 2006-08-01 03:36:26 +0800
Forgot to push this with the last commit.
r16829 at T (orig r1715): nelhage | 2006-08-01 04:40:34 +0800
Some Behaviour profiling UI fixes.
r16845 at T (orig r1716): audreyt | 2006-08-01 14:38:17 +0800
* Jifty::Plugin::REST::Dispatcher - /=/action/ now works across HTML+HTTP.
(t/ not yet updated.)
r16857 at T (orig r1717): zev | 2006-08-02 01:17:16 +0800
r12087 at truegrounds: zev | 2006-08-01 13:16:51 -0400
* doc fix
r16859 at T (orig r1719): nelhage | 2006-08-02 02:29:42 +0800
Doc fixes
r16860 at T (orig r1720): nelhage | 2006-08-02 02:31:01 +0800
Adding Jifty::Filter::DateTime, a JDBI filter that promotes DateTime
objects to Jifty::DateTime objects on read, setting the time zone
appropriately.
r16861 at T (orig r1721): nelhage | 2006-08-02 03:08:55 +0800
Slight cleanup
r16863 at T (orig r1723): nelhage | 2006-08-02 04:06:57 +0800
POD++
r16864 at T (orig r1724): nelhage | 2006-08-02 05:46:31 +0800
Workaround DateManip's parsing of bare days of weeks as references to
days in the current week, instead of assuming future days.
r16870 at T (orig r1725): bartb | 2006-08-02 12:02:30 +0800
Add myself to the AUTHORS file
r16871 at T (orig r1726): bartb | 2006-08-02 12:05:13 +0800
A start at some docs on upgrading, needs reviewing and some more examples
r16874 at T (orig r1727): nelhage | 2006-08-02 22:59:19 +0800
Documenting the ProfileBehaviour plugin.
r16875 at T (orig r1728): nelhage | 2006-08-03 02:28:31 +0800
Preventing some DateTime warnings
r16876 at T (orig r1729): trs | 2006-08-03 02:35:39 +0800
r15040 at zot: tom | 2006-08-02 14:35:00 -0400
Support turning off autocomplete on a per-form basis. We still need per-field, but that's for later.
r16877 at T (orig r1730): trs | 2006-08-03 03:27:11 +0800
r15042 at zot: tom | 2006-08-02 15:27:03 -0400
Patch from Todd Chapman to fix tutorial
r16878 at T (orig r1731): trs | 2006-08-03 06:01:06 +0800
r15044 at zot: tom | 2006-08-02 17:59:06 -0400
* Ignore "fluff" errors since they cause non-W3C attributes like "autocomplete" to be warned about
* Add html_ok method for checking the mech's current content so tests can use it while we retain control over Test::HTML::Lint
r16887 at T (orig r1732): nelhage | 2006-08-03 08:20:58 +0800
No longer lose if you do a Jifty::Action::Redirect to the same page
you're already on. Also, add the ability to force Web to redirect,
even if it's to the current page.
r16888 at T (orig r1733): clkao | 2006-08-03 11:58:40 +0800
misc cleanups.
r16889 at T (orig r1734): clkao | 2006-08-03 12:14:48 +0800
Jifty::DateTime cleanups.
r16900 at T (orig r1735): trs | 2006-08-03 13:46:26 +0800
r15050 at zot: tom | 2006-08-03 01:45:33 -0400
We need the anonymous subs because otherwise the method of the base class is always called, instead of the appropriate overridden method in a child class.
r16901 at T (orig r1736): trs | 2006-08-03 13:56:21 +0800
r15052 at zot: tom | 2006-08-03 01:56:04 -0400
Inline my last commit message about needing to use anon subs for overload
r16902 at T (orig r1737): bartb | 2006-08-03 14:06:48 +0800
Add a small bit of doc about creating your own classes that are normally created by J::ClassLoader
r16904 at T (orig r1739): clkao | 2006-08-03 14:16:55 +0800
Form::Clickable: Don't mix self accessors and args.
r16908 at T (orig r1740): nelhage | 2006-08-04 00:18:37 +0800
Writing out state variables at the start of forms, instead of at the
end.
r16909 at T (orig r1741): zev | 2006-08-04 00:37:17 +0800
r12167 at truegrounds: zev | 2006-08-02 17:17:58 -0400
* added Jifty::Request::clear_state_variables
r16910 at T (orig r1742): zev | 2006-08-04 00:37:24 +0800
r12168 at truegrounds: zev | 2006-08-02 18:07:53 -0400
* pod fix
r16911 at T (orig r1743): zev | 2006-08-04 00:37:45 +0800
r16912 at T (orig r1744): trs | 2006-08-04 02:25:49 +0800
r15059 at zot: tom | 2006-08-03 14:22:51 -0400
Further explain XXX TODO
r16913 at T (orig r1745): trs | 2006-08-04 02:38:12 +0800
r15066 at zot: tom | 2006-08-03 14:38:05 -0400
Give a description for get_html_ok so that you know what URLs fail/succeed in test output
r16914 at T (orig r1746): zev | 2006-08-04 03:25:49 +0800
r12255 at truegrounds: zev | 2006-08-03 15:25:42 -0400
* we already do this in the J:W:F:Clickable constructor
r16915 at T (orig r1747): zev | 2006-08-04 07:40:23 +0800
r12279 at truegrounds: zev | 2006-08-03 19:40:08 -0400
* added infrastructure to do mime mails
r16917 at T (orig r1748): audreyt | 2006-08-04 09:07:41 +0800
* Web::Session::ClientSide - if reassembly of cookies failed, start a new session.
r16920 at T (orig r1749): trs | 2006-08-04 11:53:14 +0800
r15059 at zot: tom | 2006-08-03 14:22:51 -0400
Further explain XXX TODO
r16921 at T (orig r1750): trs | 2006-08-04 11:53:19 +0800
r16922 at T (orig r1751): trs | 2006-08-04 11:53:25 +0800
r15066 at zot: tom | 2006-08-03 14:38:05 -0400
Give a description for get_html_ok so that you know what URLs fail/succeed in test output
r16923 at T (orig r1752): trs | 2006-08-04 11:53:32 +0800
r15070 at zot: tom | 2006-08-03 23:52:55 -0400
The setAttribute call doesn't work for "class" in IE
r16924 at T (orig r1753): jesse | 2006-08-04 14:28:25 +0800
r14902 at pinglin: jesse | 2006-08-04 02:27:39 -0400
* Don't try to lowercase session information on postgres
r16936 at T (orig r1754): nelhage | 2006-08-05 01:27:34 +0800
Unescape LetMe arguments properly
r16937 at T (orig r1755): trs | 2006-08-05 01:44:11 +0800
r15081 at zot: tom | 2006-08-04 13:43:59 -0400
Use our own "enter" handler to select the button to click, since Safari sometimes gets it wrong with complex fields
r16938 at T (orig r1756): nelhage | 2006-08-05 01:54:10 +0800
Don't attempt to disable hidden inputs, since this sometimes causes IE to die
r16939 at T (orig r1757): zev | 2006-08-05 02:28:29 +0800
r12338 at truegrounds: zev | 2006-08-04 14:28:16 -0400
* add UTF-8 charset to message body on notifications
r16940 at T (orig r1758): nelhage | 2006-08-05 03:09:52 +0800
Properly encode arguments when generating LetMe URLs.
r16944 at T (orig r1759): trs | 2006-08-05 12:43:23 +0800
r16945 at T (orig r1760): trs | 2006-08-05 12:43:38 +0800
r15090 at zot: tom | 2006-08-05 00:43:19 -0400
Remove debugging statement
r16946 at T (orig r1761): clkao | 2006-08-05 12:56:06 +0800
Forgot to commit this.
git-svn-id: svn+ssh://svn.bestpractical.com/svn/jifty.org/jifty/branches/moose@1762 e84bef0a-9b06-0410-84ba-c4c9edb13aeb
diff --cc lib/Jifty/Notification.pm
index 018a8a9,aa98ec8..3c229d1
--- a/lib/Jifty/Notification.pm
+++ b/lib/Jifty/Notification.pm
@@@ -3,21 -3,12 +3,20 @@@ use strict
package Jifty::Notification;
-use base qw/Jifty::Object Class::Accessor::Fast/;
+use base qw/Jifty::Object/;
use Email::Send ();
- use Email::Simple ();
- use Email::Simple::Creator ();
+ use Email::MIME::Creator;
-__PACKAGE__->mk_accessors(
- qw/body preface footer subject from _recipients _to_list to/);
+use Moose;
+has body => qw( is rw isa Str );
+has preface => qw( is rw isa Str );
+has footer => qw( is rw isa Str );
+has subject => qw( is rw isa Str );
+has from => qw( is rw isa Str );
+has to => qw( is rw isa Any ); # Object to deliver to
+has _recipients => qw( is rw isa ArrayRef );
+has _to_list => qw( is rw isa ArrayRef );
+no Moose;
=head1 USAGE
diff --cc lib/Jifty/Web.pm
index b0a5391,218a18a..b3556ac
--- a/lib/Jifty/Web.pm
+++ b/lib/Jifty/Web.pm
@@@ -17,17 -17,13 +17,18 @@@ use XML::Writer
use CSS::Squish;
use Digest::MD5 qw(md5_hex);
use Carp qw(carp);
-use base qw/Class::Accessor::Fast Class::Data::Inheritable Jifty::Object/;
+use base qw/Class::Data::Inheritable Jifty::Object/;
use vars qw/$SERIAL @JS_INCLUDES/;
-
-__PACKAGE__->mk_accessors(
- qw(next_page force_redirect request response session temporary_current_user _current_user)
-);
+use Moose;
+has next_page => qw( is rw isa Str );
+has request => qw( is rw isa Jifty::Request );
+has response => qw( is rw isa Jifty::Response );
++has force_redirect => qw( is rw isa Bool );
+has session => qw( is rw isa Jifty::Web::Session );
+has temporary_current_user => qw( is rw isa Object );
+has _current_user => qw( is rw isa Object );
+no Moose;
__PACKAGE__->mk_classdata($_)
for qw(cached_css cached_css_digest
diff --cc lib/Jifty/Web/Form.pm
index fd6d4b9,375a297..8fdc3b6
--- a/lib/Jifty/Web/Form.pm
+++ b/lib/Jifty/Web/Form.pm
@@@ -3,15 -3,9 +3,16 @@@ use strict
package Jifty::Web::Form;
-use base qw/Jifty::Object Class::Accessor::Fast/;
-
-__PACKAGE__->mk_accessors(qw(actions printed_actions name call is_open disable_autocomplete));
+use base qw/Jifty::Object/;
+
+use Moose;
+has actions => qw( is rw isa Any );
+has printed_actions => qw( is rw isa Any );
+has name => qw( is rw isa Str );
+has call => qw( is rw isa Any ); # Str | Jifty::Continuation
+has is_open => qw( is rw isa Bool );
++has disable_autocomplete => qw( is rw isa Bool );
+no Moose;
=head2 new ARGS
diff --cc lib/Jifty/Web/Form/Field.pm
index 69a9805,5e25d15..22b0943
--- a/lib/Jifty/Web/Form/Field.pm
+++ b/lib/Jifty/Web/Form/Field.pm
@@@ -56,17 -46,13 +56,20 @@@ use base 'Jifty::Web::Form::Element'
use Scalar::Util;
use HTML::Entities;
- use overload '""' => sub { shift->render}, bool => sub { 1 };
- =head2 accessors
+ # We need the anonymous sub because otherwise the method of the base class is
+ # always called, instead of the appropriate overridden method in a child class.
+ use overload '""' => sub { shift->render }, bool => sub { 1 };
+
+ =head2 new
+Lists the accessors that are able to be called from within a call to
+C<new>. Subclasses should extend this list.
+
+=cut
+
+=head2 BUILD
+
Creates a new L<Jifty::Web::Form::Field> (possibly magically blessing into a subclass).
Should only be called from C<< $action->arguments >>.
diff --cc lib/Jifty/Web/Form/Link.pm
index e274ebf,615add9..de4af40
--- a/lib/Jifty/Web/Form/Link.pm
+++ b/lib/Jifty/Web/Form/Link.pm
@@@ -15,16 -15,12 +15,19 @@@ generates L<Jifty::Web::Form::Link>s
=cut
+use Moose;
+has url => qw( is rw isa Str lazy 1 default ) => sub { $ENV{PATH_INFO} };
+has escape_label => qw( is rw isa Bool default 1 );
+has tooltip => qw( is rw isa Str );
+has target => qw( is rw isa Str );
+no Moose;
+
use base 'Jifty::Web::Form::Element';
- # Since we don't inherit from Form::Field, we don't otherwise stringify
+ # Since we don't inherit from Form::Field, we don't otherwise stringify.
+ # We need the anonymous sub because otherwise the method of the base class is
+ # always called, instead of the appropriate overridden method in a possible
+ # child class.
use overload '""' => sub { shift->render }, bool => sub { 1 };
=head2 accessors
-----------------------------------------------------------------------
More information about the Jifty-commit
mailing list