r41652 - in /branches/upstream/libcarp-always-perl: ./ current/ current/lib/ current/lib/Carp/ current/t/

ryan52-guest at users.alioth.debian.org ryan52-guest at users.alioth.debian.org
Tue Aug 11 02:24:37 UTC 2009


Author: ryan52-guest
Date: Tue Aug 11 02:24:13 2009
New Revision: 41652

URL: http://svn.debian.org/wsvn/pkg-perl/?sc=1&rev=41652
Log:
[svn-inject] Installing original source of libcarp-always-perl

Added:
    branches/upstream/libcarp-always-perl/
    branches/upstream/libcarp-always-perl/current/
    branches/upstream/libcarp-always-perl/current/Changes
    branches/upstream/libcarp-always-perl/current/MANIFEST
    branches/upstream/libcarp-always-perl/current/META.yml
    branches/upstream/libcarp-always-perl/current/Makefile.PL
    branches/upstream/libcarp-always-perl/current/README
    branches/upstream/libcarp-always-perl/current/lib/
    branches/upstream/libcarp-always-perl/current/lib/Carp/
    branches/upstream/libcarp-always-perl/current/lib/Carp/Always.pm
    branches/upstream/libcarp-always-perl/current/t/
    branches/upstream/libcarp-always-perl/current/t/001use.t
    branches/upstream/libcarp-always-perl/current/t/010simple.t
    branches/upstream/libcarp-always-perl/current/t/098pod-coverage.t
    branches/upstream/libcarp-always-perl/current/t/099pod.t

Added: branches/upstream/libcarp-always-perl/current/Changes
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/Changes?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/Changes (added)
+++ branches/upstream/libcarp-always-perl/current/Changes Tue Aug 11 02:24:13 2009
@@ -1,0 +1,56 @@
+Revision history for Perl extension Carp::Always.
+
+    $Id: Changes 1480 2007-07-30 14:35:04Z me $
+
+0.09  Mon Jul 30 2007
+        - no need for updating
+        - lib/Carp/Indeed.pm was moved to the deprecate
+          Carp-Indeed distribution
+
+0.08  Tue Mar 20 2007
+        - no need for updating
+        - micro changes (POD, Makefile.PL, README)
+
+0.07  Tue Oct 25 2006
+        - no real change, no need to upgrade
+        - added taint checking to tests, with shebang "#!perl -T\n"
+        - Always.pm and Indeed.pm moved to lib/Carp/
+        - "use strict" in Indeed.pm
+        - $Carp::Indeed::VERSION = $Carp::Always::VERSION
+
+0.06  Mon Jul 17 2006
+        - Carp::Indeed was superseded by Carp::Always
+        - now there is an END block
+        - there is a test for POD coverage
+
+0.05  Tue May 30 2006
+        - remove @EXPORT_OK and all use of Exporter (which was good
+          for nothing) - a suggestion by Yuval Kogman via CPAN ratings
+        - simplified tests with Test::Base
+
+0.04  Wed Oct 12 2005 (r198, tag)
+        - fixed mistakes at META.yml and t/002basic.t
+        - shortened documentation
+
+0.03  Mon Oct 10 2005
+        - now using $SIG{__DIE__} and $SIG{__WARN__} to catch 
+          perl generated warnings and errors as well 
+        - added a test for perl generated warnings
+        - renamed "t/003pod.t" to "t/090pod.t"
+        - shortened "lib/Carp/Indeed.pm" to "Indeed.pm" (as
+          this is a module of an only PM file)
+
+0.02  Thu Aug  5 2005
+        - POD minor fixes 
+        - I should have said "NO_META => 1" in Makefile.PL instead
+          of "NO_META => 0"
+        - "use Carp qw(verbose)" instead of "require Carp; $Carp::Verbose=1"
+          was enough for carp() and croak() to be verbose too
+
+0.01  Thu Aug  4 2005
+        - first realease to CPAN
+
+0.00  Thu Aug  4 13:07:27 2005
+        - original version; created by h2xs 1.23 with options
+                -AX -n Carp::Indeed
+

Added: branches/upstream/libcarp-always-perl/current/MANIFEST
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/MANIFEST?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/MANIFEST (added)
+++ branches/upstream/libcarp-always-perl/current/MANIFEST Tue Aug 11 02:24:13 2009
@@ -1,0 +1,13 @@
+Changes
+Makefile.PL
+MANIFEST
+README
+
+t/001use.t
+t/010simple.t
+t/098pod-coverage.t
+t/099pod.t
+
+lib/Carp/Always.pm
+
+META.yml                                 Module meta-data (added by MakeMaker)

Added: branches/upstream/libcarp-always-perl/current/META.yml
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/META.yml?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/META.yml (added)
+++ branches/upstream/libcarp-always-perl/current/META.yml Tue Aug 11 02:24:13 2009
@@ -1,0 +1,19 @@
+--- #YAML:1.0
+name:                Carp-Always
+version:             0.09
+abstract:            Warns and dies noisily with stack backtraces
+license:             perl
+generated_by:        ExtUtils::MakeMaker version 6.36
+distribution_type:   module
+requires:     
+    Carp:                          0
+    Test::More:                    0
+meta-spec:
+    url:     http://module-build.sourceforge.net/META-spec-v1.2.html
+    version: 1.2
+author:
+    - Adriano R. Ferreira <ferreira at cpan.org>
+recommends:
+    Test::Pod:                     1.18
+    Test::Pod::Coverage:           1.04
+    Test::Base:                    0

Added: branches/upstream/libcarp-always-perl/current/Makefile.PL
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/Makefile.PL?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/Makefile.PL (added)
+++ branches/upstream/libcarp-always-perl/current/Makefile.PL Tue Aug 11 02:24:13 2009
@@ -1,0 +1,25 @@
+
+use 5.006;
+use ExtUtils::MakeMaker;
+
+my $EUMM_VERSION = eval $ExtUtils::MakeMaker::VERSION;
+
+WriteMakefile(
+    NAME              => 'Carp::Always',
+    VERSION_FROM      => 'lib/Carp/Always.pm',
+    PREREQ_PM         => {
+        Carp       => 0,
+        Test::More => 0,
+    },
+    ($] >= 5.005 ? (
+        ABSTRACT_FROM => 'lib/Carp/Always.pm',
+        AUTHOR        => 'Adriano R. Ferreira <ferreira at cpan.org>'
+    ) : ()),
+    ($EUMM_VERSION >= 6.31 ? (
+        LICENSE => 'perl', 
+        EXTRA_META => "recommends:\n    Test::Pod:                     1.18\n" .
+                                   "    Test::Pod::Coverage:           1.04\n" .
+                                   "    Test::Base:                    0\n",
+    ) :())
+
+);

Added: branches/upstream/libcarp-always-perl/current/README
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/README?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/README (added)
+++ branches/upstream/libcarp-always-perl/current/README Tue Aug 11 02:24:13 2009
@@ -1,0 +1,45 @@
+Carp-Always version 0.09
+========================
+
+Carp::Always can be used to make a script complain loudly
+with stack traces when warn()ing or die()ing.
+
+  perl -MCarp::Always script.pl
+
+
+Perl has Carp which is a module as old as Perl 5. It has
+an option to print errors (from the perspective of caller) 
+with stack backtrace. With a few lines of codes, this module
+illustrates how to make warn() and die() noisy as well.
+
+This module was written as a reaction to Acme::JavaTrace by
+Sébastien Aperghis-Tramoni. I didn't know Sébastien or
+or understood its humor at the time. That and more was 
+pointed by Robert Rothenberg at CPAN ratings. But the module
+idea stood and lives to help you out with debugging your code.
+
+INSTALLATION
+
+To install this module type the following:
+
+   perl Makefile.PL
+   make
+   make test
+   make install
+
+DEPENDENCIES
+
+This module requires these other modules and libraries:
+
+  Carp
+
+but that is a core Perl module. 
+
+COPYRIGHT AND LICENCE
+
+Copyright (C) 2005-2007 by Ferreira
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+

Added: branches/upstream/libcarp-always-perl/current/lib/Carp/Always.pm
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/lib/Carp/Always.pm?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/lib/Carp/Always.pm (added)
+++ branches/upstream/libcarp-always-perl/current/lib/Carp/Always.pm Tue Aug 11 02:24:13 2009
@@ -1,0 +1,162 @@
+
+package Carp::Always;
+
+use 5.006;
+use strict;
+use warnings;
+
+our $VERSION = '0.09';
+
+use Carp qw(verbose); # makes carp() cluck and croak() confess
+
+sub _warn {
+  if ($_[-1] =~ /\n$/s) {
+    my $arg = pop @_;
+    $arg =~ s/ at .*? line .*?\n$//s;
+    push @_, $arg;
+  }
+  warn &Carp::longmess;
+}
+
+sub _die {
+  if ($_[-1] =~ /\n$/s) {
+    my $arg = pop @_;
+    $arg =~ s/ at .*? line .*?\n$//s;
+    push @_, $arg;
+  }
+  die &Carp::longmess;
+}
+
+my %OLD_SIG;
+
+BEGIN {
+  @OLD_SIG{qw(__DIE__ __WARN__)} = @SIG{qw(__DIE__ __WARN__)};
+  $SIG{__DIE__} = \&_die;
+  $SIG{__WARN__} = \&_warn;
+}
+
+END {
+  @SIG{qw(__DIE__ __WARN__)} = @OLD_SIG{qw(__DIE__ __WARN__)};
+}
+
+1;
+__END__
+
+=head1 NAME
+
+Carp::Always - Warns and dies noisily with stack backtraces
+
+=head1 SYNOPSIS
+
+  use Carp::Always;
+
+makes every C<warn()> and C<die()> complains loudly in the calling package 
+and elsewhere. More often used on the command line:
+
+  perl -MCarp::Always script.pl
+
+=head1 DESCRIPTION
+
+This module is meant as a debugging aid. It can be 
+used to make a script complain loudly with stack backtraces 
+when warn()ing or die()ing.
+
+Here are how stack backtraces produced by this module
+looks:
+
+  # it works for explicit die's and warn's
+  $ perl -MCarp::Always -e 'sub f { die "arghh" }; sub g { f }; g'
+  arghh at -e line 1
+          main::f() called at -e line 1
+          main::g() called at -e line 1
+
+  # it works for interpreter-thrown failures
+  $ perl -MCarp::Always -w -e 'sub f { $a = shift; @a = @$a };' \
+                           -e 'sub g { f(undef) }; g'
+  Use of uninitialized value in array dereference at -e line 1
+          main::f('undef') called at -e line 2
+          main::g() called at -e line 2
+
+In the implementation, the C<Carp> module does
+the heavy work, through C<longmess()>. The
+actual implementation sets the signal hooks
+C<$SIG{__WARN__}> and C<$SIG{__DIE__}> to
+emit the stack backtraces.
+
+Oh, by the way, C<carp> and C<croak> when requiring/using
+the C<Carp> module are also made verbose, behaving
+like C<cloak> and C<confess>, respectively.
+
+=head2 EXPORT
+
+Nothing at all is exported.
+
+=head1 ACKNOWLEDGMENTS
+
+This module was born as a reaction to a release
+of L<Acme::JavaTrace> by Sébastien Aperghis-Tramoni.
+Sébastien also has a newer module called
+L<Devel::SimpleTrace> with the same code and fewer flame
+comments on docs. The pruning of the uselessly long
+docs of this module were prodded by Michael Schwern.
+
+Schwern and others told me "the module name stinked" -
+it was called C<Carp::Indeed>. After thinking long
+and not getting nowhere, I went with nuffin's suggestion
+and now it is called C<Carp::Always>. 
+C<Carp::Indeed> which is now deprecate
+lives in its own distribution (which won't go anywhere
+but will stay there as a redirection to this module).
+
+=head1 SEE ALSO
+
+=over 4
+
+=item *
+
+L<Carp>
+
+=item *
+
+L<Acme::JavaTrace> and L<Devel::SimpleTrace>
+
+=back
+
+Please report bugs via CPAN RT 
+http://rt.cpan.org/NoAuth/Bugs.html?Dist=Carp-Always.
+
+=head1 BUGS
+
+Every (un)deserving module has its own pet bugs.
+
+=over 4
+
+=item *
+
+This module does not play well with other modules which fusses
+around with C<warn>, C<die>, C<$SIG{'__WARN__'}>,
+C<$SIG{'__DIE__'}>.
+
+=item *
+
+Test scripts are good. I should write more of these.
+
+=item *
+
+I don't know if this module name is still a bug as it was
+at the time of C<Carp::Indeed>.
+
+=back
+
+=head1 AUTHOR
+
+Adriano Ferreira, E<lt>ferreira at cpan.orgE<gt>
+
+=head1 COPYRIGHT AND LICENSE
+
+Copyright (C) 2005-2007 by Adriano R. Ferreira
+
+This library is free software; you can redistribute it and/or modify
+it under the same terms as Perl itself.
+
+=cut

Added: branches/upstream/libcarp-always-perl/current/t/001use.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/t/001use.t?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/t/001use.t (added)
+++ branches/upstream/libcarp-always-perl/current/t/001use.t Tue Aug 11 02:24:13 2009
@@ -1,0 +1,8 @@
+#perl -T 
+
+use Test::More tests => 1;
+BEGIN { use_ok('Carp::Always') };
+
+diag( "Testing Carp::Always $Carp::Always::VERSION, Perl $], $^X" );
+
+

Added: branches/upstream/libcarp-always-perl/current/t/010simple.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/t/010simple.t?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/t/010simple.t (added)
+++ branches/upstream/libcarp-always-perl/current/t/010simple.t Tue Aug 11 02:24:13 2009
@@ -1,0 +1,86 @@
+#perl -T 
+
+BEGIN {
+    eval { require Test::Base };
+    if ($@) {
+        require Test::More;
+        Test::More::plan(skip_all => "Test::Base required for module tests");
+    }
+}
+
+use Test::Base;
+
+my $OUTFILE = 'test-block.pl';
+my $PERL5OPTS = '-Mblib -MCarp::Always';
+
+sub Test::Base::Filter::exec_perl_stderr {
+    my $self = shift;       # The Test::Base::Filter object
+    my $tmpfile = $OUTFILE;
+    $self->_write_to($tmpfile, @_);
+    open my $execution, "$^X $PERL5OPTS $OUTFILE 2>&1 |"
+      or die "Couldn't open subprocess: $!\n";
+    local $/;
+    my $output = <$execution>;
+    close $execution;
+    unlink($tmpfile)
+      or die "Couldn't unlink $tmpfile: $!\n";
+    return $output;
+}
+
+filters { perl => 'exec_perl_stderr' };
+run_is_deeply 'perl', 'stderr';
+
+__END__
+
+=== basic test
+--- perl
+
+package A;
+
+sub f {
+#line 1
+    warn  "Beware!";
+}
+
+sub g {
+#line 2
+	f();
+}
+
+package main;
+
+#line 3
+A::g();
+
+--- stderr
+Beware! at test-block.pl line 1
+	A::f() called at test-block.pl line 2
+	A::g() called at test-block.pl line 3
+
+=== interpreter-thrown warnings
+
+--- perl
+
+package A;
+
+sub f {
+	use strict;
+	my $a;
+#line 1
+	my @a = @$a;
+}
+
+sub g {
+#line 2
+	f();
+}
+
+package main;
+
+#line 3
+A::g();
+
+--- stderr
+Can't use an undefined value as an ARRAY reference at test-block.pl line 1
+	A::f() called at test-block.pl line 2
+	A::g() called at test-block.pl line 3

Added: branches/upstream/libcarp-always-perl/current/t/098pod-coverage.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/t/098pod-coverage.t?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/t/098pod-coverage.t (added)
+++ branches/upstream/libcarp-always-perl/current/t/098pod-coverage.t Tue Aug 11 02:24:13 2009
@@ -1,0 +1,8 @@
+#perl -T 
+
+use Test::More;
+
+eval "use Test::Pod::Coverage 1.04";
+plan skip_all => "Test::Pod::Coverage 1.04 required for testing POD coverage" if $@;
+
+all_pod_coverage_ok();

Added: branches/upstream/libcarp-always-perl/current/t/099pod.t
URL: http://svn.debian.org/wsvn/pkg-perl/branches/upstream/libcarp-always-perl/current/t/099pod.t?rev=41652&op=file
==============================================================================
--- branches/upstream/libcarp-always-perl/current/t/099pod.t (added)
+++ branches/upstream/libcarp-always-perl/current/t/099pod.t Tue Aug 11 02:24:13 2009
@@ -1,0 +1,8 @@
+#perl -T 
+
+use strict;
+use Test::More;
+eval "use Test::Pod 1.18";
+plan skip_all => "Test::Pod 1.18 required for testing POD" if $@;
+
+all_pod_files_ok(all_pod_files("."));




More information about the Pkg-perl-cvs-commits mailing list