Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

added yaml aliases support

  • Loading branch information...
commit 5679cf9583b634f656c861e7cb1af43b01805b21 1 parent ed1bb49
typester authored
View
4 lib/Catalyst/Plugin/FormValidator/Simple/Auto.pm
@@ -132,7 +132,9 @@ sub setup {
if ( $config->{profiles} and ref $config->{profiles} ne 'HASH' ) {
my $profiles = eval {
- YAML::LoadFile( $config->{profiles} );
+ no warnings 'once';
+ $YAML::UseAliases = 0;
+ YAML::Load( YAML::Dump( YAML::LoadFile( $config->{profiles} ) ) ); # XXX: remove yaml aliases
};
Catalyst::Exception->throw( message => __PACKAGE__ . qq/: $@/ ) if $@;
View
16 t/07_alias.t
@@ -9,23 +9,13 @@ use warnings;
FormValidator::Simple::Auto
/;
- use YAML;
-
- my $conf = <<'_YAML_';
-action1:
- param1: &param1
- - rule: NOT_BLANK
- message: blank
-
-action2:
- param1: *param1
-
-_YAML_
+ use FindBin;
+ use File::Spec;
__PACKAGE__->config(
name => 'TestApp',
validator => {
- profiles => YAML::Load($conf),
+ profiles => File::Spec->catfile($FindBin::Bin, '07_alias.yaml'),
},
);
__PACKAGE__->setup;
View
8 t/07_alias.yaml
@@ -0,0 +1,8 @@
+action1:
+ param1: &param1
+ - rule: NOT_BLANK
+ message: blank
+
+action2:
+ param1: *param1
+
Please sign in to comment.
Something went wrong with that request. Please try again.