Changeset 9629

Show
Ignore:
Timestamp:
04/17/08 21:21:26 (4 years ago)
Author:
lyokato
Message:

lang/perl/OAuth-Lite: Checking in changes prior to tagging of version 0.23. Changelog diff is:

Index: Changes
===================================================================
--- Changes (リビジョン 9628)
+++ Changes (作業コピー)
@@ -1,5 +1,9 @@

Revision history for Perl extension FormValidator::Simple.


+0.23 Thr Apr 17 21:17:00 2008
+ - Applied a patch which lets FVS loads plugin easily with +, like Catalyst.
+ Thanks to Jiro Nishiguchi.
+

0.22 Tue Mar 6 20:07:00 2007

  • Applied a patch that lets it work as expected in case *set_messages* is invoked after *check*.
    Thanks to Yappo.
Location:
lang/perl/FormValidator-Simple/trunk
Files:
4 added
1 removed
4 modified

Legend:

Unmodified
Added
Removed
  • lang/perl/FormValidator-Simple/trunk/Changes

    r3304 r9629  
    11Revision history for Perl extension FormValidator::Simple. 
     2 
     30.23  Thr Apr 17 21:17:00 2008 
     4    - Applied a patch which lets FVS loads plugin easily with +, like Catalyst. 
     5      Thanks to Jiro Nishiguchi. 
    26 
    370.22  Tue Mar 6 20:07:00 2007 
  • lang/perl/FormValidator-Simple/trunk/MANIFEST

    r3304 r9629  
    2626Makefile.PL 
    2727MANIFEST 
     28MANIFEST.SKIP 
    2829META.yml 
    2930README 
     
    6061t/conf/messages_ja.yml 
    6162t/lib/FormValidator/Simple/Plugin/Sample.pm 
     63t/lib/MyNamespace/MyPlugin.pm 
  • lang/perl/FormValidator-Simple/trunk/lib/FormValidator/Simple.pm

    r3304 r9629  
    1313use FormValidator::Simple::Messages; 
    1414 
    15 our $VERSION = '0.22'; 
     15our $VERSION = '0.23'; 
    1616 
    1717__PACKAGE__->mk_classaccessors(qw/data prof results/); 
     
    2121    my $class = shift; 
    2222    foreach my $plugin (@_) { 
    23         my $plugin_class = "FormValidator::Simple::Plugin::".$plugin; 
     23        my $plugin_class; 
     24        if ($plugin =~ /^\+(.*)/) { 
     25            $plugin_class = $1; 
     26        } else { 
     27            $plugin_class = "FormValidator::Simple::Plugin::$plugin"; 
     28        } 
    2429        $class->load_plugin($plugin_class); 
    2530    } 
     
    566571    use FormValidator::Simple; 
    567572    FormValidator::Simple->load_plugin('FormValidator::Simple::Plugin::CreditCard'); 
     573 
     574If you want to load plugin which name isn't in FormValidator::Simple::Plugin namespace, use +. 
     575 
     576    use FormValidator::Simple qw/+MyApp::ValidatorPlugin/; 
    568577 
    569578=head1 MESSAGE HANDLING 
  • lang/perl/FormValidator-Simple/trunk/t/16_plugin.t

    r3304 r9629  
    11use strict; 
    2 use Test::More tests => 3; 
     2use Test::More tests => 5; 
    33use CGI; 
    44 
     
    77BEGIN { require_ok("FormValidator::Simple") }  
    88 
    9 FormValidator::Simple->import('Sample'); 
     9FormValidator::Simple->import(qw/Sample +MyNamespace::MyPlugin/); 
    1010 
    1111my $q = CGI->new; 
     
    1313$q->param( sample2 => 'sample'   ); 
    1414 
     15$q->param( myplugin1 => 'hogehoge' ); 
     16$q->param( myplugin2 => 'myplugin' ); 
     17 
    1518my $r = FormValidator::Simple->check( $q => [ 
    16     sample1 => [qw/SAMPLE/], 
    17     sample2 => [qw/SAMPLE/], 
     19    sample1   => [qw/SAMPLE/], 
     20    sample2   => [qw/SAMPLE/], 
     21    myplugin1 => [qw/MYPLUGIN/], 
     22    myplugin2 => [qw/MYPLUGIN/], 
    1823] ); 
    1924 
     
    2126ok(!$r->invalid('sample2')); 
    2227 
     28ok($r->invalid('myplugin1')); 
     29ok(!$r->invalid('myplugin2'));