diff options
author | Jesse Luehrs <doy@tozt.net> | 2010-04-19 15:39:15 -0500 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2010-04-19 15:39:15 -0500 |
commit | 2f652ba783a4b8675a020955e494c64391eb0ab2 (patch) | |
tree | b1e6f0ee404fc911017d123a9c85559964c938cb /lib/Resource/Pack/JSON/URL.pm | |
parent | 549b2365930137f85799ee1975b4b43dbdbdd290 (diff) | |
download | resource-pack-json-2f652ba783a4b8675a020955e494c64391eb0ab2.tar.gz resource-pack-json-2f652ba783a4b8675a020955e494c64391eb0ab2.zip |
initial implementation
Diffstat (limited to 'lib/Resource/Pack/JSON/URL.pm')
-rw-r--r-- | lib/Resource/Pack/JSON/URL.pm | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/lib/Resource/Pack/JSON/URL.pm b/lib/Resource/Pack/JSON/URL.pm new file mode 100644 index 0000000..441ce2d --- /dev/null +++ b/lib/Resource/Pack/JSON/URL.pm @@ -0,0 +1,43 @@ +package Resource::Pack::JSON::URL; +use Moose; + +extends 'Resource::Pack::URL'; + +=head1 NAME + +Resource::Pack::JSON::URL - subclass of Resource::Pack::URL to clean up the json2.js souce + +=head1 DESCRIPTION + +This modifies the install process to strip out the alert that json2.js includes +at the top of the file. + +=cut + +after install => sub { + my $self = shift; + my $installed = $self->install_to_absolute; + my $contents = $installed->slurp; + $contents =~ s/^\Qalert('IMPORTANT: Remove this line from json2.js before deployment.');\E\n//; + my $fh = $installed->openw; + $fh->print($contents); + $fh->close; +}; + +__PACKAGE__->meta->make_immutable; +no Moose; + +=head1 AUTHOR + + Jesse Luehrs <doy at tozt dot net> + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2010 by Jesse Luehrs. + +This is free software; you can redistribute it and/or modify it under +the same terms as perl itself. + +=cut + +1; |