[Bps-public-commit] UNNAMED PROJECT branch master created. e67de1a7aa2ba2d60ccc79f7d36fecda02e39145
BPS Git Server
git at git.bestpractical.com
Fri Dec 10 20:31:22 UTC 2021
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "UNNAMED PROJECT".
The branch, master has been created
at e67de1a7aa2ba2d60ccc79f7d36fecda02e39145 (commit)
- Log -----------------------------------------------------------------
commit e67de1a7aa2ba2d60ccc79f7d36fecda02e39145
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Tue Jun 22 14:46:18 2004 +0000
Import of AUTRIJUS/MasonX-Profiler-0.06 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.06
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.06.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
index a0bdb86..a6dbbbe 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,13 @@
____________________________________________________________________________
+[ 10936] By: autrijus on 2004/06/22 14:43:01
+ Log: * This be 0.06.
+ * Minor POD typo fixes.
+ * Call Time::HiRes::time() directly instead of importing
+ it.
+ * Correctly detect remote address under CGIHandler
+ and Apache2Handler.
+ ! lib/MasonX/Profiler.pm
+____________________________________________________________________________
[ 10888] By: autrijus on 2004/06/17 00:16:20
Log: * This be 0.05.
* Documentation cleanups; fix copyright years.
diff --git a/META.yml b/META.yml
index 75452ad..063a91f 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
name: MasonX-Profiler
-version: 0.05
+version: 0.06
abstract: Mason per-component profiler
author: Autrijus Tang <autrijus at autrijus.org>
license: perl
diff --git a/SIGNATURE b/SIGNATURE
index fbf5603..de049d8 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.38.
+signed via the Module::Signature module, version 0.39.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,9 +14,9 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 4f6da2631017265a8aac0697af3e94e13c182ade Changes
+SHA1 2d47ca67715e26ce64eaf8d6615e2924f48f9721 Changes
SHA1 54199f510aab07b15dcc6742309d0a8a1d15fea1 MANIFEST
-SHA1 9e5a0f53bc6cf7768711cdc9d86ae76e43c0a234 META.yml
+SHA1 dc1878c934ccbc3a984a12eae0952b0cd058e5b9 META.yml
SHA1 f807185f57fc1f0eef1fb7a780fa8070d357f594 Makefile.PL
SHA1 4a80c641dff1df22959f6e9bd91c1ab5c0f01deb README
SHA1 2b65fc08c268c16ae7097d800bacccc7b8c9c905 inc/Module/Install.pm
@@ -27,13 +27,13 @@ SHA1 aabcd47178e4e7b27e340ff5273269c93697c9c1 inc/Module/Install/Makefile.pm
SHA1 207dfa13341a374fc78325fbeb99bc36659aef2d inc/Module/Install/Metadata.pm
SHA1 aff9341a15c04faec47089851e43d9d4061337e7 inc/Module/Install/Win32.pm
SHA1 8e0d347ca21bc18b380d9d1aa5910b8d078a76b7 inc/Module/Install/WriteAll.pm
-SHA1 c2ed9995a13a35598ad7dbff5a3280ee4532d53b lib/MasonX/Profiler.pm
+SHA1 94526ff2fd197d6cf367aca449c68b17affe2845 lib/MasonX/Profiler.pm
SHA1 033300efbe0805de6e633458f9940601c5970564 t/0-signature.t
SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
-iD8DBQFA0OMGtLPdNzw1AaARAlMCAKCW8PuQQy6T02UljgGqnisQlW9XggCcDytC
-eAL1HN75q4nmwcpIweZsuxo=
-=b78y
+iD8DBQFA2EXJtLPdNzw1AaARAgVgAJ9VFXE+iweg4lu5/EcJ1Lq7S4gczACeIKXL
+UrBkkk/Ei6+DWxH6ff2H9WE=
+=CcjM
-----END PGP SIGNATURE-----
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
index 97fef27..c680573 100644
--- a/lib/MasonX/Profiler.pm
+++ b/lib/MasonX/Profiler.pm
@@ -1,11 +1,11 @@
# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
-# $Revision: #8 $ $Change: 10888 $ $DateTime: 2004/06/17 00:16:20 $
+# $Revision: #9 $ $Change: 10936 $ $DateTime: 2004/06/22 14:43:01 $
package MasonX::Profiler;
-$MasonX::Profiler::VERSION = '0.05';
+$MasonX::Profiler::VERSION = '0.06';
use strict;
-use Time::HiRes qw( time );
+use Time::HiRes ();
=head1 NAME
@@ -13,8 +13,8 @@ MasonX::Profiler - Mason per-component profiler
=head1 VERSION
-This document describes version 0.05 of MasonX::Profiler, released
-June 17, 2004.
+This document describes version 0.06 of MasonX::Profiler, released
+June 22, 2004.
=head1 SYNOPSIS
@@ -26,13 +26,15 @@ In the Mason handler:
# ...
);
-Alternatively, in F<httpd.conf> with L<HTML::Mason::ApacheHandler>:
+Note that B<CGIHandler> and B<Apache2Handler> works, too.
+
+Alternatively, in F<httpd.conf>, before loading your C<PerlHandler>:
PerlModule MasonX::Profiler
PerlSetVar MasonPreamble "my $p = MasonX::Profiler->new($m, $r);"
Note that if you are using virtual hosts, the two lines above must be
-inside the C<E<gt>VirtualHostE<lt>> block, not outside it.
+inside the C<E<lt>VirtualHostE<gt>> block, not outside it.
=head1 DESCRIPTION
@@ -47,8 +49,8 @@ This module prints per-component profiling information to C<STDERR>
=Mason= 127.0.0.1 - /NoAuth/webrt.css }}} ENDS
Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
-address, C<->, indented component name, and how name seconds did it take to
-process that component (including all subcomponents it called).
+address, C<->, indented component name, and how many seconds did it take to
+process that component, including all subcomponents called by it.
The beginning and end of the initial request is represented by the special
time fields C<BEGINS> and C<ENDS>.
@@ -66,13 +68,18 @@ sub new {
my ($class, $m, $r) = @_;
my $self = {
- start => time(),
+ start => Time::HiRes::time(),
uri => $r->uri,
tag => $m->current_comp->path,
ip => (
eval { $r->connection->get_remote_host(
Apache::REMOTE_NAME(), $r->per_dir_config,
- ) } || '*'
+ ) } ||
+ eval { $r->get_remote_host } ||
+ eval { CGI->remote_host } ||
+ eval { $ENV{REMOTE_HOST} } ||
+ eval { $ENV{REMOTE_ADDR} } ||
+ '*'
),
};
@@ -93,7 +100,7 @@ sub DESTROY {
my $indent = ' ' x (4 + 4 * --$Depth{$self->{ip}}{$self->{uri}});
printf STDERR "=Mason= $self->{ip} - $indent".
- "$self->{tag} }}} %.4f\n", (time - $self->{start});
+ "$self->{tag} }}} %.4f\n", (Time::HiRes::time() - $self->{start});
return if $Depth{$self->{ip}}{$self->{uri}};
print STDERR "=Mason= $self->{ip} - $self->{uri} }}} ENDS\n";
commit b08d22be74436426ef3f3dbb65fed36a821ab7d4
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Thu Jun 17 00:19:58 2004 +0000
Import of AUTRIJUS/MasonX-Profiler-0.05 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.05
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.05.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
index 4f51eb1..a0bdb86 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,11 @@
____________________________________________________________________________
+[ 10888] By: autrijus on 2004/06/17 00:16:20
+ Log: * This be 0.05.
+ * Documentation cleanups; fix copyright years.
+ * Emcee Lam suggested to mention that the time unit
+ is measured in seconds.
+ ! README lib/MasonX/Profiler.pm
+____________________________________________________________________________
[ 10428] By: autrijus on 2004/03/18 08:17:20
Log: * This be 0.04.
* Use Vim folding markers instead of <<< and >>> to mark
diff --git a/META.yml b/META.yml
index 30f01b4..75452ad 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
name: MasonX-Profiler
-version: 0.04
+version: 0.05
abstract: Mason per-component profiler
author: Autrijus Tang <autrijus at autrijus.org>
license: perl
@@ -10,4 +10,4 @@ requires:
no_index:
directory:
- inc
-generated_by: Module::Install version 0.32
+generated_by: Module::Install version 0.33
diff --git a/README b/README
index e49c08a..81e26f8 100644
--- a/README
+++ b/README
@@ -1,5 +1,5 @@
# $File: //member/autrijus/MasonX-Profiler/README $ $Author: autrijus $
-# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+# $Revision: #2 $ $Change: 10888 $ $DateTime: 2004/06/17 00:16:20 $
This is the README file for MasonX::Profiler, a per-component profiler
extension for HTML::Mason.
@@ -11,7 +11,7 @@ the module usage information.
MasonX::Profiler uses the standard perl module install process:
-cpansign -v # see SIGNATURE for details
+cpansign -v # optional; see SIGNATURE for details
perl Makefile.PL
make # or 'nmake' on Win32
make test
@@ -19,7 +19,7 @@ make install
* Copyright
-Copyright 2003 by Autrijus Tang <autrijus at autrijus.org>.
+Copyright 2002, 2003, 2004 by Autrijus Tang <autrijus at autrijus.org>.
All rights reserved. You can redistribute and/or modify
this bundle under the same terms as Perl itself.
diff --git a/SIGNATURE b/SIGNATURE
index e2f49c0..fbf5603 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -14,26 +14,26 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 607b48c9eedb7188e3b96b12503a5463fdb5b342 Changes
+SHA1 4f6da2631017265a8aac0697af3e94e13c182ade Changes
SHA1 54199f510aab07b15dcc6742309d0a8a1d15fea1 MANIFEST
-SHA1 b3d749212e2be3f40bc17c4de985dcad76564f57 META.yml
+SHA1 9e5a0f53bc6cf7768711cdc9d86ae76e43c0a234 META.yml
SHA1 f807185f57fc1f0eef1fb7a780fa8070d357f594 Makefile.PL
-SHA1 d92d89d20b16e4523fd7f790e58b03d51ac1cd3a README
-SHA1 8ce7e929153133eb824fa71678a28952dc251848 inc/Module/Install.pm
-SHA1 b9972b7e2eb9e0f26e6aa1c450736d04d346cc9b inc/Module/Install/Base.pm
-SHA1 79919a7a54f4548dac20075e8dc8869fc41e0ce1 inc/Module/Install/Can.pm
-SHA1 9dd540f8e37b483f2ff7b59edd77425a83221b1c inc/Module/Install/Fetch.pm
-SHA1 eff0614c9c10b5965b1c8c6f81ba4b222a30bb13 inc/Module/Install/Makefile.pm
-SHA1 96622a9c708604cf36d5f44b6fbff26b050e4c9d inc/Module/Install/Metadata.pm
-SHA1 f08018c1a76a07671910d05f06885aaa807ffce1 inc/Module/Install/Win32.pm
-SHA1 ab45068dc0f749d438705201e38d7901df0c824b inc/Module/Install/WriteAll.pm
-SHA1 94955b28182d549e75c942465053adbe3fa4f782 lib/MasonX/Profiler.pm
+SHA1 4a80c641dff1df22959f6e9bd91c1ab5c0f01deb README
+SHA1 2b65fc08c268c16ae7097d800bacccc7b8c9c905 inc/Module/Install.pm
+SHA1 fd56d5c793014bccac2cd1e61926c4da8538ef99 inc/Module/Install/Base.pm
+SHA1 9ce6768a7b8f7032ec89594b773fafd58c6feb1d inc/Module/Install/Can.pm
+SHA1 b6c8f0f22c4c8ba48a7bac2c5e4bd61803a7b097 inc/Module/Install/Fetch.pm
+SHA1 aabcd47178e4e7b27e340ff5273269c93697c9c1 inc/Module/Install/Makefile.pm
+SHA1 207dfa13341a374fc78325fbeb99bc36659aef2d inc/Module/Install/Metadata.pm
+SHA1 aff9341a15c04faec47089851e43d9d4061337e7 inc/Module/Install/Win32.pm
+SHA1 8e0d347ca21bc18b380d9d1aa5910b8d078a76b7 inc/Module/Install/WriteAll.pm
+SHA1 c2ed9995a13a35598ad7dbff5a3280ee4532d53b lib/MasonX/Profiler.pm
SHA1 033300efbe0805de6e633458f9940601c5970564 t/0-signature.t
SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
-iD8DBQFAWVtOtLPdNzw1AaARAkHBAKCqd83BBWWVOHlaWjRHKNZKL2NJBgCdFGpu
-COaI2u109C4EY0FXEAaE1ic=
-=Riy8
+iD8DBQFA0OMGtLPdNzw1AaARAlMCAKCW8PuQQy6T02UljgGqnisQlW9XggCcDytC
+eAL1HN75q4nmwcpIweZsuxo=
+=b78y
-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 681216b..6594c02 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -1,9 +1,9 @@
-#line 1 "inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install.pm"
+#line 1 "inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
-# $Revision: #66 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
+# $Revision: #67 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
package Module::Install;
-$VERSION = '0.32';
+$VERSION = '0.33';
die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
Please invoke ${\__PACKAGE__} with:
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 4618212..f9edd04 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Base.pm"
+#line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Base.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Base.pm $ $Author: autrijus $
# $Revision: #10 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
index b2a39c3..1d5e52d 100644
--- a/inc/Module/Install/Can.pm
+++ b/inc/Module/Install/Can.pm
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Can.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Can.pm"
+#line 1 "inc/Module/Install/Can.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Can.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: autrijus $
# $Revision: #6 $ $Change: 1840 $ $DateTime: 2003/12/28 19:42:02 $ vim: expandtab shiftwidth=4
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
index a22a8f9..36e4393 100644
--- a/inc/Module/Install/Fetch.pm
+++ b/inc/Module/Install/Fetch.pm
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Fetch.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Fetch.pm"
+#line 1 "inc/Module/Install/Fetch.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Fetch.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Fetch.pm $ $Author: autrijus $
# $Revision: #8 $ $Change: 1374 $ $DateTime: 2003/03/18 11:50:15 $ vim: expandtab shiftwidth=4
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index 6f2d2a7..150c3db 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Makefile.pm"
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Makefile.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
# $Revision: #53 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index fd84915..05e6669 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -1,6 +1,6 @@
-#line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Metadata.pm"
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Metadata.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Metadata.pm $ $Author: autrijus $
-# $Revision: #31 $ $Change: 1817 $ $DateTime: 2003/12/14 20:57:39 $ vim: expandtab shiftwidth=4
+# $Revision: #32 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
package Module::Install::Metadata;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
index 6f6c603..78d069c 100644
--- a/inc/Module/Install/Win32.pm
+++ b/inc/Module/Install/Win32.pm
@@ -1,4 +1,4 @@
-#line 1 "inc/Module/Install/Win32.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Win32.pm"
+#line 1 "inc/Module/Install/Win32.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/Win32.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Win32.pm $ $Author: autrijus $
# $Revision: #9 $ $Change: 1789 $ $DateTime: 2003/11/11 01:22:54 $ vim: expandtab shiftwidth=4
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
index 5769028..b1535b3 100644
--- a/inc/Module/Install/WriteAll.pm
+++ b/inc/Module/Install/WriteAll.pm
@@ -1,6 +1,6 @@
-#line 1 "inc/Module/Install/WriteAll.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/WriteAll.pm"
+#line 1 "inc/Module/Install/WriteAll.pm - /usr/local/lib/perl5/site_perl/5.8.4/Module/Install/WriteAll.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/WriteAll.pm $ $Author: autrijus $
-# $Revision: #2 $ $Change: 1818 $ $DateTime: 2003/12/14 20:58:38 $ vim: expandtab shiftwidth=4
+# $Revision: #3 $ $Change: 1885 $ $DateTime: 2004/03/11 05:55:27 $ vim: expandtab shiftwidth=4
package Module::Install::WriteAll;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
index 0b90c32..97fef27 100644
--- a/lib/MasonX/Profiler.pm
+++ b/lib/MasonX/Profiler.pm
@@ -1,8 +1,8 @@
# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
-# $Revision: #7 $ $Change: 10428 $ $DateTime: 2004/03/18 08:17:20 $
+# $Revision: #8 $ $Change: 10888 $ $DateTime: 2004/06/17 00:16:20 $
package MasonX::Profiler;
-$MasonX::Profiler::VERSION = '0.04';
+$MasonX::Profiler::VERSION = '0.05';
use strict;
use Time::HiRes qw( time );
@@ -13,8 +13,8 @@ MasonX::Profiler - Mason per-component profiler
=head1 VERSION
-This document describes version 0.04 of MasonX::Profiler, released
-March 18, 2003.
+This document describes version 0.05 of MasonX::Profiler, released
+June 17, 2004.
=head1 SYNOPSIS
@@ -32,12 +32,12 @@ Alternatively, in F<httpd.conf> with L<HTML::Mason::ApacheHandler>:
PerlSetVar MasonPreamble "my $p = MasonX::Profiler->new($m, $r);"
Note that if you are using virtual hosts, the two lines above must be
-inside the <VirtualHost> block, not outside it.
+inside the C<E<gt>VirtualHostE<lt>> block, not outside it.
=head1 DESCRIPTION
-This module prints per-component profiling information to STDERR (usually
-directed to the Apache error log). Its output looks like this:
+This module prints per-component profiling information to C<STDERR>
+(usually directed to the Apache error log). Its output looks like this:
=Mason= 127.0.0.1 - /NoAuth/webrt.css BEGINS {{{
=Mason= 127.0.0.1 - /NoAuth/webrt.css {{{
@@ -47,9 +47,11 @@ directed to the Apache error log). Its output looks like this:
=Mason= 127.0.0.1 - /NoAuth/webrt.css }}} ENDS
Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
-address, C<->, indented component name, and the time spent processing that
-component (inclusive). The beginning and end of the initial request is
-represented by the special time fields C<BEGINS> and C<ENDS>.
+address, C<->, indented component name, and how name seconds did it take to
+process that component (including all subcomponents it called).
+
+The beginning and end of the initial request is represented by the special
+time fields C<BEGINS> and C<ENDS>.
=cut
commit d1c069a7a625f7c2796aa8482451b903d4560993
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Thu Mar 18 08:20:09 2004 +0000
Import of AUTRIJUS/MasonX-Profiler-0.04 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.04
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.04.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
index 01a891e..4f51eb1 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,10 @@
____________________________________________________________________________
+[ 10428] By: autrijus on 2004/03/18 08:17:20
+ Log: * This be 0.04.
+ * Use Vim folding markers instead of <<< and >>> to mark
+ entry and leaving of components. Contributed by LCamel.
+ ! MANIFEST lib/MasonX/Profiler.pm
+____________________________________________________________________________
[ 10396] By: autrijus on 2004/03/16 10:55:14
Log: * This be 0.03.
* update to newer M::I and signature dists.
diff --git a/META.yml b/META.yml
index 9352b90..30f01b4 100644
--- a/META.yml
+++ b/META.yml
@@ -1,5 +1,5 @@
name: MasonX-Profiler
-version: 0.03
+version: 0.04
abstract: Mason per-component profiler
author: Autrijus Tang <autrijus at autrijus.org>
license: perl
diff --git a/SIGNATURE b/SIGNATURE
index 4a74c49..e2f49c0 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -14,9 +14,9 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 406480c8038e127cbbd1f9b8952fa81f6264f834 Changes
+SHA1 607b48c9eedb7188e3b96b12503a5463fdb5b342 Changes
SHA1 54199f510aab07b15dcc6742309d0a8a1d15fea1 MANIFEST
-SHA1 a2555f4eaf78d9e2d47d27a55b6cfd6bc9dfaf14 META.yml
+SHA1 b3d749212e2be3f40bc17c4de985dcad76564f57 META.yml
SHA1 f807185f57fc1f0eef1fb7a780fa8070d357f594 Makefile.PL
SHA1 d92d89d20b16e4523fd7f790e58b03d51ac1cd3a README
SHA1 8ce7e929153133eb824fa71678a28952dc251848 inc/Module/Install.pm
@@ -27,13 +27,13 @@ SHA1 eff0614c9c10b5965b1c8c6f81ba4b222a30bb13 inc/Module/Install/Makefile.pm
SHA1 96622a9c708604cf36d5f44b6fbff26b050e4c9d inc/Module/Install/Metadata.pm
SHA1 f08018c1a76a07671910d05f06885aaa807ffce1 inc/Module/Install/Win32.pm
SHA1 ab45068dc0f749d438705201e38d7901df0c824b inc/Module/Install/WriteAll.pm
-SHA1 1e7e02c3e96494ffd8b7762b8edd9819bc800672 lib/MasonX/Profiler.pm
+SHA1 94955b28182d549e75c942465053adbe3fa4f782 lib/MasonX/Profiler.pm
SHA1 033300efbe0805de6e633458f9940601c5970564 t/0-signature.t
SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
-iD8DBQFAVt12tLPdNzw1AaARAurrAKCUYPMes3/YusQOUkyUChjSgFGZpACdHbIi
-ScZ4IFSlLyXXk9lpBHATP3w=
-=hp9W
+iD8DBQFAWVtOtLPdNzw1AaARAkHBAKCqd83BBWWVOHlaWjRHKNZKL2NJBgCdFGpu
+COaI2u109C4EY0FXEAaE1ic=
+=Riy8
-----END PGP SIGNATURE-----
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
index 08d3067..0b90c32 100644
--- a/lib/MasonX/Profiler.pm
+++ b/lib/MasonX/Profiler.pm
@@ -1,8 +1,8 @@
# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
-# $Revision: #6 $ $Change: 10396 $ $DateTime: 2004/03/16 10:55:14 $
+# $Revision: #7 $ $Change: 10428 $ $DateTime: 2004/03/18 08:17:20 $
package MasonX::Profiler;
-$MasonX::Profiler::VERSION = '0.03';
+$MasonX::Profiler::VERSION = '0.04';
use strict;
use Time::HiRes qw( time );
@@ -13,8 +13,8 @@ MasonX::Profiler - Mason per-component profiler
=head1 VERSION
-This document describes version 0.03 of MasonX::Profiler, released
-March 16, 2003.
+This document describes version 0.04 of MasonX::Profiler, released
+March 18, 2003.
=head1 SYNOPSIS
@@ -39,12 +39,12 @@ inside the <VirtualHost> block, not outside it.
This module prints per-component profiling information to STDERR (usually
directed to the Apache error log). Its output looks like this:
- =Mason= 127.0.0.1 - /NoAuth/webrt.css BEGINS
- =Mason= 127.0.0.1 - /NoAuth/webrt.css >>>>
- =Mason= 127.0.0.1 - /Elements/Callback >>>>
- =Mason= 127.0.0.1 - /Elements/Callback <<<< 0.0008
- =Mason= 127.0.0.1 - /NoAuth/webrt.css <<<< 0.0072
- =Mason= 127.0.0.1 - /NoAuth/webrt.css ENDS
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css BEGINS {{{
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css {{{
+ =Mason= 127.0.0.1 - /Elements/Callback {{{
+ =Mason= 127.0.0.1 - /Elements/Callback }}} 0.0008
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css }}} 0.0072
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css }}} ENDS
Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
address, C<->, indented component name, and the time spent processing that
@@ -76,12 +76,12 @@ sub new {
return if $self->{tag} eq '/l';
- print STDERR "=Mason= $self->{ip} - $self->{uri} BEGINS\n"
+ print STDERR "=Mason= $self->{ip} - $self->{uri} BEGINS {{{\n"
unless $Depth{$self->{ip}}{$self->{uri}}++;
my $indent = ' ' x (4 * $Depth{$self->{ip}}{$self->{uri}});
printf STDERR "=Mason= $self->{ip} - $indent".
- "$self->{tag} >>>>\n";
+ "$self->{tag} {{{\n";
bless($self, $class);
}
@@ -91,10 +91,10 @@ sub DESTROY {
my $indent = ' ' x (4 + 4 * --$Depth{$self->{ip}}{$self->{uri}});
printf STDERR "=Mason= $self->{ip} - $indent".
- "$self->{tag} <<<< %.4f\n", (time - $self->{start});
+ "$self->{tag} }}} %.4f\n", (time - $self->{start});
return if $Depth{$self->{ip}}{$self->{uri}};
- print STDERR "=Mason= $self->{ip} - $self->{uri} ENDS\n";
+ print STDERR "=Mason= $self->{ip} - $self->{uri} }}} ENDS\n";
}
1;
commit 1ce8a3a486a901f5ad29fa09e690ee02ed0df862
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Tue Mar 16 13:18:33 2004 +0000
Import of AUTRIJUS/MasonX-Profiler-0.03 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.03
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.03.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
index ab85f0a..01a891e 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,12 @@
____________________________________________________________________________
+[ 10396] By: autrijus on 2004/03/16 10:55:14
+ Log: * This be 0.03.
+ * update to newer M::I and signature dists.
+ * now implements ">>>>"-marked entrance logs, implemented
+ by jihuang and lcamel.
+ ! Makefile.PL lib/MasonX/Profiler.pm
+ ! t/0-signature.t
+____________________________________________________________________________
[ 8452] By: autrijus on 2003/10/17 10:52:28
Log: * This be 0.02.
* fix a trivial typo.
diff --git a/MANIFEST b/MANIFEST
index 2750f5b..2982ce0 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -1,14 +1,17 @@
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/MakeMaker.pm
inc/Module/Install/Metadata.pm
+inc/Module/Install/Win32.pm
+inc/Module/Install/WriteAll.pm
lib/MasonX/Profiler.pm
Makefile.PL
MANIFEST This list of files
META.yml
README
-SIGNATURE Public-key signature (added by MakeMaker)
+SIGNATURE
t/0-signature.t
t/1-basic.t
diff --git a/META.yml b/META.yml
index 1b55996..9352b90 100644
--- a/META.yml
+++ b/META.yml
@@ -1,13 +1,13 @@
name: MasonX-Profiler
-module_name: MasonX::Profiler
-version: 0.02
+version: 0.03
abstract: Mason per-component profiler
-author: Autrijus Tang (autrijus at autrijus.org)
+author: Autrijus Tang <autrijus at autrijus.org>
+license: perl
distribution_type: module
requires:
HTML::Mason: 0
Time::HiRes: 0
-private:
+no_index:
directory:
- inc
-generated_by: Module::Install version 0.24
+generated_by: Module::Install version 0.32
diff --git a/Makefile.PL b/Makefile.PL
index 3edb9a5..369ebc6 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -1,17 +1,15 @@
#!/usr/bin/env perl
# $File: //member/autrijus/MasonX-Profiler/Makefile.PL $ $Author: autrijus $
-# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+# $Revision: #2 $ $Change: 10396 $ $DateTime: 2004/03/16 10:55:14 $
use inc::Module::Install;
-requires ('HTML::Mason', 0);
-requires ('Time::HiRes', 0);
-
-WriteMakefile (
- AUTHOR => 'Autrijus Tang (autrijus at autrijus.org)',
- NAME => 'MasonX::Profiler',
- ABSTRACT => 'Mason per-component profiler',
- VERSION_FROM => 'lib/MasonX/Profiler.pm',
- SIGN => 1,
-);
+name ('MasonX-Profiler');
+author ('Autrijus Tang <autrijus at autrijus.org>');
+abstract_from ('lib/MasonX/Profiler.pm');
+version_from ('lib/MasonX/Profiler.pm');
+requires ('HTML::Mason', 0);
+requires ('Time::HiRes', 0);
+license ('perl');
+WriteAll( sign => 1 );
diff --git a/SIGNATURE b/SIGNATURE
index f4911f9..4a74c49 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -1,5 +1,5 @@
This file contains message digests of all files listed in MANIFEST,
-signed via the Module::Signature module, version 0.35.
+signed via the Module::Signature module, version 0.38.
To verify the content in this distribution, first make sure you have
Module::Signature installed, then type:
@@ -14,23 +14,26 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 75fd5d41d3957cb415cf6af02e8096be31e7c0f8 Changes
-SHA1 2e0e9e37965dd7d082856aba4946a08253bf69ba MANIFEST
-SHA1 02cde43980d10fa58ec3fbca90ffe0797eeefedf META.yml
-SHA1 d0a05aa53bd44bf6a8e60ff8fc7a9e0103fa5a6f Makefile.PL
+SHA1 406480c8038e127cbbd1f9b8952fa81f6264f834 Changes
+SHA1 54199f510aab07b15dcc6742309d0a8a1d15fea1 MANIFEST
+SHA1 a2555f4eaf78d9e2d47d27a55b6cfd6bc9dfaf14 META.yml
+SHA1 f807185f57fc1f0eef1fb7a780fa8070d357f594 Makefile.PL
SHA1 d92d89d20b16e4523fd7f790e58b03d51ac1cd3a README
-SHA1 20260be7cfe0fbb394c4f8ff3a80cacfcb82dd73 inc/Module/Install.pm
-SHA1 019bccc5b2e364447c6e6e150d049ca2a216598e inc/Module/Install/Base.pm
-SHA1 e2547371d0317abbfa3d56b0d20bba909885d7db inc/Module/Install/MakeMaker.pm
-SHA1 8f9804460ecdeaeaa79d3ff18f27551cab7371ea inc/Module/Install/Makefile.pm
-SHA1 1afe7210c78328ecc24ee57c6f6aeb2a7b981c0e inc/Module/Install/Metadata.pm
-SHA1 1674ef5b7dd5256d7a501dea64453bce80a5dd99 lib/MasonX/Profiler.pm
-SHA1 390da9ea2894cd70f0f7cb5489075566118cf36d t/0-signature.t
+SHA1 8ce7e929153133eb824fa71678a28952dc251848 inc/Module/Install.pm
+SHA1 b9972b7e2eb9e0f26e6aa1c450736d04d346cc9b inc/Module/Install/Base.pm
+SHA1 79919a7a54f4548dac20075e8dc8869fc41e0ce1 inc/Module/Install/Can.pm
+SHA1 9dd540f8e37b483f2ff7b59edd77425a83221b1c inc/Module/Install/Fetch.pm
+SHA1 eff0614c9c10b5965b1c8c6f81ba4b222a30bb13 inc/Module/Install/Makefile.pm
+SHA1 96622a9c708604cf36d5f44b6fbff26b050e4c9d inc/Module/Install/Metadata.pm
+SHA1 f08018c1a76a07671910d05f06885aaa807ffce1 inc/Module/Install/Win32.pm
+SHA1 ab45068dc0f749d438705201e38d7901df0c824b inc/Module/Install/WriteAll.pm
+SHA1 1e7e02c3e96494ffd8b7762b8edd9819bc800672 lib/MasonX/Profiler.pm
+SHA1 033300efbe0805de6e633458f9940601c5970564 t/0-signature.t
SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
-iD8DBQE/j8r6tLPdNzw1AaARAgK7AJ0XjRw6kKqWPZYjXwmVJhF7/zRKvACffdr1
-tOsGX7b9Uy45GwmEhVxosfA=
-=prM9
+iD8DBQFAVt12tLPdNzw1AaARAurrAKCUYPMes3/YusQOUkyUChjSgFGZpACdHbIi
+ScZ4IFSlLyXXk9lpBHATP3w=
+=hp9W
-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
index 4a8137f..681216b 100644
--- a/inc/Module/Install.pm
+++ b/inc/Module/Install.pm
@@ -1,36 +1,37 @@
-#line 1 "inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install.pm"
+#line 1 "inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
-# $Revision: #58 $ $Change: 1709 $ $DateTime: 2003/09/01 03:13:10 $ vim: expandtab shiftwidth=4
+# $Revision: #66 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
package Module::Install;
-$VERSION = '0.24';
+$VERSION = '0.32';
-die <<END unless defined $INC{'inc/Module/Install.pm'};
-Please invoke Module::Install with:
+die << "." unless $INC{join('/', inc => split(/::/, __PACKAGE__)).'.pm'};
+Please invoke ${\__PACKAGE__} with:
- use inc::Module::Install;
+ use inc::${\__PACKAGE__};
not:
- use Module::Install;
+ use ${\__PACKAGE__};
-END
+.
use strict 'vars';
-use File::Find;
-use File::Path;
+use Cwd ();
+use File::Find ();
+use File::Path ();
@inc::Module::Install::ISA = 'Module::Install';
-#line 127
+#line 129
sub import {
- my $class = $_[0];
- my $self = $class->new(@_[1..$#_]);
+ my $class = shift;
+ my $self = $class->new(@_);
if (not -f $self->{file}) {
require "$self->{path}/$self->{dispatch}.pm";
- mkpath "$self->{prefix}/$self->{author}";
+ File::Path::mkpath("$self->{prefix}/$self->{author}");
$self->{admin} =
"$self->{name}::$self->{dispatch}"->new(_top => $self);
$self->{admin}->init;
@@ -39,21 +40,33 @@ sub import {
}
*{caller(0) . "::AUTOLOAD"} = $self->autoload;
+
+ # Unregister loader and worker packages so subdirs can use them again
+ delete $INC{"$self->{file}"};
+ delete $INC{"$self->{path}.pm"};
}
-#line 150
+#line 156
sub autoload {
my $self = shift;
my $caller = caller;
- sub {
- ${"$caller\::AUTOLOAD"} =~ /([^:]+)$/ or die "Cannot autoload $caller";
+
+ my $cwd = Cwd::cwd();
+ my $sym = "$caller\::AUTOLOAD";
+
+ $sym->{$cwd} = sub {
+ my $pwd = Cwd::cwd();
+ if (my $code = $sym->{$pwd}) {
+ goto &$code unless $cwd eq $pwd; # delegate back to parent dirs
+ }
+ $$sym =~ /([^:]+)$/ or die "Cannot autoload $caller";
unshift @_, ($self, $1);
goto &{$self->can('call')} unless uc($1) eq $1;
};
}
-#line 167
+#line 181
sub new {
my ($class, %args) = @_;
@@ -63,13 +76,14 @@ sub new {
$args{dispatch} ||= 'Admin';
$args{prefix} ||= 'inc';
$args{author} ||= '.author';
- $args{bundle} ||= '_bundle';
+ $args{bundle} ||= 'inc/BUNDLES';
$class =~ s/^\Q$args{prefix}\E:://;
$args{name} ||= $class;
$args{version} ||= $class->VERSION;
+
unless ($args{path}) {
- $args{path} = $args{name};
+ $args{path} = $args{name};
$args{path} =~ s!::!/!g;
}
$args{file} ||= "$args{prefix}/$args{path}.pm";
@@ -77,7 +91,7 @@ sub new {
bless(\%args, $class);
}
-#line 195
+#line 210
sub call {
my $self = shift;
@@ -88,7 +102,7 @@ sub call {
goto &{$obj->can($method)};
}
-#line 210
+#line 225
sub load {
my ($self, $method) = @_;
@@ -112,7 +126,7 @@ END
$obj;
}
-#line 240
+#line 255
sub load_extensions {
my ($self, $path, $top_obj) = @_;
@@ -126,18 +140,18 @@ sub load_extensions {
next if $self->{pathnames}{$pkg};
eval { require $file; 1 } or (warn($@), next);
- $self->{pathnames}{$pkg} = $INC{$file};
+ $self->{pathnames}{$pkg} = delete $INC{$file};
push @{$self->{extensions}}, $pkg->new( _top => $top_obj );
}
}
-#line 264
+#line 279
sub find_extensions {
my ($self, $path) = @_;
my @found;
- find(sub {
+ File::Find::find(sub {
my $file = $File::Find::name;
return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
return if $1 eq $self->{dispatch};
@@ -154,4 +168,4 @@ sub find_extensions {
__END__
-#line 556
+#line 614
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
index 443fcb7..4618212 100644
--- a/inc/Module/Install/Base.pm
+++ b/inc/Module/Install/Base.pm
@@ -1,6 +1,6 @@
-#line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Base.pm"
+#line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Base.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Base.pm $ $Author: autrijus $
-# $Revision: #9 $ $Change: 1665 $ $DateTime: 2003/08/18 07:52:47 $ vim: expandtab shiftwidth=4
+# $Revision: #10 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
package Module::Install::Base;
diff --git a/inc/Module/Install/Can.pm b/inc/Module/Install/Can.pm
new file mode 100644
index 0000000..b2a39c3
--- /dev/null
+++ b/inc/Module/Install/Can.pm
@@ -0,0 +1,41 @@
+#line 1 "inc/Module/Install/Can.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Can.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Can.pm $ $Author: autrijus $
+# $Revision: #6 $ $Change: 1840 $ $DateTime: 2003/12/28 19:42:02 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Can;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+$VERSION = '0.01';
+
+use strict;
+use Config ();
+use File::Spec ();
+use ExtUtils::MakeMaker ();
+
+# check if we can run some command
+sub can_run {
+ my ($self, $cmd) = @_;
+
+ my $_cmd = $cmd;
+ return $_cmd if (-x $_cmd or $_cmd = MM->maybe_command($_cmd));
+
+ for my $dir ((split /$Config::Config{path_sep}/, $ENV{PATH}), '.') {
+ my $abs = File::Spec->catfile($dir, $_[1]);
+ return $abs if (-x $abs or $abs = MM->maybe_command($abs));
+ }
+
+ return;
+}
+
+sub can_cc {
+ my $self = shift;
+ my @chunks = split(/ /, $Config::Config{cc}) or return;
+
+ # $Config{cc} may contain args; try to find out the program part
+ while (@chunks) {
+ return $self->can_run("@chunks") || (pop(@chunks), next);
+ }
+
+ return;
+}
+
+1;
diff --git a/inc/Module/Install/Fetch.pm b/inc/Module/Install/Fetch.pm
new file mode 100644
index 0000000..a22a8f9
--- /dev/null
+++ b/inc/Module/Install/Fetch.pm
@@ -0,0 +1,89 @@
+#line 1 "inc/Module/Install/Fetch.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Fetch.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Fetch.pm $ $Author: autrijus $
+# $Revision: #8 $ $Change: 1374 $ $DateTime: 2003/03/18 11:50:15 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Fetch;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+sub get_file {
+ my ($self, %args) = @_;
+ 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) =
+ $args{url} =~ m|^(\w+)://([^/]+)(.+)/(.+)| or return;
+ }
+
+ $|++;
+ print "Fetching '$file' from $host... ";
+
+ unless (eval { require Socket; Socket::inet_aton($host) }) {
+ warn "'$host' resolve failed!\n";
+ return;
+ }
+
+ return unless $scheme eq 'ftp' or $scheme eq 'http';
+
+ require Cwd;
+ my $dir = Cwd::getcwd();
+ chdir $args{local_dir} or return if exists $args{local_dir};
+
+ if (eval { require LWP::Simple; 1 }) {
+ LWP::Simple::mirror($args{url}, $file);
+ }
+ elsif (eval { require Net::FTP; 1 }) { eval {
+ # use Net::FTP to get past firewall
+ my $ftp = Net::FTP->new($host, Passive => 1, Timeout => 600);
+ $ftp->login("anonymous", 'anonymous at example.com');
+ $ftp->cwd($path);
+ $ftp->binary;
+ $ftp->get($file) or (warn("$!\n"), return);
+ $ftp->quit;
+ } }
+ elsif (my $ftp = $self->can_run('ftp')) { eval {
+ # no Net::FTP, fallback to ftp.exe
+ require FileHandle;
+ my $fh = FileHandle->new;
+
+ local $SIG{CHLD} = 'IGNORE';
+ unless ($fh->open("|$ftp -n")) {
+ warn "Couldn't open ftp: $!\n";
+ chdir $dir; return;
+ }
+
+ my @dialog = split(/\n/, << ".");
+open $host
+user anonymous anonymous\@example.com
+cd $path
+binary
+get $file $file
+quit
+.
+ foreach (@dialog) { $fh->print("$_\n") }
+ $fh->close;
+ } }
+ else {
+ warn "No working 'ftp' program available!\n";
+ chdir $dir; return;
+ }
+
+ unless (-f $file) {
+ warn "Fetching failed: $@\n";
+ chdir $dir; return;
+ }
+
+ return if exists $args{size} and -s $file != $args{size};
+ system($args{run}) if exists $args{run};
+ unlink($file) if $args{remove};
+
+ print(((!exists $args{check_for} or -e $args{check_for})
+ ? "done!" : "failed! ($!)"), "\n");
+ chdir $dir; return !$?;
+}
+
+1;
diff --git a/inc/Module/Install/MakeMaker.pm b/inc/Module/Install/MakeMaker.pm
deleted file mode 100644
index af1a2d5..0000000
--- a/inc/Module/Install/MakeMaker.pm
+++ /dev/null
@@ -1,44 +0,0 @@
-#line 1 "inc/Module/Install/MakeMaker.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/MakeMaker.pm"
-# $File: //depot/cpan/Module-Install/lib/Module/Install/MakeMaker.pm $ $Author: autrijus $
-# $Revision: #10 $ $Change: 1645 $ $DateTime: 2003/07/16 01:05:06 $ vim: expandtab shiftwidth=4
-
-package Module::Install::MakeMaker;
-use Module::Install::Base; @ISA = qw(Module::Install::Base);
-
-$VERSION = '0.01';
-
-use ExtUtils::MakeMaker ();
-
-my $makefile;
-sub WriteMakefile {
- my ($self, %args) = @_;
- $makefile = $self->load('Makefile');
-
- # mapping between MakeMaker and META.yml keys
- $args{MODULE_NAME} = $args{NAME};
- unless ($args{NAME} = $args{DISTNAME} or !$args{MODULE_NAME}) {
- $args{NAME} = $args{MODULE_NAME};
- $args{NAME} =~ s/::/-/g;
- }
-
- foreach my $key (qw(name module_name version version_from abstract author)) {
- my $value = delete($args{uc($key)}) or next;
- $self->$key($value);
- }
-
- if (my $prereq = delete($args{PREREQ_PM})) {
- $self->requires($_ => $prereq->{$_}) for keys %$prereq;
- }
-
- # put the remaining args to makemaker_args
- $self->makemaker_args(%args);
-}
-
-END {
- if ($makefile) {
- $makefile->write;
- $makefile->Meta->write;
- }
-}
-
-1;
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
index a3c22a5..6f2d2a7 100644
--- a/inc/Module/Install/Makefile.pm
+++ b/inc/Module/Install/Makefile.pm
@@ -1,6 +1,6 @@
-#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Makefile.pm"
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Makefile.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
-# $Revision: #45 $ $Change: 1645 $ $DateTime: 2003/07/16 01:05:06 $ vim: expandtab shiftwidth=4
+# $Revision: #53 $ $Change: 1847 $ $DateTime: 2003/12/31 23:14:54 $ vim: expandtab shiftwidth=4
package Module::Install::Makefile;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
@@ -28,7 +28,22 @@ sub makemaker_args {
sub clean_files {
my $self = shift;
- $self->makemaker_args( clean => { FILES => "@_ " } );
+ my $clean = $self->makemaker_args->{clean} ||= {};
+ %$clean = (
+ %$clean,
+ FILES => join(" ", grep length, $clean->{FILES}, @_),
+ );
+}
+
+sub libs {
+ my $self = shift;
+ my $libs = ref $_[0] ? shift : [shift];
+ $self->makemaker_args( LIBS => $libs );
+}
+
+sub inc {
+ my $self = shift;
+ $self->makemaker_args( INC => shift );
}
sub write {
@@ -46,10 +61,13 @@ sub write {
$args->{ABSTRACT} = $self->abstract;
$args->{AUTHOR} = $self->author;
}
- if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 )
- {
+ if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 ) {
$args->{NO_META} = 1;
}
+ if ( eval($ExtUtils::MakeMaker::VERSION) > 6.17 ) {
+ $args->{SIGN} = 1 if $self->sign;
+ }
+ delete $args->{SIGN} unless $self->is_admin;
# merge both kinds of requires into prereq_pm
my $prereq = ($args->{PREREQ_PM} ||= {});
@@ -58,8 +76,16 @@ sub write {
# merge both kinds of requires into prereq_pm
my $dir = ($args->{DIR} ||= []);
- push @$dir, map "$self->{prefix}/$self->{bundle}/$_->[1]", @{$self->bundles}
- if $self->bundles;
+ if ($self->bundles) {
+ push @$dir, map "$_->[1]", @{$self->bundles};
+ delete $prereq->{$_->[0]} for @{$self->bundles};
+ }
+
+ if (my $perl_version = $self->perl_version) {
+ eval "use $perl_version; 1"
+ or die "ERROR: perl: Version $] is installed, ".
+ "but we need version >= $perl_version";
+ }
my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
@@ -87,6 +113,13 @@ sub fix_up_makefile {
my $makefile = do { local $/; <MAKEFILE> };
close MAKEFILE;
+ $makefile =~ s/\b(test_harness\(\$\(TEST_VERBOSE\), )/$1'inc', /;
+ $makefile =~ s/( -I\$\(INST_ARCHLIB\))/ -Iinc$1/g;
+ $makefile =~ s/( "-I\$\(INST_LIB\)")/ "-Iinc"$1/g;
+
+ $makefile =~ s/^(FULLPERL = .*)/$1 -Iinc/m;
+ $makefile =~ s/^(PERL = .*)/$1 -Iinc/m;
+
open MAKEFILE, '> Makefile' or die $!;
print MAKEFILE "$preamble$makefile$postamble";
close MAKEFILE;
@@ -110,4 +143,4 @@ sub postamble {
__END__
-#line 242
+#line 276
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
index a0b5b27..fd84915 100644
--- a/inc/Module/Install/Metadata.pm
+++ b/inc/Module/Install/Metadata.pm
@@ -1,25 +1,28 @@
-#line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Metadata.pm"
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Metadata.pm"
# $File: //depot/cpan/Module-Install/lib/Module/Install/Metadata.pm $ $Author: autrijus $
-# $Revision: #25 $ $Change: 1665 $ $DateTime: 2003/08/18 07:52:47 $ vim: expandtab shiftwidth=4
+# $Revision: #31 $ $Change: 1817 $ $DateTime: 2003/12/14 20:57:39 $ vim: expandtab shiftwidth=4
package Module::Install::Metadata;
use Module::Install::Base; @ISA = qw(Module::Install::Base);
-$VERSION = '0.01';
+$VERSION = '0.04';
use strict 'vars';
use vars qw($VERSION);
sub Meta { shift }
-my @scalar_keys = qw(name module_name version abstract author license distribution_type);
+my @scalar_keys = qw(
+ name module_name version abstract author license
+ distribution_type sign perl_version
+);
my @tuple_keys = qw(build_requires requires recommends bundles);
foreach my $key (@scalar_keys) {
*$key = sub {
my $self = shift;
- return $self->{values}{$key} unless @_;
- $self->{values}{$key} = shift;
+ return $self->{'values'}{$key} unless @_;
+ $self->{'values'}{$key} = shift;
return $self;
};
}
@@ -27,13 +30,19 @@ foreach my $key (@scalar_keys) {
foreach my $key (@tuple_keys) {
*$key = sub {
my $self = shift;
- return $self->{values}{$key} unless @_;
+ return $self->{'values'}{$key} unless @_;
my @rv;
while (@_) {
my $module = shift or last;
my $version = shift || 0;
+ if ($module eq 'perl') {
+ $version =~ s{^(\d+)\.(\d+)\.(\d+)}
+ {$1 + $2/1_000 + $3/1_000_000}e;
+ $self->perl_version($version);
+ next;
+ }
my $rv = [$module, $version];
- push @{$self->{values}{$key}}, $rv;
+ push @{$self->{'values'}{$key}}, $rv;
push @rv, $rv;
}
return @rv;
@@ -44,18 +53,41 @@ sub features {
my $self = shift;
while (my ($name, $mods) = splice(@_, 0, 2)) {
my $count = 0;
- push @{$self->{values}{features}}, ($name => [
+ push @{$self->{'values'}{'features'}}, ($name => [
map { (++$count % 2 and ref($_) and ($count += $#$_)) ? @$_ : $_ } @$mods
] );
}
- return @{$self->{values}{features}};
+ return @{$self->{'values'}{'features'}};
+}
+
+sub no_index {
+ my $self = shift;
+ my $type = shift;
+ push @{$self->{'values'}{'no_index'}{$type}}, @_ if $type;
+ return $self->{'values'}{'no_index'};
}
sub _dump {
my $self = shift;
my $package = ref($self->_top);
my $version = $self->_top->VERSION;
- my %values = %{$self->{values}};
+ my %values = %{$self->{'values'}};
+
+ delete $values{sign};
+ if (my $perl_version = delete $values{perl_version}) {
+ # Always canonical to three-dot version
+ $perl_version =~ s{^(\d+)\.(\d\d\d)(\d*)}{join('.', $1, int($2), int($3))}e
+ if $perl_version >= 5.006;
+ $values{requires} = [
+ [perl => $perl_version],
+ @{$values{requires}||[]},
+ ];
+ }
+
+ warn "No license specified, setting license = 'unknown'\n"
+ unless $values{license};
+
+ $values{license} ||= 'unknown';
$values{distribution_type} ||= 'module';
$values{name} ||= do {
my $name = $values{module_name};
@@ -63,6 +95,12 @@ sub _dump {
$name;
} if $values{module_name};
+ if ($values{name} =~ /::/) {
+ my $name = $values{name};
+ $name =~ s/::/-/g;
+ die "Error in name(): '$values{name}' should be '$name'!\n";
+ }
+
my $dump = '';
foreach my $key (@scalar_keys) {
$dump .= "$key: $values{$key}\n" if exists $values{$key};
@@ -70,10 +108,27 @@ sub _dump {
foreach my $key (@tuple_keys) {
next unless exists $values{$key};
$dump .= "$key:\n";
- $dump .= " $_->[0]: $_->[1]\n" for @{$values{$key}};
+ foreach (@{$values{$key}}) {
+ $dump .= " $_->[0]: $_->[1]\n";
+ }
}
- return($dump . "private:\n directory:\n - inc\ngenerated_by: $package version $version\n");
+ if (my $no_index = $values{no_index}) {
+ push @{$no_index->{'directory'}}, 'inc';
+ require YAML;
+ local $YAML::UseHeader = 0;
+ $dump .= YAML::Dump({ no_index => $no_index});
+ }
+ else {
+ $dump .= << "META";
+no_index:
+ directory:
+ - inc
+META
+ }
+
+ $dump .= "generated_by: $package version $version\n";
+ return $dump;
}
sub read {
@@ -106,7 +161,7 @@ sub write {
while (<FH>) {
last META_NOT_OURS if /^generated_by: Module::Install\b/;
}
- return $self;
+ return $self if -s FH;
}
}
@@ -126,7 +181,10 @@ sub version_from {
sub abstract_from {
my ($self, $abstract_from) = @_;
require ExtUtils::MM_Unix;
- $self->abstract(ExtUtils::MM_Unix->parse_abstract($abstract_from));
+ $self->abstract(
+ bless( { DISTNAME => $self->name }, 'ExtUtils::MM_Unix')
+ ->parse_abstract($abstract_from)
+ );
}
1;
diff --git a/inc/Module/Install/Win32.pm b/inc/Module/Install/Win32.pm
new file mode 100644
index 0000000..6f6c603
--- /dev/null
+++ b/inc/Module/Install/Win32.pm
@@ -0,0 +1,66 @@
+#line 1 "inc/Module/Install/Win32.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/Win32.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Win32.pm $ $Author: autrijus $
+# $Revision: #9 $ $Change: 1789 $ $DateTime: 2003/11/11 01:22:54 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Win32;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.02';
+
+use strict;
+
+# determine if the user needs nmake, and download it if needed
+sub check_nmake {
+ my $self = shift;
+ $self->load('can_run');
+ $self->load('get_file');
+
+ require Config;
+ return unless (
+ $Config::Config{make} and
+ $Config::Config{make} =~ /^nmake\b/i and
+ $^O eq 'MSWin32' and
+ !$self->can_run('nmake')
+ );
+
+ print "The required 'nmake' executable not found, fetching it...\n";
+
+ require File::Basename;
+ my $rv = $self->get_file(
+ url => 'http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe',
+ ftp_url => 'ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe',
+ local_dir => File::Basename::dirname($^X),
+ size => 51928,
+ run => 'Nmake15.exe /o > nul',
+ check_for => 'Nmake.exe',
+ remove => 1,
+ );
+
+ if (!$rv) {
+ die << '.';
+
+-------------------------------------------------------------------------------
+
+Since you are using Microsoft Windows, you will need the 'nmake' utility
+before installation. It's available at:
+
+ http://download.microsoft.com/download/vc15/Patch/1.52/W95/EN-US/Nmake15.exe
+ or
+ ftp://ftp.microsoft.com/Softlib/MSLFILES/Nmake15.exe
+
+Please download the file manually, save it to a directory in %PATH% (e.g.
+C:\WINDOWS\COMMAND\), then launch the MS-DOS command line shell, "cd" to
+that directory, and run "Nmake15.exe" from there; that will create the
+'nmake.exe' file needed by this module.
+
+You may then resume the installation process described in README.
+
+-------------------------------------------------------------------------------
+.
+ }
+}
+
+1;
+
+__END__
+
diff --git a/inc/Module/Install/WriteAll.pm b/inc/Module/Install/WriteAll.pm
new file mode 100644
index 0000000..5769028
--- /dev/null
+++ b/inc/Module/Install/WriteAll.pm
@@ -0,0 +1,39 @@
+#line 1 "inc/Module/Install/WriteAll.pm - /usr/local/lib/perl5/site_perl/5.8.3/Module/Install/WriteAll.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/WriteAll.pm $ $Author: autrijus $
+# $Revision: #2 $ $Change: 1818 $ $DateTime: 2003/12/14 20:58:38 $ vim: expandtab shiftwidth=4
+
+package Module::Install::WriteAll;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+sub WriteAll {
+ my $self = shift;
+ my %args = (
+ meta => 1,
+ sign => 0,
+ inline => 0,
+ check_nmake => 1,
+ @_
+ );
+
+ $self->sign(1) if $args{sign};
+ $self->Meta->write if $args{meta};
+ $self->admin->WriteAll(%args) if $self->is_admin;
+
+ if ($0 =~ /Build.PL$/i) {
+ $self->Build->write;
+ }
+ else {
+ $self->check_nmake if $args{check_nmake};
+ $self->makemaker_args( PL_FILES => {} )
+ unless $self->makemaker_args->{'PL_FILES'};
+
+ if ($args{inline}) {
+ $self->Inline->write;
+ }
+ else {
+ $self->Makefile->write;
+ }
+ }
+}
+
+1;
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
index 55ec74a..08d3067 100644
--- a/lib/MasonX/Profiler.pm
+++ b/lib/MasonX/Profiler.pm
@@ -1,8 +1,8 @@
# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
-# $Revision: #5 $ $Change: 8452 $ $DateTime: 2003/10/17 10:52:28 $
+# $Revision: #6 $ $Change: 10396 $ $DateTime: 2004/03/16 10:55:14 $
package MasonX::Profiler;
-$MasonX::Profiler::VERSION = '0.02';
+$MasonX::Profiler::VERSION = '0.03';
use strict;
use Time::HiRes qw( time );
@@ -13,8 +13,8 @@ MasonX::Profiler - Mason per-component profiler
=head1 VERSION
-This document describes version 0.02 of MasonX::Profiler, released
-October 17, 2003.
+This document describes version 0.03 of MasonX::Profiler, released
+March 16, 2003.
=head1 SYNOPSIS
@@ -31,24 +31,20 @@ Alternatively, in F<httpd.conf> with L<HTML::Mason::ApacheHandler>:
PerlModule MasonX::Profiler
PerlSetVar MasonPreamble "my $p = MasonX::Profiler->new($m, $r);"
+Note that if you are using virtual hosts, the two lines above must be
+inside the <VirtualHost> block, not outside it.
+
=head1 DESCRIPTION
This module prints per-component profiling information to STDERR (usually
directed to the Apache error log). Its output looks like this:
- =Mason= 210.85.16.204 - /Foundry/Home/MyRequests.html BEGINS
- =Mason= 210.85.16.204 - /Elements/SetupSessionCookie 0.0610
- =Mason= 210.85.16.204 - /Callbacks/Foundry/autohandler/Auth 0.0003
- =Mason= 210.85.16.204 - /Elements/Callback 0.0242
- =Mason= 210.85.16.204 - /Elements/Callback 0.0016
- =Mason= 210.85.16.204 - /Foundry/Elements/Top 0.0604
- =Mason= 210.85.16.204 - /Foundry/Elements/Tab 0.0194
- =Mason= 210.85.16.204 - /Foundry/Elements/Header 0.1375
- =Mason= 210.85.16.204 - /Foundry/Elements/Tabs 0.0037
- =Mason= 210.85.16.204 - /Elements/Callback 0.0294
- =Mason= 210.85.16.204 - /Elements/Footer 0.0308
- =Mason= 210.85.16.204 - /autohandler 2.9179
- =Mason= 210.85.16.204 - /Foundry/Home/MyRequests.html ENDS
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css BEGINS
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css >>>>
+ =Mason= 127.0.0.1 - /Elements/Callback >>>>
+ =Mason= 127.0.0.1 - /Elements/Callback <<<< 0.0008
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css <<<< 0.0072
+ =Mason= 127.0.0.1 - /NoAuth/webrt.css ENDS
Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
address, C<->, indented component name, and the time spent processing that
@@ -83,17 +79,21 @@ sub new {
print STDERR "=Mason= $self->{ip} - $self->{uri} BEGINS\n"
unless $Depth{$self->{ip}}{$self->{uri}}++;
+ my $indent = ' ' x (4 * $Depth{$self->{ip}}{$self->{uri}});
+ printf STDERR "=Mason= $self->{ip} - $indent".
+ "$self->{tag} >>>>\n";
+
bless($self, $class);
}
sub DESTROY {
my $self = shift;
- my $indent = ' ' x (4 * --$Depth{$self->{ip}}{$self->{uri}});
+ my $indent = ' ' x (4 + 4 * --$Depth{$self->{ip}}{$self->{uri}});
- printf STDERR "=Mason= $self->{ip} - $indent" .
- "$self->{tag} %.4f\n", (time - $self->{start});
+ printf STDERR "=Mason= $self->{ip} - $indent".
+ "$self->{tag} <<<< %.4f\n", (time - $self->{start});
- return if $indent;
+ return if $Depth{$self->{ip}}{$self->{uri}};
print STDERR "=Mason= $self->{ip} - $self->{uri} ENDS\n";
}
@@ -105,7 +105,7 @@ Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
=head1 COPYRIGHT
-Copyright 2002, 2003 by Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>.
+Copyright 2002, 2003, 2004 by Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>.
This program is free software; you can redistribute it and/or
modify it under the same terms as Perl itself.
diff --git a/t/0-signature.t b/t/0-signature.t
index 4db174d..af8aa70 100644
--- a/t/0-signature.t
+++ b/t/0-signature.t
@@ -1,20 +1,21 @@
#!/usr/bin/perl
# $File: //member/autrijus/MasonX-Profiler/t/0-signature.t $ $Author: autrijus $
-# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+# $Revision: #2 $ $Change: 10396 $ $DateTime: 2004/03/16 10:55:14 $
use strict;
print "1..1\n";
if (!-s 'SIGNATURE') {
- print "ok 1 # skip - No signature file found\n";
-}
-elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
- print "ok 1 # skip - Cannot connect to the keyserver\n";
+ print "ok 1 # skip No signature file found\n";
}
elsif (!eval { require Module::Signature; 1 }) {
- warn "# Next time around, consider install Module::Signature,\n".
- "# so you can verify the integrity of this distribution.\n";
- print "ok 1 # skip - Module::Signature not installed\n";
+ print "ok 1 # skip ",
+ "Next time around, consider install Module::Signature, ",
+ "so you can verify the integrity of this distribution.\n";
+}
+elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
+ print "ok 1 # skip ",
+ "Cannot connect to the keyserver\n";
}
else {
(Module::Signature::verify() == Module::Signature::SIGNATURE_OK())
commit eb8869aede3f51c0871f8ac74d9713b7530807ea
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Fri Oct 17 10:58:35 2003 +0000
Import of AUTRIJUS/MasonX-Profiler-0.02 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.02
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.02.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
index e612cdc..ab85f0a 100644
--- a/Changes
+++ b/Changes
@@ -1,4 +1,32 @@
____________________________________________________________________________
+[ 8452] By: autrijus on 2003/10/17 10:52:28
+ Log: * This be 0.02.
+ * fix a trivial typo.
+ ! lib/MasonX/Profiler.pm
+____________________________________________________________________________
+[ 8451] By: autrijus on 2003/10/17 10:50:45
+ Log: * add ENDS support
+ ! lib/MasonX/Profiler.pm
+____________________________________________________________________________
+[ 8449] By: autrijus on 2003/10/17 10:37:56
+ Log: * change the idiom from MasonX::Profile->init(my($p), $m,
+ $r) to
+ my $p = MasonX::Profiler->new($m, $r)
+ * the old (0.01) calling style is still supported.
+ * no longer refuses to profile if the remote IP is unknown.
+ instead, '*' is used by default.
+ * calling-stack depth tracing is now handler in a per-ip,
+ per-uri basis, which should eliminate race conditions.
+ ! lib/MasonX/Profiler.pm
+____________________________________________________________________________
+[ 8433] By: autrijus on 2003/10/16 11:35:50
+ Log: * add example about MasonPreamble
+ ! lib/MasonX/Profiler.pm
+____________________________________________________________________________
+[ 8432] By: autrijus on 2003/10/16 11:24:29
+ Log: * add changes
+ ! MANIFEST
+____________________________________________________________________________
[ 8431] By: autrijus on 2003/10/16 11:21:57
Log: * This be MasonX::Profiler 0.01, initial release.
+ MANIFEST Makefile.PL README
diff --git a/META.yml b/META.yml
index 5ffc6de..1b55996 100644
--- a/META.yml
+++ b/META.yml
@@ -1,6 +1,6 @@
name: MasonX-Profiler
module_name: MasonX::Profiler
-version: 0.01
+version: 0.02
abstract: Mason per-component profiler
author: Autrijus Tang (autrijus at autrijus.org)
distribution_type: module
diff --git a/SIGNATURE b/SIGNATURE
index adbf0e5..f4911f9 100644
--- a/SIGNATURE
+++ b/SIGNATURE
@@ -14,9 +14,9 @@ not run its Makefile.PL or Build.PL.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
-SHA1 392efafb897ac7cb7449c47cc4d757b57d96b970 Changes
+SHA1 75fd5d41d3957cb415cf6af02e8096be31e7c0f8 Changes
SHA1 2e0e9e37965dd7d082856aba4946a08253bf69ba MANIFEST
-SHA1 86ab6c522e257693ada3309bf2fc01b403a429fc META.yml
+SHA1 02cde43980d10fa58ec3fbca90ffe0797eeefedf META.yml
SHA1 d0a05aa53bd44bf6a8e60ff8fc7a9e0103fa5a6f Makefile.PL
SHA1 d92d89d20b16e4523fd7f790e58b03d51ac1cd3a README
SHA1 20260be7cfe0fbb394c4f8ff3a80cacfcb82dd73 inc/Module/Install.pm
@@ -24,13 +24,13 @@ SHA1 019bccc5b2e364447c6e6e150d049ca2a216598e inc/Module/Install/Base.pm
SHA1 e2547371d0317abbfa3d56b0d20bba909885d7db inc/Module/Install/MakeMaker.pm
SHA1 8f9804460ecdeaeaa79d3ff18f27551cab7371ea inc/Module/Install/Makefile.pm
SHA1 1afe7210c78328ecc24ee57c6f6aeb2a7b981c0e inc/Module/Install/Metadata.pm
-SHA1 9467acbae79a0f0116794ec37744c05a180412f0 lib/MasonX/Profiler.pm
+SHA1 1674ef5b7dd5256d7a501dea64453bce80a5dd99 lib/MasonX/Profiler.pm
SHA1 390da9ea2894cd70f0f7cb5489075566118cf36d t/0-signature.t
SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.3 (FreeBSD)
-iD8DBQE/joAetLPdNzw1AaARAiscAJ9HDUuBFtj6dJE98oai1hN3stMpfQCghrVs
-ALsjRGJr14tD+Ha9ADZk0uo=
-=UofI
+iD8DBQE/j8r6tLPdNzw1AaARAgK7AJ0XjRw6kKqWPZYjXwmVJhF7/zRKvACffdr1
+tOsGX7b9Uy45GwmEhVxosfA=
+=prM9
-----END PGP SIGNATURE-----
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
index ef4b0ed..55ec74a 100644
--- a/lib/MasonX/Profiler.pm
+++ b/lib/MasonX/Profiler.pm
@@ -1,8 +1,8 @@
# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
-# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+# $Revision: #5 $ $Change: 8452 $ $DateTime: 2003/10/17 10:52:28 $
package MasonX::Profiler;
-$MasonX::Profiler::VERSION = '0.01';
+$MasonX::Profiler::VERSION = '0.02';
use strict;
use Time::HiRes qw( time );
@@ -11,13 +11,26 @@ use Time::HiRes qw( time );
MasonX::Profiler - Mason per-component profiler
+=head1 VERSION
+
+This document describes version 0.02 of MasonX::Profiler, released
+October 17, 2003.
+
=head1 SYNOPSIS
+In the Mason handler:
+
use MasonX::Profiler;
my $ah = HTML::Mason::ApacheHandler->new(
- preamble => 'MasonX::Profiler->init(my($p), $m, $r);',
+ preamble => 'my $p = MasonX::Profiler->new($m, $r);',
+ # ...
);
+Alternatively, in F<httpd.conf> with L<HTML::Mason::ApacheHandler>:
+
+ PerlModule MasonX::Profiler
+ PerlSetVar MasonPreamble "my $p = MasonX::Profiler->new($m, $r);"
+
=head1 DESCRIPTION
This module prints per-component profiling information to STDERR (usually
@@ -35,43 +48,53 @@ directed to the Apache error log). Its output looks like this:
=Mason= 210.85.16.204 - /Elements/Callback 0.0294
=Mason= 210.85.16.204 - /Elements/Footer 0.0308
=Mason= 210.85.16.204 - /autohandler 2.9179
+ =Mason= 210.85.16.204 - /Foundry/Home/MyRequests.html ENDS
Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
address, C<->, indented component name, and the time spent processing that
-component (inclusive). The initial request is represented by the special
-time field C<BEGINS>.
+component (inclusive). The beginning and end of the initial request is
+represented by the special time fields C<BEGINS> and C<ENDS>.
=cut
-my $depth = 0;
+my %Depth;
sub init {
my ($class, $p, $m, $r) = @_;
- my $ip = eval { $r->connection->get_remote_host(
- Apache::REMOTE_NAME(), $r->per_dir_config
- ) } or return;
- $_[1] = $class->new( $m->current_comp->path, $r->uri, $ip );
+ $_[1] = $class->new($m, $r);
}
sub new {
- my ($class, $tag, $uri, $ip) = @_;
+ my ($class, $m, $r) = @_;
- return if $tag eq '/l';
+ my $self = {
+ start => time(),
+ uri => $r->uri,
+ tag => $m->current_comp->path,
+ ip => (
+ eval { $r->connection->get_remote_host(
+ Apache::REMOTE_NAME(), $r->per_dir_config,
+ ) } || '*'
+ ),
+ };
- my $self = bless({}, $class);
+ return if $self->{tag} eq '/l';
- $self->{tag} = $tag;
- $self->{start} = time;
- $self->{ip} = $ip;
+ print STDERR "=Mason= $self->{ip} - $self->{uri} BEGINS\n"
+ unless $Depth{$self->{ip}}{$self->{uri}}++;
- print STDERR "=Mason= $ip - $uri BEGINS\n" unless $depth++;
- return $self;
+ bless($self, $class);
}
sub DESTROY {
my $self = shift;
- printf STDERR "=Mason= $self->{ip} - " . (' ' x (--$depth*4)) . "%s %.4f\n",
- $self->{tag}, time - $self->{start};
+ my $indent = ' ' x (4 * --$Depth{$self->{ip}}{$self->{uri}});
+
+ printf STDERR "=Mason= $self->{ip} - $indent" .
+ "$self->{tag} %.4f\n", (time - $self->{start});
+
+ return if $indent;
+ print STDERR "=Mason= $self->{ip} - $self->{uri} ENDS\n";
}
1;
commit b2510f1b0c1f523c7e486a882edbbb0e40b889d1
Author: ☺唐鳳☻ <cpan at audreyt.org>
Date: Thu Oct 16 11:25:31 2003 +0000
Import of AUTRIJUS/MasonX-Profiler-0.01 from CPAN.
gitpan-cpan-distribution: MasonX-Profiler
gitpan-cpan-version: 0.01
gitpan-cpan-path: AUTRIJUS/MasonX-Profiler-0.01.tar.gz
gitpan-cpan-author: AUTRIJUS
gitpan-cpan-maturity: released
diff --git a/Changes b/Changes
new file mode 100644
index 0000000..e612cdc
--- /dev/null
+++ b/Changes
@@ -0,0 +1,6 @@
+____________________________________________________________________________
+[ 8431] By: autrijus on 2003/10/16 11:21:57
+ Log: * This be MasonX::Profiler 0.01, initial release.
+ + MANIFEST Makefile.PL README
+ + lib/MasonX/Profiler.pm t/0-signature.t
+ + t/1-basic.t
diff --git a/MANIFEST b/MANIFEST
new file mode 100644
index 0000000..2750f5b
--- /dev/null
+++ b/MANIFEST
@@ -0,0 +1,14 @@
+Changes
+inc/Module/Install.pm
+inc/Module/Install/Base.pm
+inc/Module/Install/Makefile.pm
+inc/Module/Install/MakeMaker.pm
+inc/Module/Install/Metadata.pm
+lib/MasonX/Profiler.pm
+Makefile.PL
+MANIFEST This list of files
+META.yml
+README
+SIGNATURE Public-key signature (added by MakeMaker)
+t/0-signature.t
+t/1-basic.t
diff --git a/META.yml b/META.yml
new file mode 100644
index 0000000..5ffc6de
--- /dev/null
+++ b/META.yml
@@ -0,0 +1,13 @@
+name: MasonX-Profiler
+module_name: MasonX::Profiler
+version: 0.01
+abstract: Mason per-component profiler
+author: Autrijus Tang (autrijus at autrijus.org)
+distribution_type: module
+requires:
+ HTML::Mason: 0
+ Time::HiRes: 0
+private:
+ directory:
+ - inc
+generated_by: Module::Install version 0.24
diff --git a/Makefile.PL b/Makefile.PL
new file mode 100644
index 0000000..3edb9a5
--- /dev/null
+++ b/Makefile.PL
@@ -0,0 +1,17 @@
+#!/usr/bin/env perl
+# $File: //member/autrijus/MasonX-Profiler/Makefile.PL $ $Author: autrijus $
+# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+
+use inc::Module::Install;
+
+requires ('HTML::Mason', 0);
+requires ('Time::HiRes', 0);
+
+WriteMakefile (
+ AUTHOR => 'Autrijus Tang (autrijus at autrijus.org)',
+ NAME => 'MasonX::Profiler',
+ ABSTRACT => 'Mason per-component profiler',
+ VERSION_FROM => 'lib/MasonX/Profiler.pm',
+ SIGN => 1,
+);
+
diff --git a/README b/README
new file mode 100644
index 0000000..e49c08a
--- /dev/null
+++ b/README
@@ -0,0 +1,27 @@
+# $File: //member/autrijus/MasonX-Profiler/README $ $Author: autrijus $
+# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+
+This is the README file for MasonX::Profiler, a per-component profiler
+extension for HTML::Mason.
+
+Please type "perldoc MasonX::Profiler" after installation to see
+the module usage information.
+
+* Installation
+
+MasonX::Profiler uses the standard perl module install process:
+
+cpansign -v # see SIGNATURE for details
+perl Makefile.PL
+make # or 'nmake' on Win32
+make test
+make install
+
+* Copyright
+
+Copyright 2003 by Autrijus Tang <autrijus at autrijus.org>.
+
+All rights reserved. You can redistribute and/or modify
+this bundle under the same terms as Perl itself.
+
+See <http://www.perl.com/perl/misc/Artistic.html>.
diff --git a/SIGNATURE b/SIGNATURE
new file mode 100644
index 0000000..adbf0e5
--- /dev/null
+++ b/SIGNATURE
@@ -0,0 +1,36 @@
+This file contains message digests of all files listed in MANIFEST,
+signed via the Module::Signature module, version 0.35.
+
+To verify the content in this distribution, first make sure you have
+Module::Signature installed, then type:
+
+ % cpansign -v
+
+It would 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 392efafb897ac7cb7449c47cc4d757b57d96b970 Changes
+SHA1 2e0e9e37965dd7d082856aba4946a08253bf69ba MANIFEST
+SHA1 86ab6c522e257693ada3309bf2fc01b403a429fc META.yml
+SHA1 d0a05aa53bd44bf6a8e60ff8fc7a9e0103fa5a6f Makefile.PL
+SHA1 d92d89d20b16e4523fd7f790e58b03d51ac1cd3a README
+SHA1 20260be7cfe0fbb394c4f8ff3a80cacfcb82dd73 inc/Module/Install.pm
+SHA1 019bccc5b2e364447c6e6e150d049ca2a216598e inc/Module/Install/Base.pm
+SHA1 e2547371d0317abbfa3d56b0d20bba909885d7db inc/Module/Install/MakeMaker.pm
+SHA1 8f9804460ecdeaeaa79d3ff18f27551cab7371ea inc/Module/Install/Makefile.pm
+SHA1 1afe7210c78328ecc24ee57c6f6aeb2a7b981c0e inc/Module/Install/Metadata.pm
+SHA1 9467acbae79a0f0116794ec37744c05a180412f0 lib/MasonX/Profiler.pm
+SHA1 390da9ea2894cd70f0f7cb5489075566118cf36d t/0-signature.t
+SHA1 325569eebed2092e7596f87782413fc17e5c07ae t/1-basic.t
+-----BEGIN PGP SIGNATURE-----
+Version: GnuPG v1.2.3 (FreeBSD)
+
+iD8DBQE/joAetLPdNzw1AaARAiscAJ9HDUuBFtj6dJE98oai1hN3stMpfQCghrVs
+ALsjRGJr14tD+Ha9ADZk0uo=
+=UofI
+-----END PGP SIGNATURE-----
diff --git a/inc/Module/Install.pm b/inc/Module/Install.pm
new file mode 100644
index 0000000..4a8137f
--- /dev/null
+++ b/inc/Module/Install.pm
@@ -0,0 +1,157 @@
+#line 1 "inc/Module/Install.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install.pm $ $Author: autrijus $
+# $Revision: #58 $ $Change: 1709 $ $DateTime: 2003/09/01 03:13:10 $ vim: expandtab shiftwidth=4
+
+package Module::Install;
+$VERSION = '0.24';
+
+die <<END unless defined $INC{'inc/Module/Install.pm'};
+Please invoke Module::Install with:
+
+ use inc::Module::Install;
+
+not:
+
+ use Module::Install;
+
+END
+
+use strict 'vars';
+use File::Find;
+use File::Path;
+
+ at inc::Module::Install::ISA = 'Module::Install';
+
+#line 127
+
+sub import {
+ my $class = $_[0];
+ my $self = $class->new(@_[1..$#_]);
+
+ if (not -f $self->{file}) {
+ require "$self->{path}/$self->{dispatch}.pm";
+ mkpath "$self->{prefix}/$self->{author}";
+ $self->{admin} =
+ "$self->{name}::$self->{dispatch}"->new(_top => $self);
+ $self->{admin}->init;
+ @_ = ($class, _self => $self);
+ goto &{"$self->{name}::import"};
+ }
+
+ *{caller(0) . "::AUTOLOAD"} = $self->autoload;
+}
+
+#line 150
+
+sub autoload {
+ my $self = shift;
+ my $caller = caller;
+ sub {
+ ${"$caller\::AUTOLOAD"} =~ /([^:]+)$/ or die "Cannot autoload $caller";
+ unshift @_, ($self, $1);
+ goto &{$self->can('call')} unless uc($1) eq $1;
+ };
+}
+
+#line 167
+
+sub new {
+ my ($class, %args) = @_;
+
+ return $args{_self} if $args{_self};
+
+ $args{dispatch} ||= 'Admin';
+ $args{prefix} ||= 'inc';
+ $args{author} ||= '.author';
+ $args{bundle} ||= '_bundle';
+
+ $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{prefix}/$args{path}.pm";
+
+ bless(\%args, $class);
+}
+
+#line 195
+
+sub call {
+ my $self = shift;
+ my $method = shift;
+ my $obj = $self->load($method) or return;
+
+ unshift @_, $obj;
+ goto &{$obj->can($method)};
+}
+
+#line 210
+
+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";
+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
+
+ my $obj = $admin->load($method, 1);
+ push @{$self->{extensions}}, $obj;
+
+ $obj;
+}
+
+#line 240
+
+sub load_extensions {
+ my ($self, $path, $top_obj) = @_;
+
+ unshift @INC, $self->{prefix}
+ unless grep { $_ eq $self->{prefix} } @INC;
+
+ local @INC = ($path, @INC);
+ foreach my $rv ($self->find_extensions($path)) {
+ my ($file, $pkg) = @{$rv};
+ next if $self->{pathnames}{$pkg};
+
+ eval { require $file; 1 } or (warn($@), next);
+ $self->{pathnames}{$pkg} = $INC{$file};
+ push @{$self->{extensions}}, $pkg->new( _top => $top_obj );
+ }
+}
+
+#line 264
+
+sub find_extensions {
+ my ($self, $path) = @_;
+ my @found;
+
+ find(sub {
+ my $file = $File::Find::name;
+ return unless $file =~ m!^\Q$path\E/(.+)\.pm\Z!is;
+ return if $1 eq $self->{dispatch};
+
+ $file = "$self->{path}/$1.pm";
+ my $pkg = "$self->{name}::$1"; $pkg =~ s!/!::!g;
+ push @found, [$file, $pkg];
+ }, $path) if -d $path;
+
+ @found;
+}
+
+1;
+
+__END__
+
+#line 556
diff --git a/inc/Module/Install/Base.pm b/inc/Module/Install/Base.pm
new file mode 100644
index 0000000..443fcb7
--- /dev/null
+++ b/inc/Module/Install/Base.pm
@@ -0,0 +1,57 @@
+#line 1 "inc/Module/Install/Base.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Base.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Base.pm $ $Author: autrijus $
+# $Revision: #9 $ $Change: 1665 $ $DateTime: 2003/08/18 07:52:47 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Base;
+
+#line 31
+
+sub new {
+ my ($class, %args) = @_;
+
+ foreach my $method (qw(call load)) {
+ *{"$class\::$method"} = sub {
+ +shift->_top->$method(@_);
+ } unless defined &{"$class\::$method"};
+ }
+
+ bless(\%args, $class);
+}
+
+#line 49
+
+sub AUTOLOAD {
+ my $self = shift;
+ goto &{$self->_top->autoload};
+}
+
+#line 60
+
+sub _top { $_[0]->{_top} }
+
+#line 71
+
+sub admin {
+ my $self = shift;
+ $self->_top->{admin} or Module::Install::Base::FakeAdmin->new;
+}
+
+sub is_admin {
+ my $self = shift;
+ $self->admin->VERSION;
+}
+
+sub DESTROY {}
+
+package Module::Install::Base::FakeAdmin;
+
+my $Fake;
+sub new { $Fake ||= bless(\@_, $_[0]) }
+sub AUTOLOAD {}
+sub DESTROY {}
+
+1;
+
+__END__
+
+#line 115
diff --git a/inc/Module/Install/MakeMaker.pm b/inc/Module/Install/MakeMaker.pm
new file mode 100644
index 0000000..af1a2d5
--- /dev/null
+++ b/inc/Module/Install/MakeMaker.pm
@@ -0,0 +1,44 @@
+#line 1 "inc/Module/Install/MakeMaker.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/MakeMaker.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/MakeMaker.pm $ $Author: autrijus $
+# $Revision: #10 $ $Change: 1645 $ $DateTime: 2003/07/16 01:05:06 $ vim: expandtab shiftwidth=4
+
+package Module::Install::MakeMaker;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+use ExtUtils::MakeMaker ();
+
+my $makefile;
+sub WriteMakefile {
+ my ($self, %args) = @_;
+ $makefile = $self->load('Makefile');
+
+ # mapping between MakeMaker and META.yml keys
+ $args{MODULE_NAME} = $args{NAME};
+ unless ($args{NAME} = $args{DISTNAME} or !$args{MODULE_NAME}) {
+ $args{NAME} = $args{MODULE_NAME};
+ $args{NAME} =~ s/::/-/g;
+ }
+
+ foreach my $key (qw(name module_name version version_from abstract author)) {
+ my $value = delete($args{uc($key)}) or next;
+ $self->$key($value);
+ }
+
+ if (my $prereq = delete($args{PREREQ_PM})) {
+ $self->requires($_ => $prereq->{$_}) for keys %$prereq;
+ }
+
+ # put the remaining args to makemaker_args
+ $self->makemaker_args(%args);
+}
+
+END {
+ if ($makefile) {
+ $makefile->write;
+ $makefile->Meta->write;
+ }
+}
+
+1;
diff --git a/inc/Module/Install/Makefile.pm b/inc/Module/Install/Makefile.pm
new file mode 100644
index 0000000..a3c22a5
--- /dev/null
+++ b/inc/Module/Install/Makefile.pm
@@ -0,0 +1,113 @@
+#line 1 "inc/Module/Install/Makefile.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Makefile.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Makefile.pm $ $Author: autrijus $
+# $Revision: #45 $ $Change: 1645 $ $DateTime: 2003/07/16 01:05:06 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Makefile;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+use strict 'vars';
+use vars '$VERSION';
+
+use ExtUtils::MakeMaker ();
+
+sub Makefile { $_[0] }
+
+sub prompt {
+ shift;
+ goto &ExtUtils::MakeMaker::prompt;
+}
+
+sub makemaker_args {
+ my $self = shift;
+ my $args = ($self->{makemaker_args} ||= {});
+ %$args = ( %$args, @_ ) if @_;
+ $args;
+}
+
+sub clean_files {
+ my $self = shift;
+ $self->makemaker_args( clean => { FILES => "@_ " } );
+}
+
+sub write {
+ my $self = shift;
+ die "&Makefile->write() takes no arguments\n" if @_;
+
+ my $args = $self->makemaker_args;
+
+ $args->{DISTNAME} = $self->name;
+ $args->{NAME} = $self->module_name || $self->name || $self->determine_NAME($args);
+ $args->{VERSION} = $self->version || $self->determine_VERSION($args);
+ $args->{NAME} =~ s/-/::/g;
+
+ if ($] >= 5.005) {
+ $args->{ABSTRACT} = $self->abstract;
+ $args->{AUTHOR} = $self->author;
+ }
+ if ( eval($ExtUtils::MakeMaker::VERSION) >= 6.10 )
+ {
+ $args->{NO_META} = 1;
+ }
+
+ # merge both kinds of requires into prereq_pm
+ my $prereq = ($args->{PREREQ_PM} ||= {});
+ %$prereq = ( %$prereq, map { @$_ } map { @$_ } grep $_,
+ ($self->build_requires, $self->requires) );
+
+ # merge both kinds of requires into prereq_pm
+ my $dir = ($args->{DIR} ||= []);
+ push @$dir, map "$self->{prefix}/$self->{bundle}/$_->[1]", @{$self->bundles}
+ if $self->bundles;
+
+ my %args = map {($_ => $args->{$_})} grep {defined($args->{$_})} keys %$args;
+
+ if ($self->admin->preop) {
+ $args{dist} = $self->admin->preop;
+ }
+
+ ExtUtils::MakeMaker::WriteMakefile(%args);
+
+ $self->fix_up_makefile();
+}
+
+sub fix_up_makefile {
+ my $self = shift;
+ my $top_class = ref($self->_top) || '';
+ my $top_version = $self->_top->VERSION || '';
+
+ my $preamble = $self->preamble
+ ? "# Preamble by $top_class $top_version\n" . $self->preamble
+ : '';
+ my $postamble = "# Postamble by $top_class $top_version\n" .
+ ($self->postamble || '');
+
+ open MAKEFILE, '< Makefile' or die $!;
+ my $makefile = do { local $/; <MAKEFILE> };
+ close MAKEFILE;
+
+ open MAKEFILE, '> Makefile' or die $!;
+ print MAKEFILE "$preamble$makefile$postamble";
+ close MAKEFILE;
+}
+
+sub preamble {
+ my ($self, $text) = @_;
+ $self->{preamble} = $text . $self->{preamble} if defined $text;
+ $self->{preamble};
+}
+
+sub postamble {
+ my ($self, $text) = @_;
+
+ $self->{postamble} ||= $self->admin->postamble;
+ $self->{postamble} .= $text if defined $text;
+ $self->{postamble}
+}
+
+1;
+
+__END__
+
+#line 242
diff --git a/inc/Module/Install/Metadata.pm b/inc/Module/Install/Metadata.pm
new file mode 100644
index 0000000..a0b5b27
--- /dev/null
+++ b/inc/Module/Install/Metadata.pm
@@ -0,0 +1,132 @@
+#line 1 "inc/Module/Install/Metadata.pm - /usr/local/lib/perl5/site_perl/5.8.1/Module/Install/Metadata.pm"
+# $File: //depot/cpan/Module-Install/lib/Module/Install/Metadata.pm $ $Author: autrijus $
+# $Revision: #25 $ $Change: 1665 $ $DateTime: 2003/08/18 07:52:47 $ vim: expandtab shiftwidth=4
+
+package Module::Install::Metadata;
+use Module::Install::Base; @ISA = qw(Module::Install::Base);
+
+$VERSION = '0.01';
+
+use strict 'vars';
+use vars qw($VERSION);
+
+sub Meta { shift }
+
+my @scalar_keys = qw(name module_name version abstract author license distribution_type);
+my @tuple_keys = qw(build_requires requires recommends bundles);
+
+foreach my $key (@scalar_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} unless @_;
+ $self->{values}{$key} = shift;
+ return $self;
+ };
+}
+
+foreach my $key (@tuple_keys) {
+ *$key = sub {
+ my $self = shift;
+ return $self->{values}{$key} unless @_;
+ my @rv;
+ while (@_) {
+ my $module = shift or last;
+ my $version = shift || 0;
+ my $rv = [$module, $version];
+ push @{$self->{values}{$key}}, $rv;
+ push @rv, $rv;
+ }
+ return @rv;
+ };
+}
+
+sub features {
+ my $self = shift;
+ while (my ($name, $mods) = splice(@_, 0, 2)) {
+ my $count = 0;
+ push @{$self->{values}{features}}, ($name => [
+ map { (++$count % 2 and ref($_) and ($count += $#$_)) ? @$_ : $_ } @$mods
+ ] );
+ }
+ return @{$self->{values}{features}};
+}
+
+sub _dump {
+ my $self = shift;
+ my $package = ref($self->_top);
+ my $version = $self->_top->VERSION;
+ my %values = %{$self->{values}};
+ $values{distribution_type} ||= 'module';
+ $values{name} ||= do {
+ my $name = $values{module_name};
+ $name =~ s/::/-/g;
+ $name;
+ } if $values{module_name};
+
+ my $dump = '';
+ foreach my $key (@scalar_keys) {
+ $dump .= "$key: $values{$key}\n" if exists $values{$key};
+ }
+ foreach my $key (@tuple_keys) {
+ next unless exists $values{$key};
+ $dump .= "$key:\n";
+ $dump .= " $_->[0]: $_->[1]\n" for @{$values{$key}};
+ }
+
+ return($dump . "private:\n directory:\n - inc\ngenerated_by: $package version $version\n");
+}
+
+sub read {
+ my $self = shift;
+ $self->include_deps( 'YAML', 0 );
+ require YAML;
+ my $data = YAML::LoadFile( 'META.yml' );
+ # Call methods explicitly in case user has already set some values.
+ while ( my ($key, $value) = each %$data ) {
+ next unless $self->can( $key );
+ if (ref $value eq 'HASH') {
+ while (my ($module, $version) = each %$value) {
+ $self->$key( $module => $version );
+ }
+ }
+ else {
+ $self->$key( $value );
+ }
+ }
+ return $self;
+}
+
+sub write {
+ my $self = shift;
+ return $self unless $self->is_admin;
+
+ META_NOT_OURS: {
+ local *FH;
+ if (open FH, "META.yml") {
+ while (<FH>) {
+ last META_NOT_OURS if /^generated_by: Module::Install\b/;
+ }
+ return $self;
+ }
+ }
+
+ warn "Writing META.yml\n";
+ open META, "> META.yml" or warn "Cannot write to META.yml: $!";
+ print META $self->_dump;
+ close META;
+ return $self;
+}
+
+sub version_from {
+ my ($self, $version_from) = @_;
+ require ExtUtils::MM_Unix;
+ $self->version(ExtUtils::MM_Unix->parse_version($version_from));
+}
+
+sub abstract_from {
+ my ($self, $abstract_from) = @_;
+ require ExtUtils::MM_Unix;
+ $self->abstract(ExtUtils::MM_Unix->parse_abstract($abstract_from));
+}
+
+1;
diff --git a/lib/MasonX/Profiler.pm b/lib/MasonX/Profiler.pm
new file mode 100644
index 0000000..ef4b0ed
--- /dev/null
+++ b/lib/MasonX/Profiler.pm
@@ -0,0 +1,92 @@
+# $File: //member/autrijus/MasonX-Profiler/lib/MasonX/Profiler.pm $ $Author: autrijus $
+# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+
+package MasonX::Profiler;
+$MasonX::Profiler::VERSION = '0.01';
+
+use strict;
+use Time::HiRes qw( time );
+
+=head1 NAME
+
+MasonX::Profiler - Mason per-component profiler
+
+=head1 SYNOPSIS
+
+ use MasonX::Profiler;
+ my $ah = HTML::Mason::ApacheHandler->new(
+ preamble => 'MasonX::Profiler->init(my($p), $m, $r);',
+ );
+
+=head1 DESCRIPTION
+
+This module prints per-component profiling information to STDERR (usually
+directed to the Apache error log). Its output looks like this:
+
+ =Mason= 210.85.16.204 - /Foundry/Home/MyRequests.html BEGINS
+ =Mason= 210.85.16.204 - /Elements/SetupSessionCookie 0.0610
+ =Mason= 210.85.16.204 - /Callbacks/Foundry/autohandler/Auth 0.0003
+ =Mason= 210.85.16.204 - /Elements/Callback 0.0242
+ =Mason= 210.85.16.204 - /Elements/Callback 0.0016
+ =Mason= 210.85.16.204 - /Foundry/Elements/Top 0.0604
+ =Mason= 210.85.16.204 - /Foundry/Elements/Tab 0.0194
+ =Mason= 210.85.16.204 - /Foundry/Elements/Header 0.1375
+ =Mason= 210.85.16.204 - /Foundry/Elements/Tabs 0.0037
+ =Mason= 210.85.16.204 - /Elements/Callback 0.0294
+ =Mason= 210.85.16.204 - /Elements/Footer 0.0308
+ =Mason= 210.85.16.204 - /autohandler 2.9179
+
+Each row contains five whitespace-separated fields: C<=Mason=>, remote IP
+address, C<->, indented component name, and the time spent processing that
+component (inclusive). The initial request is represented by the special
+time field C<BEGINS>.
+
+=cut
+
+my $depth = 0;
+
+sub init {
+ my ($class, $p, $m, $r) = @_;
+ my $ip = eval { $r->connection->get_remote_host(
+ Apache::REMOTE_NAME(), $r->per_dir_config
+ ) } or return;
+ $_[1] = $class->new( $m->current_comp->path, $r->uri, $ip );
+}
+
+sub new {
+ my ($class, $tag, $uri, $ip) = @_;
+
+ return if $tag eq '/l';
+
+ my $self = bless({}, $class);
+
+ $self->{tag} = $tag;
+ $self->{start} = time;
+ $self->{ip} = $ip;
+
+ print STDERR "=Mason= $ip - $uri BEGINS\n" unless $depth++;
+ return $self;
+}
+
+sub DESTROY {
+ my $self = shift;
+ printf STDERR "=Mason= $self->{ip} - " . (' ' x (--$depth*4)) . "%s %.4f\n",
+ $self->{tag}, time - $self->{start};
+}
+
+1;
+
+=head1 AUTHORS
+
+Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>
+
+=head1 COPYRIGHT
+
+Copyright 2002, 2003 by Autrijus Tang E<lt>autrijus at autrijus.orgE<gt>.
+
+This program is free software; you can redistribute it and/or
+modify it under the same terms as Perl itself.
+
+See L<http://www.perl.com/perl/misc/Artistic.html>
+
+=cut
diff --git a/t/0-signature.t b/t/0-signature.t
new file mode 100644
index 0000000..4db174d
--- /dev/null
+++ b/t/0-signature.t
@@ -0,0 +1,25 @@
+#!/usr/bin/perl
+# $File: //member/autrijus/MasonX-Profiler/t/0-signature.t $ $Author: autrijus $
+# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+
+use strict;
+print "1..1\n";
+
+if (!-s 'SIGNATURE') {
+ print "ok 1 # skip - No signature file found\n";
+}
+elsif (!eval { require Socket; Socket::inet_aton('pgp.mit.edu') }) {
+ print "ok 1 # skip - Cannot connect to the keyserver\n";
+}
+elsif (!eval { require Module::Signature; 1 }) {
+ warn "# Next time around, consider install Module::Signature,\n".
+ "# so you can verify the integrity of this distribution.\n";
+ print "ok 1 # skip - Module::Signature not installed\n";
+}
+else {
+ (Module::Signature::verify() == Module::Signature::SIGNATURE_OK())
+ or print "not ";
+ print "ok 1 # Valid signature\n";
+}
+
+__END__
diff --git a/t/1-basic.t b/t/1-basic.t
new file mode 100644
index 0000000..72af71b
--- /dev/null
+++ b/t/1-basic.t
@@ -0,0 +1,10 @@
+# $File: //member/autrijus/MasonX-Profiler/t/1-basic.t $ $Author: autrijus $
+# $Revision: #1 $ $Change: 8431 $ $DateTime: 2003/10/16 11:21:57 $
+
+use strict;
+use Test;
+BEGIN { plan tests => 1 }
+
+use MasonX::Profiler; ok(1);
+
+1;
-----------------------------------------------------------------------
hooks/post-receive
--
UNNAMED PROJECT
More information about the Bps-public-commit
mailing list