debian/0000755000000000000000000000000012211364077007171 5ustar debian/rules0000755000000000000000000000011311615537122010244 0ustar #!/usr/bin/make -f %: dh $@ override_dh_compress: dh_compress -X.cgi debian/patches/0000755000000000000000000000000012211363226010613 5ustar debian/patches/file-size-tests.patch0000644000000000000000000000206211627115633014672 0ustar Description: File size tests failing since recent upgrades Bug: http://rt.cpan.org/Ticket/Display.html?id=70523 Bug-Debian: http://bugs.debian.org/637791 Author: Nicholas Bamber Last-Update: 2011-08-26 --- libcgi-application-plugin-ajaxupload-perl-0.0.3.orig/t/03.images.t +++ libcgi-application-plugin-ajaxupload-perl-0.0.3/t/03.images.t @@ -243,7 +243,8 @@ subtest 'options' => sub{ qr!{"status":"UPLOADED","image_url":"$upload_subdir/test.jpeg"}!xms, 'UPLOADED' ); - is(-s "$tmpdir_name$upload_subdir/test.jpeg", 4046, 'file size'); + my $size = -s "$tmpdir_name/$upload_subdir/test.jpeg"; + ok($size >= 4000 && $size <= 4100, 'file size'); }; subtest 'UPLOADED' => sub{ @@ -266,7 +267,8 @@ subtest 'UPLOADED' => sub{ qr!{"status":"UPLOADED","image_url":"/img/uploads/test.jpeg"}!xms, 'UPLOADED' ); - is(-s "$tmpdir_name/img/uploads/test.jpeg", 4046, 'file size'); + my $size = -s "$tmpdir_name/img/uploads/test.jpeg"; + ok($size >= 4000 && $size <= 4100, 'file size'); }; debian/patches/series0000644000000000000000000000007612211360464012034 0ustar file-size-tests.patch spelling.patch compare-structures.patch debian/patches/spelling.patch0000644000000000000000000000100411627115633013453 0ustar Author: Nicholas Bamber Subject: Spelling Bug: http://rt.cpan.org/Tiket/Display.html?id=70522 Last-Update: 2011-08-26 --- a/lib/CGI/Application/Plugin/AJAXUpload.pm +++ b/lib/CGI/Application/Plugin/AJAXUpload.pm @@ -246,7 +246,7 @@ =item upload_subdir This is the sub-directory of I where the files will actually -be written to. It must be writeable. It defaults to '/img/uploads'. +be written to. It must be writable. It defaults to '/img/uploads'. =item dfv_profile debian/patches/compare-structures.patch0000644000000000000000000001041112211363226015500 0ustar Description: compare structures as such, not as json-encoded strings The problem with json-encoded strings is that hash keys' order is unpredictable from perl 5.18 on Author: Damyan Ivanov Bug: https://rt.cpan.org/Ticket/Display.html?id=88002 Bug-Debian: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=719986 Forwarded: yes --- a/t/04-resize.t +++ b/t/04-resize.t @@ -267,7 +267,7 @@ subtest 'options' => sub{ isa_ok($app, 'CGI::Application'); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"$upload_subdir/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "$upload_subdir/test.jpeg" }, 'UPLOADED' ); size_ok("$tmpdir_name$upload_subdir/test.jpeg", [300,int(250*300/400)], "size 300x200"); @@ -293,7 +293,7 @@ subtest 'UPLOADED' => sub{ $app->query->param(validate=>1); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"/img/uploads/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "/img/uploads/test.jpeg" }, 'UPLOADED' ); size_ok("$tmpdir_name/img/uploads/test.jpeg", [300,int(250*300/400)], "size 300x200"); @@ -320,7 +320,7 @@ subtest 'png' => sub{ $app->query->param(validate=>1); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"/img/uploads/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "/img/uploads/test.jpeg" }, 'UPLOADED' ); size_ok("$tmpdir_name/img/uploads/test.jpeg", [300,int(250*300/400)], "size 300x200"); @@ -347,7 +347,7 @@ subtest 'square' => sub{ $app->query->param(validate=>1); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"/img/uploads/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "/img/uploads/test.jpeg" }, 'UPLOADED' ); size_ok("$tmpdir_name/img/uploads/test.jpeg", [80,50], "size 300x50"); --- a/t/lib/TestWebApp.pm +++ b/t/lib/TestWebApp.pm @@ -1,6 +1,6 @@ package TestWebApp; use base qw(CGI::Application); -use CGI::Application::Plugin::JSON qw(to_json); +use CGI::Application::Plugin::JSON qw(to_json from_json); use CGI::Application::Plugin::AJAXUpload; use File::Temp; use Test::More; @@ -51,7 +51,12 @@ sub response_like { my ($header, $body) = split /\r\n\r\n/, $output; like($header, $header_re, "$comment (header match)"); - like($body, $body_re, "$comment (body match)"); + if ( ref($body_re) and ref($body_re) eq 'HASH' ) { + is_deeply( $self->from_json($body), $body_re, "$comment (body json)" ); + } + else { + like($body, $body_re, "$comment (body match)"); + } return; } --- a/t/02.warnings.t +++ b/t/02.warnings.t @@ -303,7 +303,7 @@ subtest 'options' => sub{ isa_ok($app, 'CGI::Application'); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"$upload_subdir/test.txt"}!xms, + { status => "UPLOADED", image_url => "$upload_subdir/test.txt" }, 'UPLOADED' ); is(slurp("$tmpdir_name$upload_subdir/test.txt"), "This is a test!", 'file contents'); @@ -329,7 +329,7 @@ subtest 'UPLOADED' => sub{ $app->query->param(validate=>1); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"/img/uploads/test.txt"}!xms, + { status => "UPLOADED", image_url => "/img/uploads/test.txt" }, 'UPLOADED' ); is(slurp("$tmpdir_name/img/uploads/test.txt"), "This is a test!", 'file contents'); --- a/t/03.images.t +++ b/t/03.images.t @@ -240,7 +240,7 @@ subtest 'options' => sub{ isa_ok($app, 'CGI::Application'); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"$upload_subdir/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "$upload_subdir/test.jpeg" }, 'UPLOADED' ); my $size = -s "$tmpdir_name/$upload_subdir/test.jpeg"; @@ -264,7 +264,7 @@ subtest 'UPLOADED' => sub{ $app->query->param(validate=>1); $app->response_like( $CONTENT_RE, - qr!{"status":"UPLOADED","image_url":"/img/uploads/test.jpeg"}!xms, + { status => "UPLOADED", image_url => "/img/uploads/test.jpeg" }, 'UPLOADED' ); my $size = -s "$tmpdir_name/img/uploads/test.jpeg"; debian/libcgi-application-plugin-ajaxupload-perl.examples0000644000000000000000000000001211615537122021036 0ustar example/* debian/copyright0000644000000000000000000000213612211356020011113 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: CGI-Application-Plugin-AJAXUpload Upstream-Contact: Nicholas Bamber Source: https://metacpan.org/release/CGI-Application-Plugin-AJAXUpload/ Files: * Copyright: 2010, Nicholas Bamber License: Artistic or GPL-1+ Files: debian/* Copyright: 2011, Nicholas Bamber License: Artistic or GPL-1+ License: Artistic This program is free software; you can redistribute it and/or modify it under the terms of the Artistic License, which comes with Perl. . On Debian systems, the complete text of the Artistic License can be found in `/usr/share/common-licenses/Artistic'. License: GPL-1+ This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. . On Debian systems, the complete text of version 1 of the GNU General Public License can be found in `/usr/share/common-licenses/GPL-1'. debian/watch0000644000000000000000000000024012126250774010221 0ustar version=3 https://metacpan.org/release/CGI-Application-Plugin-AJAXUpload/ .*/CGI-Application-Plugin-AJAXUpload-v?(\d[\d.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$ debian/source/0000755000000000000000000000000011673630667010505 5ustar debian/source/format0000644000000000000000000000001411615537122011677 0ustar 3.0 (quilt) debian/source/lintian-overrides0000644000000000000000000000042611673630667014070 0ustar # Debian Perl Group policy is that the copyright format be kept at # this version until the standard is finalized. libcgi-application-plugin-ajaxupload-perl source: out-of-date-copyright-format-uri http://anonscm.debian.org/viewvc/dep/web/deps/dep5.mdwn?view=markup&pathrev=135 debian/control0000644000000000000000000000431312211364002010561 0ustar Source: libcgi-application-plugin-ajaxupload-perl Maintainer: Debian Perl Group Uploaders: Nicholas Bamber Section: perl Priority: optional Build-Depends: debhelper (>= 8) Build-Depends-Indep: perl, libtest-nowarnings-perl, libtest-warn-perl, libtest-cgi-multipart-perl, libtest-image-gd-perl, libcgi-application-plugin-json-perl, libcgi-application-perl, libperl6-slurp-perl, libreadonly-perl, libdata-formvalidator-perl Standards-Version: 3.9.4 Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-perl/packages/libcgi-application-plugin-ajaxupload-perl.git Vcs-Git: git://anonscm.debian.org/pkg-perl/packages/libcgi-application-plugin-ajaxupload-perl.git Homepage: https://metacpan.org/release/CGI-Application-Plugin-AJAXUpload/ Package: libcgi-application-plugin-ajaxupload-perl Architecture: all Depends: ${misc:Depends}, ${perl:Depends}, perl, libcgi-application-perl, libperl6-slurp-perl, libreadonly-perl, libdata-formvalidator-perl, libgd-gd2-perl (>= 1:2.45-2) Recommends: libcgi-application-plugin-json-bundle-perl, libreadonly-xs-perl Description: run mode to handle a file upload and return a JSON response CGI::Application::Plugin::AJAXUpload provides a customisable run mode that handles a file upload and responds with a JSON message like the following: . {status: 'UPLOADED', image_url: '/img/uploads/666.png'} . or on failure . {status: 'The image was too big.'} . This is specifically intended to provide a CGI::Application based back end for AllMyBrain.com's image upload extension to the YUI rich text editor. It could probbably be used as a back end for any CGI::Application website that uploads files behind the scenes using AJAX. In any case this module does NOT provide any of that client side code and you must also map the run mode onto the URL used by client-side code. That said a working example is provided which could form the basis of a rich text editor. debian/compat0000644000000000000000000000000211673630667010403 0ustar 8 debian/changelog0000644000000000000000000000345212211364077011047 0ustar libcgi-application-plugin-ajaxupload-perl (0.0.3-4) unstable; urgency=low * Team upload [ gregor herrmann ] * debian/control: update {versioned,alternative} (build) dependencies. [ Salvatore Bonaccorso ] * Change Vcs-Git to canonical URI (git://anonscm.debian.org) * Change search.cpan.org based URIs to metacpan.org based URIs [ Axel Beckert ] * debian/copyright: migrate pre-1.0 format to 1.0 using "cme fix dpkg- copyright" [ Damyan Ivanov ] * add patch fixing comparison of structures as json-encoded strings fixes test failures with perl 5.18, which has improved hash randomization (Closes: #719986) * Standards-Version: 3.9.4 (no changes needed) -- Damyan Ivanov Tue, 03 Sep 2013 16:46:21 +0300 libcgi-application-plugin-ajaxupload-perl (0.0.3-3) unstable; urgency=low * Tightened dependencies from bundle to spinoff package * Raised debhelper version and compat level to 8 * Added lintian override concerning DEP-5 format -- Nicholas Bamber Mon, 05 Dec 2011 21:33:39 +0000 libcgi-application-plugin-ajaxupload-perl (0.0.3-2) unstable; urgency=low [ Ansgar Burchardt ] * debian/control: Convert Vcs-* fields to Git. [ Salvatore Bonaccorso ] * debian/copyright: Replace DEP5 Format-Specification URL from svn.debian.org to anonscm.debian.org URL. [ Nicholas Bamber ] * Added patch to relax file size test to range (Closes: #637791) * Removed unnecessary dependency * Raised standards version to 3.9.2 * Added patch for spelling error -- Nicholas Bamber Fri, 26 Aug 2011 23:20:27 +0100 libcgi-application-plugin-ajaxupload-perl (0.0.3-1) unstable; urgency=low * Initial Release. (Closes: #608882) -- Nicholas Bamber Mon, 21 Mar 2011 22:51:48 +0000