aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Reaction/Types
diff options
context:
space:
mode:
authoredenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-02-11 18:38:38 +0000
committeredenc <edenc@03d0b0b2-0e1a-0410-a411-fdb2f4bd65d7>2008-02-11 18:38:38 +0000
commit88c723592b7f440af37b1e4c26c708c7998e2d6c (patch)
tree788c2e88aa56f15e09162681620b3a2037e9bc82 /lib/Reaction/Types
parentddd1dc657e6cf50128e94c103411d758538c6f99 (diff)
parent5d86015dcae72913eb60b0111961733213601873 (diff)
downloadreaction-88c723592b7f440af37b1e4c26c708c7998e2d6c.tar.gz
reaction-88c723592b7f440af37b1e4c26c708c7998e2d6c.zip
r20434@hades (orig r549): groditi | 2008-01-30 18:09:54 -0300
better error messages / dont swallow error when a widget has compile errors r20435@hades (orig r550): wreis | 2008-01-30 18:10:59 -0300 nuked CreditCard type r20442@hades (orig r553): groditi | 2008-01-30 19:20:28 -0300 ChooseMany fix r20443@hades (orig r554): matthewt | 2008-01-31 05:07:33 -0300 change dist name to Reaction r20444@hades (orig r555): matthewt | 2008-01-31 07:07:29 -0300 added widget_search_path option (ignored), defaults.conf support and moved file extension to View r20445@hades (orig r556): matthewt | 2008-01-31 07:47:10 -0300 remove vestigial override r20446@hades (orig r557): matthewt | 2008-01-31 08:06:10 -0300 removed view arg to LayoutSet, moved to using skin to resolve widget class, added temporary proxy to View from Skin r20447@hades (orig r558): matthewt | 2008-01-31 08:35:47 -0300 moved widget class search path to Skin r20448@hades (orig r559): matthewt | 2008-01-31 09:40:10 -0300 defaults.conf support works much better if I commit the damn thing r20449@hades (orig r560): matthewt | 2008-01-31 10:32:16 -0300 rework skin path handling r20451@hades (orig r562): matthewt | 2008-01-31 13:23:08 -0300 get rid of the 'title is undef' error r20452@hades (orig r563): matthewt | 2008-02-02 13:12:31 -0300 Collection field vp works again. r20453@hades (orig r564): matthewt | 2008-02-02 13:18:31 -0300 vestigial classes, nuked r20454@hades (orig r565): matthewt | 2008-02-02 13:33:15 -0300 sync_to_action not required, will trigger off value set r20455@hades (orig r566): matthewt | 2008-02-02 14:07:10 -0300 add value_is_required, add logic for sync of clearer on !required attrs r20456@hades (orig r567): wreis | 2008-02-02 14:52:14 -0300 fixed layout path for ArrayRef type r20457@hades (orig r568): groditi | 2008-02-02 15:40:58 -0300 the forwards on basic_page and basic_model_action were breaking config merging at the push viewport stage r20459@hades (orig r570): groditi | 2008-02-02 16:20:40 -0300 oops forward takes args as an arrayref and i forgot to remove that r20461@hades (orig r572): matthewt | 2008-02-03 06:54:30 -0300 generate clearer for !required action attributes r20462@hades (orig r573): matthewt | 2008-02-03 06:55:15 -0300 datetime now handles optional using a wrap on value_string r20463@hades (orig r574): matthewt | 2008-02-03 09:44:08 -0300 make delayed setup components work so implements+does with required methods in the role works r20464@hades (orig r575): matthewt | 2008-02-03 09:48:41 -0300 kill vestigial adopt_value method in Field (since 'value' doesn't get set on a non-mutable field anyway) r20465@hades (orig r576): matthewt | 2008-02-03 10:48:49 -0300 vestigial widget class removed r20466@hades (orig r577): matthewt | 2008-02-03 11:03:21 -0300 simple mutable fields now use value_string (ChooseMany unconverted) r20467@hades (orig r578): matthewt | 2008-02-03 17:27:18 -0300 clean out pre-widget stuff r20468@hades (orig r579): groditi | 2008-02-03 21:18:36 -0300 burnt out, so writing some docs to clear my brain r20523@hades (orig r586): matthewt | 2008-02-07 05:52:10 -0300 better error on failed layout set lookup r20524@hades (orig r587): matthewt | 2008-02-07 05:52:49 -0300 pass _parent to collections r20525@hades (orig r588): matthewt | 2008-02-07 12:58:53 -0300 complete MooseX::Types port r20526@hades (orig r589): wreis | 2008-02-07 18:12:22 -0300 added meta_info for VP::SiteLayout r20530@hades (orig r590): matthewt | 2008-02-08 06:42:45 -0300 refactor Reflector a bit and eliminate some silent fail possibilities r20534@hades (orig r594): matthewt | 2008-02-09 14:23:48 -0300 alter skin loading precedence (layoutset path search always starts from toip except for =extends NEXT r20535@hades (orig r595): matthewt | 2008-02-09 14:24:23 -0300 prevent immutable creating new() methods for Reaction metaclasses r20536@hades (orig r596): matthewt | 2008-02-09 14:26:50 -0300 was part of skin precedence changes but bungled the command r20537@hades (orig r597): matthewt | 2008-02-09 14:27:38 -0300 avoid passwords going into <input> elements r20539@hades (orig r599): matthewt | 2008-02-10 07:48:52 -0300 _ prefixed writer doth not mean rw r20540@hades (orig r600): matthewt | 2008-02-10 07:49:18 -0300 fix method modifiers r20541@hades (orig r601): matthewt | 2008-02-10 08:57:26 -0300 get rid of extraneous whitepsace in textaeras r20542@hades (orig r602): matthewt | 2008-02-10 08:57:43 -0300 fix vp_args passing to actions
Diffstat (limited to 'lib/Reaction/Types')
-rw-r--r--lib/Reaction/Types/Core.pm70
-rw-r--r--lib/Reaction/Types/CreditCard.pm49
-rw-r--r--lib/Reaction/Types/DBIC.pm8
-rw-r--r--lib/Reaction/Types/DateTime.pm18
-rw-r--r--lib/Reaction/Types/Email.pm8
5 files changed, 52 insertions, 101 deletions
diff --git a/lib/Reaction/Types/Core.pm b/lib/Reaction/Types/Core.pm
index 62d508c..afd7454 100644
--- a/lib/Reaction/Types/Core.pm
+++ b/lib/Reaction/Types/Core.pm
@@ -6,48 +6,48 @@ use MooseX::Types
use MooseX::Types::Moose qw/Str Num Int/;
-subtype SimpleStr
- => as Str
- => where { (length($_) <= 255) && ($_ !~ m/\n/) }
- => message { "Must be a single line of no more than 255 chars" };
+subtype SimpleStr,
+ as Str,
+ where { (length($_) <= 255) && ($_ !~ m/\n/) },
+ message { "Must be a single line of no more than 255 chars" };
-subtype NonEmptySimpleStr
- => as SimpleStr
- => where { length($_) > 0 }
- => message { "Must be a non-empty single line of no more than 255 chars" };
+subtype NonEmptySimpleStr,
+ as SimpleStr,
+ where { length($_) > 0 },
+ message { "Must be a non-empty single line of no more than 255 chars" };
# XXX duplicating constraint msges since moose only uses last message
-subtype Password
- => as NonEmptySimpleStr
- => where { length($_) > 3 }
- => message { "Must be between 4 and 255 chars" };
+subtype Password,
+ as NonEmptySimpleStr,
+ where { length($_) > 3 },
+ message { "Must be between 4 and 255 chars" };
-subtype StrongPassword
- => as Password
- => where { (length($_) > 7) && (m/[^a-zA-Z]/) }
- => message {
+subtype StrongPassword,
+ as Password,
+ where { (length($_) > 7) && (m/[^a-zA-Z]/) },
+ message {
"Must be between 8 and 255 chars, and contain a non-alpha char" };
-subtype NonEmptyStr
- => as Str
- => where { length($_) > 0 }
- => message { "Must not be empty" };
-
-subtype PositiveNum
- => as Num
- => where { $_ >= 0 }
- => message { "Must be a positive number" };
-
-subtype PositiveInt
- => as Int
- => where { $_ >= 0 }
- => message { "Must be a positive integer" };
-
-subtype SingleDigit
- => as PositiveInt
- => where { $_ <= 9 }
- => message { "Must be a single digit" };
+subtype NonEmptyStr,
+ as Str,
+ where { length($_) > 0 },
+ message { "Must not be empty" };
+
+subtype PositiveNum,
+ as Num,
+ where { $_ >= 0 },
+ message { "Must be a positive number" };
+
+subtype PositiveInt,
+ as Int,
+ where { $_ >= 0 },
+ message { "Must be a positive integer" };
+
+subtype SingleDigit,
+ as PositiveInt,
+ where { $_ <= 9 },
+ message { "Must be a single digit" };
1;
diff --git a/lib/Reaction/Types/CreditCard.pm b/lib/Reaction/Types/CreditCard.pm
deleted file mode 100644
index f733355..0000000
--- a/lib/Reaction/Types/CreditCard.pm
+++ /dev/null
@@ -1,49 +0,0 @@
-package Reaction::Types::CreditCard;
-
-use MooseX::Types
- -declare => [qw/CardNumber CheckNumber/];
-
-use Reaction::Types::Core qw/NonEmptySimpleStr PositiveInt/;
-use Business::CreditCard ();
-
-subtype CardNumber
- => as NonEmptySimpleStr
- => where { Business::CreditCard::validate($_) }
- => message {"Must be a valid card number"};
-
-subtype CheckNumber
- => as PositiveInt
- => where { $_ <= 999 }
- => message { "Must be a 3 digits number" };
-
-1;
-
-=head1 NAME
-
-Reaction::Types::CreditCard
-
-=head1 DESCRIPTION
-
-=over
-
-=item * CardNumber
-
-=back
-
-=head1 SEE ALSO
-
-=over
-
-=item * L<Reaction::Types::Core>
-
-=back
-
-=head1 AUTHORS
-
-See L<Reaction::Class> for authors.
-
-=head1 LICENSE
-
-See L<Reaction::Class> for the license.
-
-=cut
diff --git a/lib/Reaction/Types/DBIC.pm b/lib/Reaction/Types/DBIC.pm
index 0dd1ff8..8f9a37d 100644
--- a/lib/Reaction/Types/DBIC.pm
+++ b/lib/Reaction/Types/DBIC.pm
@@ -11,8 +11,8 @@ subtype 'DBIx::Class::ResultSet'
=> as 'Object'
=> where { $_->isa('DBIx::Class::ResultSet') };
-subtype ResultSet
- => as 'DBIx::Class::ResultSet';
+subtype ResultSet,
+ as 'DBIx::Class::ResultSet';
use DBIx::Class::Core;
use DBIx::Class::Row;
@@ -21,8 +21,8 @@ subtype 'DBIx::Class::Row'
=> as 'Object'
=> where { $_->isa('DBIx::Class::Row') };
-subtype Row
- => as 'DBIx::Class::Row';
+subtype Row,
+ as 'DBIx::Class::Row';
1;
diff --git a/lib/Reaction/Types/DateTime.pm b/lib/Reaction/Types/DateTime.pm
index 491ebe5..d6294d2 100644
--- a/lib/Reaction/Types/DateTime.pm
+++ b/lib/Reaction/Types/DateTime.pm
@@ -6,19 +6,19 @@ use MooseX::Types
use MooseX::Types::Moose qw/Object ArrayRef/;
use DateTime;
-subtype DateTime
- => as Object
- => where { $_->isa('DateTime') }
- => message { "Must be of the form YYYY-MM-DD HH:MM:SS" };
+subtype DateTime,
+ as Object,
+ where { $_->isa('DateTime') },
+ message { "Must be of the form YYYY-MM-DD HH:MM:SS" };
use DateTime::SpanSet;
-subtype SpanSet
- => as Object
- => where { $_->isa('DateTime::SpanSet') };
+subtype SpanSet,
+ as Object,
+ where { $_->isa('DateTime::SpanSet') };
-subtype TimeRangeCollection
- => as ArrayRef;
+subtype TimeRangeCollection,
+ as ArrayRef;
1;
diff --git a/lib/Reaction/Types/Email.pm b/lib/Reaction/Types/Email.pm
index a82d16f..01660a3 100644
--- a/lib/Reaction/Types/Email.pm
+++ b/lib/Reaction/Types/Email.pm
@@ -6,10 +6,10 @@ use MooseX::Types
use Reaction::Types::Core 'NonEmptySimpleStr';
use Email::Valid;
-subtype EmailAddress
- => as NonEmptySimpleStr
- => where { Email::Valid->address($_) }
- => message { "Must be a valid e-mail address" };
+subtype EmailAddress,
+ as NonEmptySimpleStr,
+ where { Email::Valid->address($_) },
+ message { "Must be a valid e-mail address" };
1;