[libmagpie-perl] 02/30: CGI::Struct input transformer
Jonas Smedegaard
dr at jones.dk
Wed Dec 6 00:56:38 UTC 2017
This is an automated email from the git hooks/post-receive script.
js pushed a commit to annotated tag debian/1.163200-1
in repository libmagpie-perl.
commit 1e8276323c8281bad5135face64e872d1bd3937a
Author: Chris Prather <chris at prather.org>
Date: Fri Feb 21 20:44:43 2014 -0500
CGI::Struct input transformer
---
lib/Magpie/Transformer/Input/CGIStruct.pm | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)
diff --git a/lib/Magpie/Transformer/Input/CGIStruct.pm b/lib/Magpie/Transformer/Input/CGIStruct.pm
new file mode 100644
index 0000000..a2d62d1
--- /dev/null
+++ b/lib/Magpie/Transformer/Input/CGIStruct.pm
@@ -0,0 +1,22 @@
+package Magpie::Transformer::Input::CGIStruct;
+use Moose;
+extends qw(Magpie::Transformer);
+use Magpie::Constants;
+use CGI::Struct;
+use Try::Tiny;
+
+__PACKAGE__->register_events(qw(transform));
+sub load_queue { return qw(transform) }
+
+sub transform {
+ my $self = shift;
+ my $ctxt = shift;
+ try {
+ $ctxt->{data} = build_cgi_struct $self->request->parameters->mixed;
+ return OK;
+ }
+ catch {
+ $self->set_error({status_code => 400, reason => $_ });
+ return DECLINED
+ };
+}
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmagpie-perl.git
More information about the Pkg-perl-cvs-commits
mailing list