Commit fff0c6d5 authored by Yves Agostini's avatar Yves Agostini

[svn-inject] Installing original source of libtemplate-declare-perl

parents
This diff is collapsed.
Changes
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/Template/Declare.pm
lib/Template/Declare/Buffer.pm
lib/Template/Declare/Tags.pm
lib/Template/Declare/TagSet.pm
lib/Template/Declare/TagSet/HTML.pm
lib/Template/Declare/TagSet/RDF.pm
lib/Template/Declare/TagSet/RDF/EM.pm
lib/Template/Declare/TagSet/XUL.pm
Makefile.PL
MANIFEST This list of files
MANIFEST.SKIP
META.yml
README
SIGNATURE
t/99-pod-coverage.t
t/99-pod.t
t/aliasing.t
t/alternative.t
t/arg-declaration-styles.t
t/arg-passing.t
t/attributes.t
t/closures.t
t/deep_aliasing.t
t/deep_importing.t
t/duplicate_element_ids.t
t/forms.t
t/importing.t
t/indent.t
t/indexhtml.t
t/instrumentation.t
t/MyTagSet.pm
t/namespace.t
t/pitfalls.t
t/postprocessor.t
t/private.t
t/relative-aliasing.t
t/relative-pathing.t
t/self.t
t/siblings.t
t/similar-aliases.t
t/smart_tag_wrapper.t
t/subclassing.t
t/subtemplates.t
t/tag_sub_list.t
t/tagset_html.t
t/tagset_mix.t
t/tagset_rdf.t
t/tagset_rdf_em.t
t/tagset_xul.t
t/trivial.t
t/utf8.t
t/utils.pl
t/xss.t
^a$
\.swo$
^Template-Declare-\d+\.\d+
^.*ref.*\.xml
^t\.sh$
^\w+\.pm
^t.sh$
^temp/
^lrep/
precedence.pl
RuleInline-more.pl
benchmark.pl
t6/iterator_engine.pl
lib/pcr.txt
lib/print.sh
tmp.txt
lib/Pugs/Grammar/Rule2.pmc
trans.pl
trans2.pl
tmp
^blib/
^Makefile$
^Makefile\.[a-z]+$
\.swp$
Pugs-Compiler-Rule-\d+
^pm_to_blib$
CVS/.*
,v$
^tmp/
\.old$
\.bak$
~$
^#
\.shar$
\.tar$
\.tgz$
\.tar\.gz$
\.zip$
_uu$
t/zz.*
test\.[co]
benchmarks/.*
\.svn
\.t_$
---
abstract: Perlish declarative templates
author: 'Jesse Vincent <jesse@bestpractical.com>'
build_requires:
HTML::Lint: 0
Test::More: 0
Test::Warn: 0
distribution_type: module
generated_by: Module::Install version 0.67
license: perl
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.3.html
version: 1.3
name: Template-Declare
no_index:
directory:
- inc
- t
requires:
Class::Accessor::Fast: 0
Class::Data::Inheritable: 0
perl: 5.6.0
version: 0.25
use inc::Module::Install;
name 'Template-Declare';
license 'perl';
author 'Jesse Vincent <jesse@bestpractical.com>';
all_from 'lib/Template/Declare.pm';
build_requires 'HTML::Lint';
build_requires 'Test::More';
build_requires 'Test::Warn';
requires 'Class::Accessor::Fast';
requires 'Class::Data::Inheritable';
requires 'Class::ISA';
WriteAll;
This diff is collapsed.
This file contains message digests of all files listed in MANIFEST,
signed via the Module::Signature module, version 0.55.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
% cpansign -v
It will check each file's integrity, as well as the signature's
validity. If "==> Signature verified OK! <==" is not displayed,
the distribution may already have been compromised, and you should
not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
SHA1 b54ee3393e208913e115c7b050ebc4094a75e379 Changes
SHA1 9a3b6e693069c8a37774630300229169f636b71c MANIFEST
SHA1 6f70228d55d21d8a18d86c6d9acb1a9d5a5504fe MANIFEST.SKIP
SHA1 bbcafc0b6664f164bc64dfb0ed4cc3228090ba80 META.yml
SHA1 20b89dacc52223a7346678ccb486a85ffd3b5d7f Makefile.PL
SHA1 65da83220e6bf55fec475fe014f90ad37a9f4969 README
SHA1 78edb89a439463e44c33a72bbee84c54d0dc8aaf inc/Module/Install.pm
SHA1 8ea4e37df83fd0c1c050be5c8da75545c3828d9b inc/Module/Install/Base.pm
SHA1 1da6031583c32f0d1ec073b8376102fc51427dcc inc/Module/Install/Can.pm
SHA1 b779375b90c16af2f31f38a1dd2b5df223c7f2fb inc/Module/Install/Fetch.pm
SHA1 2054450e1e9c1dd8056362bf4a64ae70d5d71476 inc/Module/Install/Makefile.pm
SHA1 5d6189b2cad15cf9932a28faafd55130c8247e83 inc/Module/Install/Metadata.pm
SHA1 02af973fae2ac3531fa6b704574b2b8cb2a08148 inc/Module/Install/Win32.pm
SHA1 3a2eab96e91cca8d99938cda7791759ae9d97b3a inc/Module/Install/WriteAll.pm
SHA1 70cacc6fbe8a8b9af995928a115350a01322be2a lib/Template/Declare.pm
SHA1 14e5dc40531ee4a3a180bf208dafb3aff5935f5a lib/Template/Declare/Buffer.pm
SHA1 5b8295d842ccea0a21661583446344733f668879 lib/Template/Declare/TagSet.pm
SHA1 4d5dbe5403bcf697b3cf4b0e179821101e67c63c lib/Template/Declare/TagSet/HTML.pm
SHA1 8e92d7e38a442b5f7989c96312264b127f599700 lib/Template/Declare/TagSet/RDF.pm
SHA1 4899124cdf56c12fcc7ac1a2b3d99910ed5b8bbb lib/Template/Declare/TagSet/RDF/EM.pm
SHA1 f648877df76723ac24627e926d34d1367fb10f82 lib/Template/Declare/TagSet/XUL.pm
SHA1 25193488cd8b8de8e63a24152655e7a54c6a6d23 lib/Template/Declare/Tags.pm
SHA1 7b2832c140109b23ba669db59e5b357dd1d255ec t/99-pod-coverage.t
SHA1 bb0da54f2b3f2d7955baa41ee458cb3d1887f475 t/99-pod.t
SHA1 8de6d59c7ed7c771f9cdc5e2dbaef0c31c7ab439 t/MyTagSet.pm
SHA1 deb55b4ed7eec5eb29479f047ca9759c76a8b803 t/aliasing.t
SHA1 9554ad5bd0cd51af54c59b2ac157c33b78ea4158 t/alternative.t
SHA1 d1f4df2c09918ac0b104c4bab005910d896c2708 t/arg-declaration-styles.t
SHA1 64cbb1ee83b91ea052b8bae12d590cd9c787628c t/arg-passing.t
SHA1 f4924dcec2850125f5eeda4a40525ae3b4d46c76 t/attributes.t
SHA1 ced0409f2bcdf847d521e8664bd045442f51df49 t/closures.t
SHA1 0272bf3a45a9e97eb68399502cbef602eddd1efe t/deep_aliasing.t
SHA1 5dcb568191fcefc1156cfe6e06b0b3e90c3046e4 t/deep_importing.t
SHA1 94c78c32ac1e16780ff2dd09c6f3b734035f83ac t/duplicate_element_ids.t
SHA1 85e2465214c89783cdc2f02e5555ab1c7cc78ae4 t/forms.t
SHA1 c06058b5de4bed61e600e91a475e021e8999da6f t/importing.t
SHA1 27634193f9d55414390a02a8c502e57cdf4c6062 t/indent.t
SHA1 bcc7853609975acb08bb40e65901a63268e378ca t/indexhtml.t
SHA1 be30fd012d21eb1a667f0f538185d8685b2960dc t/instrumentation.t
SHA1 5d8b50381640bef07f473caf7e179fb84c4dd698 t/namespace.t
SHA1 d56b96ce2450c63636e6e873125265a9b5e58af7 t/pitfalls.t
SHA1 fb01850a459d3d340bdf688271d14fc55db321e3 t/postprocessor.t
SHA1 0c00d095bb6ff6fd9d493e8c2ae0f45aa002072b t/private.t
SHA1 a580daf468f50f09a7828ac57f9d738e6f1f4558 t/relative-aliasing.t
SHA1 1e57d39c4b40cd19e14efd93179d87b78e8d54e9 t/relative-pathing.t
SHA1 de23aec78ebc456083d8df85cf11d520bb03544f t/self.t
SHA1 c09c579c74578fbcb9ede55ed634f7052c35580e t/siblings.t
SHA1 0183f5c550973540a4f2d275317350664ae94762 t/similar-aliases.t
SHA1 613d76b8b76c74002da8dff2866539b991b0505a t/smart_tag_wrapper.t
SHA1 adc48b3337a1f468555afbb6bc9f69eda0eca46a t/subclassing.t
SHA1 5bf9c06c76830580e6c402ccea5755201a363a5f t/subtemplates.t
SHA1 44f81200ec38ebf8bc9c836e34942f70990e7207 t/tag_sub_list.t
SHA1 bab73f849bd1251f55e8b933a12ea7a8f3f2d44a t/tagset_html.t
SHA1 6eaf0d5fb857c350844f3b70e899d58b8c92ffc8 t/tagset_mix.t
SHA1 03a32c2247b7a3cc7066c2617605e6391e33cd33 t/tagset_rdf.t
SHA1 37978589f2dd9465b67ed70cfe7bca806e0f469f t/tagset_rdf_em.t
SHA1 02301d86757f15e479ca848e7b11c0e625acf304 t/tagset_xul.t
SHA1 c14430c3789e31fb2e74922bc289cfbcc6ae28ed t/trivial.t
SHA1 66f9ab5624ab7e3afd9a6b5940cc93291f560d01 t/utf8.t
SHA1 888d388aac364fc1c07fc6d5e0ca5be67d41e46d t/utils.pl
SHA1 c07bcff77839e622b8b1ecffd492f5ccf0ab359c t/xss.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
iD8DBQFHtIvbsxfQtHhyRPoRAnqTAJ9M7f4LR7zDwSo2CNQ004W3cf2wagCgl3Qg
Hb++SfaXlNeu+4KjGz8wTbI=
=vf4n
-----END PGP SIGNATURE-----
libtemplate-declare-perl (0.28-1) unstable; urgency=low
* Initial Release (Closes: #476742)
-- AGOSTINI Yves <agostini@univ-metz.fr> Fri, 18 Apr 2008 23:30:59 +0200
Source: libtemplate-declare-perl
Section: perl
Priority: optional
Build-Depends: debhelper (>= 5)
Build-Depends-Indep: perl (>= 5.6.0), libclass-data-inheritable-perl, libclass-accessor-perl
Maintainer: Debian Perl Group <pkg-perl-maintainers@lists.alioth.debian.org>
Uploaders: AGOSTINI Yves <agostini@univ-metz.fr>
Standards-Version: 3.7.3
Homepage: http://search.cpan.org/dist/Template-Declare/
Vcs-Svn: svn://svn.debian.org/pkg-perl/trunk/libtemplate-declare-perl/
Vcs-Browser: http://svn.debian.org/wsvn/pkg-perl/trunk/libtemplate-declare-perl/
Package: libtemplate-declare-perl
Architecture: all
Depends: ${perl:Depends}, ${misc:Depends}, libclass-data-inheritable-perl, libclass-accessor-perl
Description: Perlish declarative templates
Template::Declare is a pure-perl declarative HTML/XUL/RDF/XML templating
system.
.
A few key features and buzzwords:
.
* All templates are 100% pure perl code
* Simple declarative syntax
* No angle brackets
* "Native" XML namespace and declarator support
* Mixins
* Inheritance
* Public and private templates
This is the debian package for the Template-Declare module.
It was downloaded from http://search.cpan.org/dist/Template-Declare/
The upstream author is:
Jesse Vincent <jesse@bestpractical.com>.
Copyright 2006-2007 Best Practical Solutions, LLC This program is
free software; you can redistribute it and/or modify it under the same terms as
Perl itself.
Perl is distributed under either the Artistic licence or the GPL.
The full text of the GPL is available on Debian systems in
/usr/share/common-licenses/GPL
The full text of the Artistic Licence is available on Debian systems in
/usr/share/common-licenses/Artistic.
The Debian packaging is (C) 2008, Debian Perl Group
<pkg-perl-maintainers@lists.alioth.debian.org> and
is licensed under the same terms as the software itself (see above).
Index: Template-Declare-0.28/lib/Template/Declare/Buffer.pm
===================================================================
--- Template-Declare-0.28.orig/lib/Template/Declare/Buffer.pm 2008-04-19 11:49:49.000000000 +0200
+++ Template-Declare-0.28/lib/Template/Declare/Buffer.pm 2008-04-19 11:49:49.000000000 +0200
@@ -12,19 +12,19 @@
no warnings 'uninitialized';
$self->data( $self->data . $content );
-}
+};
sub clear {
my $self = shift;
$self->data('');
-}
+};
1;
__END__
=head1 NAME
-Template::Declare::Buffer
+Template::Declare::Buffer - manage output buffer
=head1 DESCRIPTION
Index: Template-Declare-0.28/lib/Template/Declare/TagSet.pm
===================================================================
--- Template-Declare-0.28.orig/lib/Template/Declare/TagSet.pm 2008-04-19 11:49:49.000000000 +0200
+++ Template-Declare-0.28/lib/Template/Declare/TagSet.pm 2008-04-19 11:49:49.000000000 +0200
@@ -19,10 +19,8 @@
# specify whether "<tag></tag>" can be combined to "<tag />"
sub can_combine_empty_tags {
1;
-}
+};
-1;
-__END__
=head1 NAME
@@ -116,3 +114,6 @@
L<Template::Declare::TagSet::HTML>, L<Template::Declare::TagSet::XUL>, L<Template::Declare::Tags>,
L<Template::Declare>.
+=cut
+
+1;
Index: Template-Declare-0.28/lib/Template/Declare/TagSet/HTML.pm
===================================================================
--- Template-Declare-0.28.orig/lib/Template/Declare/TagSet/HTML.pm 2008-04-19 11:49:49.000000000 +0200
+++ Template-Declare-0.28/lib/Template/Declare/TagSet/HTML.pm 2008-04-19 11:54:12.000000000 +0200
@@ -30,7 +30,7 @@
my ($self, $tag) = @_;
$tag
=~ m{^ (?: base | meta | link | hr | br | param | img | area | input | col ) $}x;
-}
+};
1;
__END__
@@ -116,3 +116,4 @@
L<Template::Declare::TagSet>, L<Template::Declare::TagSet::XUL>, L<Template::Declare::TagSet::RDF>, L<Template::Declare::Tags>, L<Template::Declare>.
+=cut
Index: Template-Declare-0.28/lib/Template/Declare/TagSet/RDF/EM.pm
===================================================================
--- Template-Declare-0.28.orig/lib/Template/Declare/TagSet/RDF/EM.pm 2008-04-19 11:49:49.000000000 +0200
+++ Template-Declare-0.28/lib/Template/Declare/TagSet/RDF/EM.pm 2008-04-19 11:49:49.000000000 +0200
@@ -90,4 +90,3 @@
=head1 SEE ALSO
L<Template::Declare::TagSet>, L<Template::Declare::TagSet::RDF>, L<Template::Declare::TagSet::XUL>, L<Template::Declare::Tags>, L<Template::Declare>.
-
Index: Template-Declare-0.28/lib/Template/Declare/TagSet/RDF.pm
===================================================================
--- Template-Declare-0.28.orig/lib/Template/Declare/TagSet/RDF.pm 2008-04-19 11:57:15.000000000 +0200
+++ Template-Declare-0.28/lib/Template/Declare/TagSet/RDF.pm 2008-04-19 11:57:57.000000000 +0200
@@ -17,17 +17,6 @@
}, (map { "_$_" } 1..10) ];
}
-=begin comment
-
-Tag set for RDF Schema:
-
- Class Container ContainerMembershipProperty
- Datatype Literal Resource
- comment domain isDefinedBy
- label member range
- seeAlso subClassOf subPropertyOf
-
-=cut
1;
__END__
#!/usr/bin/make -f
# This debian/rules file is provided as a template for normal perl
# packages. It was created by Marc Brockschmidt <marc@dch-faq.de> for
# the Debian Perl Group (http://pkg-perl.alioth.debian.org/) but may
# be used freely wherever it is useful.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
# If set to a true value then MakeMaker's prompt function will
# always return the default without waiting for user input.
export PERL_MM_USE_DEFAULT=1
PERL ?= /usr/bin/perl
PACKAGE = $(shell dh_listpackages)
TMP = $(CURDIR)/debian/$(PACKAGE)
include /usr/share/quilt/quilt.make
build: build-stamp
build-stamp: $(QUILT_STAMPFN)
dh_testdir
# Add commands to compile the package here
$(PERL) Makefile.PL INSTALLDIRS=vendor
$(MAKE)
$(MAKE) test
touch $@
clean: unpatch
dh_testdir
dh_testroot
dh_clean build-stamp install-stamp
# Add commands to clean up after the build process here
[ ! -f Makefile ] || $(MAKE) realclean
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_clean -k
# Add commands to install the package into $(TMP) here
$(MAKE) install DESTDIR=$(TMP) PREFIX=/usr
[ ! -d $(TMP)/usr/lib/perl5 ] || \
rmdir --ignore-fail-on-non-empty --parents --verbose \
$(TMP)/usr/lib/perl5
touch $@
binary-arch:
# We have nothing to do here for an architecture-independent package
binary-indep: build install
dh_testdir
dh_testroot
dh_installdocs README
dh_installchangelogs Changes
dh_perl
dh_compress
dh_fixperms
dh_installdeb
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install
# format version number, currently 3; this line is compulsory!
version=3
# URL to the package page followed by a regex to search
http://search.cpan.org/dist/Template-Declare/ .*/Template-Declare-v?(\d[\d_.-]+)\.(?:tar(?:\.gz|\.bz2)?|tgz|zip)$
#line 1
package Module::Install;
# For any maintainers:
# The load order for Module::Install is a bit magic.
# It goes something like this...
#
# IF ( host has Module::Install installed, creating author mode ) {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to installed version of inc::Module::Install
# 3. The installed version of inc::Module::Install loads
# 4. inc::Module::Install calls "require Module::Install"
# 5. The ./inc/ version of Module::Install loads
# } ELSE {
# 1. Makefile.PL calls "use inc::Module::Install"
# 2. $INC{inc/Module/Install.pm} set to ./inc/ version of Module::Install
# 3. The ./inc/ version of Module::Install loads
# }
use 5.004;
use strict 'vars';
use vars qw{$VERSION};
BEGIN {
# All Module::Install core packages now require synchronised versions.
# This will be used to ensure we don't accidentally load old or
# different versions of modules.
# 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.67';
}
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) {
die <<"END_DIE";
Please invoke ${\__PACKAGE__} with:
use inc::${\__PACKAGE__};
not:
use ${\__PACKAGE__};
END_DIE
}
# If the script that is loading Module::Install is from the future,
# then make will detect this and cause it to re-run over and over
# again. This is bad. Rather than taking action to touch it (which
# is unreliable on some platforms and requires write permissions)
# for now we should catch this and refuse to run.
if ( -f $0 and (stat($0))[9] > time ) {
die << "END_DIE";
Your installer $0 has a modification time in the future.
This is known to create infinite loops in make.
Please correct this, then run $0 again.
END_DIE
}
use Cwd ();
use File::Find ();
use File::Path ();
use FindBin;
*inc::Module::Install::VERSION = *VERSION;
@inc::Module::Install::ISA = __PACKAGE__;
sub autoload {
my $self = shift;
my $who = $self->_caller;
my $cwd = Cwd::cwd();
my $sym = "${who}::AUTOLOAD";
$sym->{$cwd} = sub {
my $pwd = Cwd::cwd();
if ( my $code = $sym->{$pwd} ) {
# delegate back to parent dirs
goto &$code unless $cwd eq $pwd;
}
$$sym =~ /([^:]+)$/ or die "Cannot autoload $who - $sym";
unshift @_, ($self, $1);
goto &{$self->can('call')} unless uc($1) eq $1;
};
}
sub import {
my $class = shift;
my $self = $class->new(@_);
my $who = $self->_caller;
unless ( -f $self->{file} ) {
require "$self->{path}/$self->{dispatch}.pm";
File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} = "$self->{name}::$self->{dispatch}"->new( _top => $self );
$self->{admin}->init;
@_ = ($class, _self => $self);
goto &{"$self->{name}::import"};
}
*{"${who}::AUTOLOAD"} = $self->autoload;
$self->preload;
# Unregister loader and worker packages so subdirs can use them again
delete $INC{"$self->{file}"};
delete $INC{"$self->{path}.pm"};
}
sub preload {
my ($self) = @_;
unless ( $self->{extensions} ) {
$self->load_extensions(
"$self->{prefix}/$self->{path}", $self
);
}
my @exts = @{$self->{extensions}};
unless ( @exts ) {
my $admin = $self->{admin};
@exts = $admin->load_all_extensions;
}
my %seen;
foreach my $obj ( @exts ) {
while (my ($method, $glob) = each %{ref($obj) . '::'}) {
next unless $obj->can($method);
next if $method =~ /^_/;
next if $method eq uc($method);
$seen{$method}++;
}
}
my $who = $self->_caller;
foreach my $name ( sort keys %seen ) {
*{"${who}::$name"} = sub {
${"${who}::AUTOLOAD"} = "${who}::$name";
goto &{"${who}::AUTOLOAD"};
};
}
}
sub new {
my ($class, %args) = @_;
# ignore the prefix on extension modules built from top level.
my $base_path = Cwd::abs_path($FindBin::Bin);
unless ( Cwd::abs_path(Cwd::cwd()) eq $base_path ) {
delete $args{prefix};
}
return $args{_self} if $args{_self};
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= ($^O eq 'VMS' ? '_author' : '.author');
$args{bundle} ||= 'inc/BUNDLES';
$args{base} ||= $base_path;
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
unless ( $args{path} ) {
$args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{base}/$args{prefix}/$args{path}.pm";
bless( \%args, $class );
}
sub call {
my ($self, $method) = @_;
my $obj = $self->load($method) or return;
splice(@_, 0, 2, $obj);
goto &{$obj->can($method)};
}
sub load {
my ($self, $method) = @_;
$self->load_extensions(
"$self->{prefix}/$self->{path}", $self
) unless $self->{extensions};
foreach my $obj (@{$self->{extensions}}) {
return $obj if $obj->can($method);
}
my $admin = $self->{admin} or die <<"END_DIE";
The '$method' method does not exist in the '$self->{prefix}' path!
Please remove the '$self->{prefix}' directory and run $0 again to load it.
END_DIE
my $obj = $admin->load($method, 1);
push @{$self->{extensions}}, $obj;
$obj;
}
sub load_extensions {
my ($self, $path, $top) = @_;
unless ( grep { lc $_ eq lc $self->{prefix} } @INC ) {
unshift @INC, $self->{prefix};
}
foreach my $rv ( $self->find_extensions($path) ) {
my ($file, $pkg) = @{$rv};
next if $self->{pathnames}{$pkg};
local $@;
my $new = eval { require $file; $pkg->can('new') };
unless ( $new ) {
warn $@ if $@;
next;
}
$self->{pathnames}{$pkg} = delete $INC{$file};
push @{$self->{extensions}}, &{$new}($pkg, _top => $top );
}
$self->{extensions} ||= [];
}
sub find_extensions {
my ($self, $path) = @_;
my @found;
File::Find::find( sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
my $subpath = $1;
return if lc($subpath) eq lc($self->{dispatch});
$file = "$self->{path}/$subpath.pm";
my $pkg = "$self->{name}::$subpath";
$pkg =~ s!/!::!g;
# If we have a mixed-case package name, assume case has been preserved
# correctly. Otherwise, root through the file to locate the case-preserved
# version of the package name.
if ( $subpath eq lc($subpath) || $subpath eq uc($subpath) ) {
open PKGFILE, "<$subpath.pm" or die "find_extensions: Can't open $subpath.pm: $!";
my $in_pod = 0;
while ( <PKGFILE> ) {
$in_pod = 1 if /^=\w/;
$in_pod = 0 if /^=cut/;
next if ($in_pod || /^=cut/); # skip pod text
next if /^\s*#/; # and comments
if ( m/^\s*package\s+($pkg)\s*;/i ) {
$pkg = $1;
last;
}
}
close PKGFILE;
}
push @found, [ $file, $pkg ];
},