Skip to content

Commit

Permalink
adding new versions of autogenerated stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
mpeters committed Jul 8, 2010
1 parent 49de230 commit cdf64ee
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 25 deletions.
30 changes: 16 additions & 14 deletions META.yml
Original file line number Diff line number Diff line change
@@ -1,23 +1,25 @@
---
name: CGI-Application-Plugin-JSON
version: 1.01
abstract: 'easy manipulation of JSON headers'
author:
- 'Michael Peters <mpeters@plusthree.com>'
abstract: easy manipulation of JSON headers
license: perl
resources:
license: http://dev.perl.org/licenses/
requires:
CGI::Application: 4
JSON::Any: 1.14
Test::More: 0
build_requires:
JSON: 2.02
configure_requires:
Module::Build: 0.36
generated_by: 'Module::Build version 0.3607'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
name: CGI-Application-Plugin-JSON
provides:
CGI::Application::Plugin::JSON:
file: lib/CGI/Application/Plugin/JSON.pm
version: 1.01
generated_by: Module::Build version 0.2808
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.2.html
version: 1.2
requires:
CGI::Application: 4
JSON::Any: 1.14
Test::More: 0
resources:
license: http://dev.perl.org/licenses/
version: 1.01
24 changes: 13 additions & 11 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
# Note: this file was auto-generated by Module::Build::Compat version 0.03
# Note: this file was auto-generated by Module::Build::Compat version 0.3607

unless (eval "use Module::Build::Compat 0.02; 1" ) {
print "This module requires Module::Build to install itself.\n";

require ExtUtils::MakeMaker;
my $yn = ExtUtils::MakeMaker::prompt
(' Install Module::Build now from CPAN?', 'y');

unless ($yn =~ /^y/i) {
die " *** Cannot install without Module::Build. Exiting ...\n";
}

require Cwd;
require File::Spec;
require CPAN;

# Save this 'cause CPAN will chdir all over the place.
my $cwd = Cwd::cwd();

CPAN::Shell->install('Module::Build::Compat');
CPAN::Shell->expand("Module", "Module::Build::Compat")->uptodate
or die "Couldn't install Module::Build, giving up.\n";

chdir $cwd or die "Cannot chdir() back to $cwd: $!";
}
eval "use Module::Build::Compat 0.02; 1" or die $@;

Module::Build::Compat->run_build_pl(args => \@ARGV);
my $build_pkg = eval { require Module::Build }
? 'Module::Build' : 'Module::Build';
Module::Build::Compat->write_makefile(build_class => $build_pkg)
my $build_script = 'Build';
$build_script .= '.com' if $^O eq 'VMS';
exit(0) unless(-e $build_script); # cpantesters convention
require Module::Build;
Module::Build::Compat->write_makefile(build_class => 'Module::Build');
14 changes: 14 additions & 0 deletions README
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ SYNOPSIS

# clear out everything in the outgoing JSON headers
$self->clear_json_header();

# check to see if there's a JSON header or body in play
return if $self->has_json();

# or send the JSON in the document body
$self->json_body( { foo => 'Lorem ipsum', bar => [ 0, 2, 3 ] } );
Expand Down Expand Up @@ -57,6 +60,17 @@ HEADER METHODS
json_header and add_json_header. This means that no "X-JSON" header will
be sent.

has_json
This method will check to see if there's a JSON header (or body) in play
and return true. This is useful in the case of wanting to skip shell
templates in a generic cgiapp_postrun method:

sub cgiapp_postrun {
my ( $self, $output_ref ) = @_;
return if $self->has_json();
# proceed w/ shell...
}

json_header_string
This method will create the actual HTTP header string that will be sent
to the browser. This plugin uses it internally to send the header, but
Expand Down

0 comments on commit cdf64ee

Please sign in to comment.