Permalink
Browse files

Use fully qualified URLTemplate class name.

  • Loading branch information...
1 parent e00021c commit c3b33c89840047c71af8a00025923ca057038133 @ubu ubu committed Apr 8, 2012
Showing with 10 additions and 4 deletions.
  1. +8 −2 lib/Magpie/ConfigReader/XML.pm
  2. +2 −2 lib/Plack/Middleware/Magpie.pm
@@ -141,10 +141,16 @@ sub process_match {
foreach my $pair (@tuples) {
if (defined $pair->[1]->{traits}) {
- push @{$pair->[1]->{traits}}, '+Magpie::Plugin::URITemplate';
+ if (ref $pair->[1]->{traits} eq 'ARRAY') {
+ push @{$pair->[1]->{traits}}, '+Magpie::Plugin::URITemplate';
+ }
+ else {
+ my $existing = delete $pair->[1]->{traits};
+ $pair->[1]->{traits} = [$existing, '+Magpie::Plugin::URITemplate'];
+ }
}
else {
- $pair->[1]->{traits} = ['URITemplate'];
+ $pair->[1]->{traits} = ['+Magpie::Plugin::URITemplate'];
}
$pair->[1]->{uri_template} = $uri_template;
push @{$input}, @{$pair};
@@ -76,10 +76,10 @@ sub match_template {
my @new_input = ();
foreach my $pair (@tuples) {
if (defined $pair->[1]->{traits}) {
- push @{$pair->[1]->{traits}}, 'URITemplate';
+ push @{$pair->[1]->{traits}}, '+Magpie::Plugin::URITemplate';
}
else {
- $pair->[1]->{traits} = ['URITemplate'];
+ $pair->[1]->{traits} = ['+Magpie::Plugin::URITemplate'];
}
$pair->[1]->{uri_template} = $to_match;

0 comments on commit c3b33c8

Please sign in to comment.