CGI-Application-Plugin-DevPopup-Query-1.03/0000755000000000000000000000000011574321166017103 5ustar rootrootCGI-Application-Plugin-DevPopup-Query-1.03/Makefile.PL0000644000000000000000000000104311306202344021040 0ustar rootroot# $Id: Makefile.PL 14 2009-12-04 12:47:11Z stro $ use strict; use warnings; use ExtUtils::MakeMaker; WriteMakefile( 'DISTNAME' => 'CGI-Application-Plugin-DevPopup-Query', 'NAME' => 'CGI::Application::Plugin::DevPopup::Query', 'ABSTRACT' => 'Show CGI query in DevPopup window', 'AUTHOR' => 'Serguei Trouchelle ', 'VERSION_FROM' => 'Query.pm', 'LICENSE' => 'perl', 'PREREQ_PM' => { 'CGI::Application::Plugin::DevPopup' => 1.03, }, ); CGI-Application-Plugin-DevPopup-Query-1.03/META.yml0000664000000000000000000000113311574321166020354 0ustar rootroot--- #YAML:1.0 name: CGI-Application-Plugin-DevPopup-Query version: 1.03 abstract: Show CGI query in DevPopup window author: - Serguei Trouchelle license: perl distribution_type: module configure_requires: ExtUtils::MakeMaker: 0 build_requires: ExtUtils::MakeMaker: 0 requires: CGI::Application::Plugin::DevPopup: 1.03 no_index: directory: - t - inc generated_by: ExtUtils::MakeMaker version 6.56 meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: 1.4 CGI-Application-Plugin-DevPopup-Query-1.03/MANIFEST0000644000000000000000000000021311574321166020230 0ustar rootrootCHANGES MANIFEST Makefile.PL Query.pm README t/t0.t t/t1.t META.yml Module meta-data (added by MakeMaker) CGI-Application-Plugin-DevPopup-Query-1.03/t/0000755000000000000000000000000011574321165017345 5ustar rootrootCGI-Application-Plugin-DevPopup-Query-1.03/t/t0.t0000644000000000000000000000045511574321123020053 0ustar rootroot#!/usr/env perl # $Id: t0.t 30 2011-06-10 04:48:54Z stro $ use strict; use warnings; BEGIN { use Test; plan('tests' => 1); } require CGI::Application::Plugin::DevPopup::Query; # require, no use -- import wouldn't work this way ok(1); # sanity check and other modules skipping workaround CGI-Application-Plugin-DevPopup-Query-1.03/t/t1.t0000644000000000000000000000321311574321123020047 0ustar rootroot#!/usr/env perl # $Id: t1.t 30 2011-06-10 04:48:54Z stro $ use strict; use warnings; use Data::Dumper; BEGIN { $ENV{'CAP_DEVPOPUP_EXEC'} = 1; } { package My::App; use base qw/CGI::Application/; use CGI; use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::DevPopup::Query; sub setup { my $self = shift; $self->add_callback('devpopup_report', 'my_report'); $self->start_mode('runmode'); $self->run_modes([ qw/runmode/ ]); my $query = CGI->new({'dinosaur' => 'barney'}); $self->query($query); return; } sub runmode { my $self = shift; return 'Hi there!'; } sub my_report { my $self = shift; my $outputref = shift; $self->devpopup->add_report( title => 'Test 1', report => 'Test 1 report body', ); return; } } $ENV{'CGI_APP_RETURN_ONLY'} = 1; $ENV{'HTTP_HOST'} = undef; # RT #42315 eval 'use Test::More 0.88'; if (my $msg = $@) { # Skip all tests because we need Test::More 0.88 $msg =~ s/\sat\s.*$//sx; print '1..0 # SKIP ', $msg, "\n"; } else { plan('tests' => 5); my $app = My::App->new(); my $output = $app->run(); like($output, qr/Test 1 report body/, 'Report generated'); like($output, qr!Current\sRun\sMode!x, 'run mode header is here'); like($output, qr!

runmode

!x, 'runmode value is ok'); like($output, qr!CGI\sQuery\s-\sCGI\srequest\sparameters!x, 'query header is here'); like($output, qr!\sdinosaur\s\sbarney\s!x, 'query value is ok'); } CGI-Application-Plugin-DevPopup-Query-1.03/README0000644000000000000000000000203211307160121017742 0ustar rootrootNAME CGI::Application::Plugin::DevPopup::Query - show CGI query in DevPopup window SYNOPSIS use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::DevPopup::Query; The rest of your application follows ... DESCRIPTION This module is a plugin for CGI::Application::Plugin::DevPopup. Whenever used, it creates a "CGI Query" section in the DevPopup output. This section contains a list of CGI query parameters passed to your CGI::Application. See "query()" in CGI::Application and CGI for more information about query parameters. VERSION 1.01 SEE ALSO CGI::Application::Plugin::DevPopup, CGI::Application INCOMPATIBILITIES Not known. BUGS AND LIMITATIONS Not known. AUTHOR Serguei Trouchelle, stro@cpan.org Most of code is based by CGI::Application::Plugin::DevPopup by Rhesa Rozendaal, rhesa@cpan.org LICENSE AND COPYRIGHT This module is distributed under the same terms as Perl itself. Copyright (c) 2009 Serguei Trouchelle CGI-Application-Plugin-DevPopup-Query-1.03/Query.pm0000644000000000000000000000605611574321123020546 0ustar rootrootpackage CGI::Application::Plugin::DevPopup::Query; # $Id: Query.pm 30 2011-06-10 04:48:54Z stro $ use strict; use warnings; use English qw/-no_match_vars/; use base qw/Exporter/; our $VERSION = '1.03'; =head1 NAME CGI::Application::Plugin::DevPopup::Query - show CGI query in DevPopup window =head1 SYNOPSIS use CGI::Application::Plugin::DevPopup; use CGI::Application::Plugin::DevPopup::Query; The rest of your application follows ... =head1 DESCRIPTION This module is a plugin for L. Whenever used, it creates two sections in the DevPopup output. First section, "B", shows name of run mode executed. Second section, "B", contains a list of CGI query parameters and associated values passed to your CGI::Application. See L and L for more information about query parameters. =head1 VERSION 1.03 =head1 SUBROUTINES/METHODS No public methods for this module exist. =cut sub import { my $c = scalar caller; $c->add_callback( 'devpopup_report', \&_runmode_report ); $c->add_callback( 'devpopup_report', \&_query_report ); goto &Exporter::import; } sub _runmode_report { my $self = shift; my $current_runmode = '

' . ($self->get_current_runmode() || 'default') . '

'; return $self->devpopup->add_report( 'title' => 'Current Run Mode', 'summary' => $current_runmode, 'report' => $current_runmode, ); } sub _query_report { my $self = shift; my $cgi = _cgi_report($self); my $current_runmode = $self->get_current_runmode() || 'default'; return $self->devpopup->add_report( 'title' => 'CGI Query', 'summary' => 'CGI request parameters', 'report' => qq! $cgi

CGI Query

!, ); } sub _cgi_report { my $self = shift; my $r = 0; my $q = $self->query; my $report = 'paramvalue' . join ($INPUT_RECORD_SEPARATOR, map { $r=1-$r; qq! $_ @{[$q->param($_)]} ! } sort $q->param()); return $report; } 1; =head1 DEPENDENCIES L =head1 CONFIGURATION AND ENVIRONMENT N/A =head1 DIAGNOSTICS N/A =head1 SEE ALSO L, L =head1 INCOMPATIBILITIES Not known. =head1 BUGS AND LIMITATIONS Not known. =head1 AUTHOR Serguei Trouchelle, L Most of code is based by CGI::Application::Plugin::DevPopup by Rhesa Rozendaal, L =head1 LICENSE AND COPYRIGHT This module is distributed under the same terms as Perl itself. Copyright (c) 2009-2011 Serguei Trouchelle =cut CGI-Application-Plugin-DevPopup-Query-1.03/CHANGES0000644000000000000000000000037611574321123020075 0ustar rootroot# 1.03 2011/06/09 Style updates, added "Current Run Mode" section per Mark Stosberg's request (RT#68724) # 1.02 2009/12/25 Some wording changed # 1.01 2009/12/07 Documentation slightly extended # 1.00 2009/12/04 Initial revision