Commit 9d7de770 authored by gregor herrmann's avatar gregor herrmann

[svn-upgrade] Integrating new upstream version, libtemplate-declare-perl (0.39)

parent cfe06c83
0.39 - 2009-03-05
* No code changes; increase Test::Warn dependency to 0.11, as 0.10 was
broken
0.38 - 2009-02-27
* Support, but deprecate, Template::Declare->buffer->data(...) usage
0.37 - 2009-02-19
* Make HTML::Lint an optional dependency
0.36 - 2009-02-05
* Hint to the source of the buffer using a 'from' argument. This
allows us to inspect the call stack by looking at the buffer stack.
......
Changes
inc/Module/AutoInstall.pm
inc/Module/Install.pm
inc/Module/Install/AutoInstall.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Include.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
......
......@@ -3,11 +3,10 @@ abstract: 'Perlish declarative templates'
author:
- 'Jesse Vincent <jesse@bestpractical.com>'
build_requires:
HTML::Lint: 0
Test::More: 0
Test::Warn: 0
Test::Warn: 0.11
distribution_type: module
generated_by: 'Module::Install version 0.77'
generated_by: 'Module::Install version 0.79'
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
......@@ -25,4 +24,4 @@ requires:
perl: 5.8.2
resources:
license: http://dev.perl.org/licenses/
version: 0.36
version: 0.39
......@@ -5,14 +5,18 @@ license 'perl';
author 'Jesse Vincent <jesse@bestpractical.com>';
all_from 'lib/Template/Declare.pm';
requires perl => '5.8.2';
perl_version '5.8.2';
build_requires 'HTML::Lint';
build_requires 'Test::More';
build_requires 'Test::Warn';
build_requires 'Test::Warn' => 0.11;
requires 'Class::Accessor::Fast';
requires 'Class::Data::Inheritable';
requires 'Class::ISA';
requires 'String::BufferStack' => 1.10;
feature 'HTML Lint testing' =>
-default => 0,
'HTML::Lint' => 0;
auto_install;
WriteAll;
......@@ -14,24 +14,27 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SHA1 4ec347a5d20c542cedddfc9d7970c447c847fed3 Changes
SHA1 58642f7ef09571d417e4f5b0ca8eb508b9edb235 MANIFEST
SHA1 803a429e08a2af0cb0533e893aa8110f92c908d8 Changes
SHA1 5afe8e5f287785ce0b2e7dd86297188436e247fb MANIFEST
SHA1 6f70228d55d21d8a18d86c6d9acb1a9d5a5504fe MANIFEST.SKIP
SHA1 bacf9729b4c445b2bd0a4590ce7086485c61ed9e META.yml
SHA1 905f717b7e4d05ccd5848d785a639b64888fb401 Makefile.PL
SHA1 ab968279525d26d23e4bf76e3d15e4951f87996f META.yml
SHA1 ee899bc436e17646223925d431d3e9727c1254d1 Makefile.PL
SHA1 65da83220e6bf55fec475fe014f90ad37a9f4969 README
SHA1 5c9e093b0facca46d50e3c69d5569aa7a98db0b8 inc/Module/Install.pm
SHA1 465acb50b9006ce61f58a7bd02d0bb029ddceaa6 inc/Module/Install/Base.pm
SHA1 8356d82167fc00550b4a3ceea8bd852a374d7509 inc/Module/Install/Can.pm
SHA1 b47ce07fa6d6e38e3daa6cfc752b23f59a64754c inc/Module/Install/Fetch.pm
SHA1 37ed4ccd7aba10119e6f2993b8082674ce2e5961 inc/Module/Install/Makefile.pm
SHA1 4aa1c578faad51f31e62bed7b28d3d42b88219c3 inc/Module/Install/Metadata.pm
SHA1 d7529d795a1304c88253b26a9089913edf31ae5e inc/Module/Install/Win32.pm
SHA1 2a74aba5a78e7ab2776382e42106ebe941c2ac28 inc/Module/Install/WriteAll.pm
SHA1 dc0d3e1cfe47042f718ef6df509bf2ebcb0026d0 lib/Template/Declare.pm
SHA1 603bb9de29fb8cba7f13409c546750972eff645d inc/Module/AutoInstall.pm
SHA1 ae018c4565c1277089ca8f1b28f888d95430cb7f inc/Module/Install.pm
SHA1 0a6f29536bedea3bb94744a7d43ffe39da7e4819 inc/Module/Install/AutoInstall.pm
SHA1 4552acdfca8b78f8015d8449e1325616259095f5 inc/Module/Install/Base.pm
SHA1 7fb663fff161fb45882b52edd62857bf15359658 inc/Module/Install/Can.pm
SHA1 8b1d3db746faa6faf2d967a48d3812ec1f44b4c6 inc/Module/Install/Fetch.pm
SHA1 d7ce736cdd05d5156d379ef39cca93beeeeba828 inc/Module/Install/Include.pm
SHA1 9f6beaa2f4749ceb5dd0c9b0c647d0f3289c7b46 inc/Module/Install/Makefile.pm
SHA1 bd988ba3fb7eee0ad889eadc2f5338a8d98fc2a3 inc/Module/Install/Metadata.pm
SHA1 e9aa83f3e8b16ccfce544a90a57b63b70a497759 inc/Module/Install/Win32.pm
SHA1 ade2ac0b0246d4d8e28fa46942e53f6925abda46 inc/Module/Install/WriteAll.pm
SHA1 f5d7256e29324307d7ad4cf54b57e21e30c49349 lib/Template/Declare.pm
SHA1 a44d64624dd8d0ce708a0d056a8945783fd9cd53 lib/Template/Declare/Buffer.pm
SHA1 5b8295d842ccea0a21661583446344733f668879 lib/Template/Declare/TagSet.pm
SHA1 a4b1d4e5e70b6bf928ceb7d6eeb73bc6b2d7d7a9 lib/Template/Declare/TagSet/HTML.pm
SHA1 a3dd8253f179c0e07ea80db89c40a2755eade801 lib/Template/Declare/TagSet/HTML.pm
SHA1 f95b68b4c50afcd1c66d225556dcfa2b2f18e619 lib/Template/Declare/TagSet/RDF.pm
SHA1 4899124cdf56c12fcc7ac1a2b3d99910ed5b8bbb lib/Template/Declare/TagSet/RDF/EM.pm
SHA1 460ab0856c8aea75c81e8cb1e5fb287515b1b2bf lib/Template/Declare/TagSet/XUL.pm
......@@ -76,13 +79,13 @@ SHA1 37978589f2dd9465b67ed70cfe7bca806e0f469f t/tagset_rdf_em.t
SHA1 02301d86757f15e479ca848e7b11c0e625acf304 t/tagset_xul.t
SHA1 1617716eb384026609ac80f505892af9dfbd3fac t/trivial.t
SHA1 66f9ab5624ab7e3afd9a6b5940cc93291f560d01 t/utf8.t
SHA1 888d388aac364fc1c07fc6d5e0ca5be67d41e46d t/utils.pl
SHA1 70b68474a9925d08b24a7af7354dbb7ab369b448 t/utils.pl
SHA1 6a76d87732069df9fa763e4e69a78eb0aff134ba t/wrappers.t
SHA1 c07bcff77839e622b8b1ecffd492f5ccf0ab359c t/xss.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
iEYEARECAAYFAkmLVCYACgkQMflWJZZAbqDi+ACggAa/Eqa6nZ/cwHOSpAEPQNsj
COkAnjSfOczGtdZXhioiCp2zam6BduJ4
=2B8H
iEYEARECAAYFAkmwepUACgkQMflWJZZAbqC3uQCfUUnCARJ3eK7g2vxOkW1mqe5f
ILQAoIVWuGwpjWW9FYvIwchBY0HIaSV8
=adHv
-----END PGP SIGNATURE-----
This diff is collapsed.
......@@ -30,7 +30,7 @@ BEGIN {
# This is not enforced yet, but will be some time in the next few
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '0.77';
$VERSION = '0.79';
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
......@@ -250,7 +250,7 @@ END_DIE
sub load_extensions {
my ($self, $path, $top) = @_;
unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
unless ( grep { !ref $_ and lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
......@@ -366,4 +366,4 @@ sub _CLASS ($) {
1;
# Copyright 2008 Adam Kennedy.
# Copyright 2008 - 2009 Adam Kennedy.
#line 1
package Module::Install::AutoInstall;
use strict;
use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub AutoInstall { $_[0] }
sub run {
my $self = shift;
$self->auto_install_now(@_);
}
sub write {
my $self = shift;
$self->auto_install(@_);
}
sub auto_install {
my $self = shift;
return if $self->{done}++;
# Flatten array of arrays into a single array
my @core = map @$_, map @$_, grep ref,
$self->build_requires, $self->requires;
my @config = @_;
# We'll need Module::AutoInstall
$self->include('Module::AutoInstall');
require Module::AutoInstall;
Module::AutoInstall->import(
(@config ? (-config => \@config) : ()),
(@core ? (-core => \@core) : ()),
$self->features,
);
$self->makemaker_args( Module::AutoInstall::_make_args() );
my $class = ref($self);
$self->postamble(
"# --- $class section:\n" .
Module::AutoInstall::postamble()
);
}
sub auto_install_now {
my $self = shift;
$self->auto_install(@_);
Module::AutoInstall::do_install();
}
1;
#line 1
package Module::Install::Base;
$VERSION = '0.77';
$VERSION = '0.79';
# Suspend handler for "redefined" warnings
BEGIN {
......
......@@ -11,7 +11,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
......
......@@ -6,20 +6,20 @@ use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub get_file {
my ($self, %args) = @_;
my ($scheme, $host, $path, $file) =
my ($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
if ( $scheme eq 'http' and ! eval { require LWP::Simple; 1 } ) {
$args{url} = $args{ftp_url}
or (warn("LWP support unavailable!\n"), return);
($scheme, $host, $path, $file) =
($scheme, $host, $path, $file) =
$args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
}
......
#line 1
package Module::Install::Include;
use strict;
use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
sub include {
shift()->admin->include(@_);
}
sub include_deps {
shift()->admin->include_deps(@_);
}
sub auto_include {
shift()->admin->auto_include(@_);
}
sub auto_include_deps {
shift()->admin->auto_include_deps(@_);
}
sub auto_include_dependent_dists {
shift()->admin->auto_include_dependent_dists(@_);
}
1;
......@@ -7,7 +7,7 @@ use ExtUtils::MakeMaker ();
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
......@@ -64,7 +64,7 @@ sub clean_files {
my $self = shift;
my $clean = $self->makemaker_args->{clean} ||= {};
%$clean = (
%$clean,
%$clean,
FILES => join ' ', grep { length $_ } ($clean->{FILES} || (), @_),
);
}
......@@ -73,7 +73,7 @@ sub realclean_files {
my $self = shift;
my $realclean = $self->makemaker_args->{realclean} ||= {};
%$realclean = (
%$realclean,
%$realclean,
FILES => join ' ', grep { length $_ } ($realclean->{FILES} || (), @_),
);
}
......@@ -124,7 +124,7 @@ sub write {
$self->configure_requires( 'ExtUtils::MakeMaker' => $ExtUtils::MakeMaker::VERSION =~ /^(\d+\.\d+)/ );
# Generate the
# Generate the
my $args = $self->makemaker_args;
$args->{DISTNAME} = $self->name;
$args->{NAME} = $self->module_name || $self->name;
......@@ -196,7 +196,7 @@ sub fix_up_makefile {
my $top_class = ref($self->_top) || '';
my $top_version = $self->_top->VERSION || '';
my $preamble = $self->preamble
my $preamble = $self->preamble
? "# Preamble by $top_class $top_version\n"
. $self->preamble
: '';
......
......@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
$ISCORE = 1;
@ISA = qw{Module::Install::Base};
}
......@@ -176,18 +176,15 @@ sub perl_version {
"Did not provide a value to perl_version()"
);
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Normalize the version
$version = $self->_perl_version($version);
$version =~ s/^(\d+)\.(\d+)\.(\d+)$/sprintf("%d.%03d%03d",$1,$2,$3)/e;
$version =~ s/_.+$//;
$version = $version + 0; # Numify
# We don't support the reall old versions
unless ( $version >= 5.005 ) {
die "Module::Install only supports 5.005 or newer (use ExtUtils::MakeMaker)\n";
}
$self->{values}{perl_version} = $version;
return 1;
}
sub license {
......@@ -451,9 +448,6 @@ sub license_from {
while ( my ($pattern, $license, $osi) = splice(@phrases, 0, 3) ) {
$pattern =~ s{\s+}{\\s+}g;
if ( $license_text =~ /\b$pattern\b/i ) {
if ( $osi and $license_text =~ /All rights reserved/i ) {
print "WARNING: 'All rights reserved' in copyright may invalidate Open Source license.\n";
}
$self->license($license);
return 1;
}
......@@ -482,19 +476,70 @@ sub bugtracker_from {
return 1;
}
sub install_script {
# Convert triple-part versions (eg, 5.6.1 or 5.8.9) to
# numbers (eg, 5.006001 or 5.008009).
# Also, convert double-part versions (eg, 5.8)
sub _perl_version {
my $v = $_[-1];
$v =~ s/^([1-9])\.([1-9]\d?\d?)$/sprintf("%d.%03d",$1,$2)/e;
$v =~ s/^([1-9])\.([1-9]\d?\d?)\.(0|[1-9]\d?\d?)$/sprintf("%d.%03d%03d",$1,$2,$3 || 0)/e;
$v =~ s/(\.\d\d\d)000$/$1/;
$v =~ s/_.+$//;
if ( ref($v) ) {
$v = $v + 0; # Numify
}
return $v;
}
######################################################################
# MYMETA.yml Support
sub WriteMyMeta {
$_[0]->write_mymeta;
}
sub write_mymeta {
my $self = shift;
my $args = $self->makemaker_args;
my $exe = $args->{EXE_FILES} ||= [];
foreach ( @_ ) {
if ( -f $_ ) {
push @$exe, $_;
} elsif ( -d 'script' and -f "script/$_" ) {
push @$exe, "script/$_";
} else {
die("Cannot find script '$_'");
# If there's no existing META.yml there is nothing we can do
return unless -f 'META.yml';
# Merge the perl version into the dependencies
my $val = $self->Meta->{values};
my $perl = delete $val->{perl_version};
if ( $perl ) {
$val->{requires} ||= [];
my $requires = $val->{requires};
# Canonize to three-dot version after Perl 5.6
if ( $perl >= 5.006 ) {
$perl =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2||0), int($3||0))}e
}
unshift @$requires, [ perl => $perl ];
}
# Load the advisory META.yml file
require YAML::Tiny;
my @yaml = YAML::Tiny::LoadFile('META.yml');
my $meta = $yaml[0];
# Overwrite the non-configure dependency hashs
delete $meta->{requires};
delete $meta->{build_requires};
delete $meta->{recommends};
if ( exists $val->{requires} ) {
$meta->{requires} = { map { @$_ } @{ $val->{requires} } };
}
if ( exists $val->{build_requires} ) {
$meta->{build_requires} = { map { @$_ } @{ $val->{build_requires} } };
}
# Save as the MYMETA.yml file
YAML::Tiny::DumpFile('MYMETA.yml', $meta);
}
1;
......@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
......
......@@ -6,7 +6,7 @@ use Module::Install::Base;
use vars qw{$VERSION @ISA $ISCORE};
BEGIN {
$VERSION = '0.77';
$VERSION = '0.79';
@ISA = qw{Module::Install::Base};
$ISCORE = 1;
}
......
......@@ -8,7 +8,7 @@ use Template::Declare::Buffer;
use Class::ISA;
use String::BufferStack;
our $VERSION = "0.36";
our $VERSION = "0.39";
use base 'Class::Data::Inheritable';
__PACKAGE__->mk_classdata('roots');
......@@ -30,7 +30,14 @@ __PACKAGE__->private_templates( {} );
__PACKAGE__->buffer( String::BufferStack->new );
__PACKAGE__->around_template( undef );
*String::BufferStack::data = \&String::BufferStack::buffer;
*String::BufferStack::data = sub {
my $ref = shift;
if (@_) {
warn "Template::Declare->buffer->data called with argument; this usage is deprecated";
${$ref->buffer_ref} = join("", @_);
}
return $ref->buffer;
};
use vars qw/$TEMPLATE_VARS/;
......
......@@ -9,6 +9,7 @@ our %AlternateSpelling = (
tr => 'row',
td => 'cell',
base => 'html_base',
q => 'quote',
);
sub get_alternate_spelling {
......
......@@ -2,20 +2,23 @@ use warnings;
use strict;
use Test::More;
use HTML::Lint;
sub ok_lint {
my $html = shift;
SKIP:
{
my $lint = HTML::Lint->new;
$lint->parse($html);
is( $lint->errors, 0, "Lint checked clean" );
foreach my $error ( $lint->errors ) {
diag( $error->as_string );
}}
skip "HTML::Lint not installed. Skipping", 1
unless eval { require HTML::Lint; 1 };
}
my $lint = HTML::Lint->new;
$lint->parse($html);
is( $lint->errors, 0, "Lint checked clean" );
foreach my $error ( $lint->errors ) {
diag( $error->as_string );
}
}
}
1;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment