summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgregor herrmann <gregoa@debian.org>2021-09-12 19:40:20 +0200
committergregor herrmann <gregoa@debian.org>2021-09-12 19:40:20 +0200
commitab30e312ed7769e1b0ebd9fc72c8b7e6785a2979 (patch)
tree8e18fc466bd4338c50416d92b127552b44fa7697
parentecfcf209b99cb579930debbb01dbc9eb8b9c14e3 (diff)
parentf0aea5f66aeccea157397623aded2c15e13b9765 (diff)
Update upstream source from tag 'upstream/0.38'
Update to upstream version '0.38' with Debian dir c4ea088fd6d947dc3ae1935e540823f5c62de4a6
-rw-r--r--CONTRIBUTING2
-rw-r--r--Changes9
-rw-r--r--LICENSE6
-rw-r--r--META.json2
-rw-r--r--META.yml2
-rw-r--r--Makefile.PL2
-rw-r--r--README30
-rw-r--r--lib/XXX.pm24
-rw-r--r--lib/XXX.pod66
9 files changed, 113 insertions, 30 deletions
diff --git a/CONTRIBUTING b/CONTRIBUTING
index a752c28..a421104 100644
--- a/CONTRIBUTING
+++ b/CONTRIBUTING
@@ -57,4 +57,4 @@ Join the channel. Join the team!
-# This file generated by Zilla-Dist-0.1.4
+# This file generated by Zilla-Dist-0.1.5
diff --git a/Changes b/Changes
index 5bf1df1..01aa0ce 100644
--- a/Changes
+++ b/Changes
@@ -1,3 +1,12 @@
+0.38 Wed 23 Jun 2021 04:39:29 PM PDT
+ - Add `DDD` Enbugger debugger breakpoint invocation function
+
+0.37 Sat 19 Jun 2021 10:49:06 AM PDT
+ - Support calling `->$::XXX` with global - mst++ Devel::Dwarn++
+
+0.36 Fri 18 Jun 2021 05:12:02 PM PDT
+ - Support calling `::XXX` without needing `use XXX;`
+
0.35 Mon Jan 20 15:08:01 PST 2020
- Add Perl schema to YAML::PP dumping
diff --git a/LICENSE b/LICENSE
index 783c15f..3631a3b 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,4 +1,4 @@
-This software is copyright (c) 2020 by Ingy döt Net.
+This software is copyright (c) 2021 by Ingy döt Net.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
@@ -12,7 +12,7 @@ b) the "Artistic License"
--- The GNU General Public License, Version 1, February 1989 ---
-This software is Copyright (c) 2020 by Ingy döt Net.
+This software is Copyright (c) 2021 by Ingy döt Net.
This is free software, licensed under:
@@ -272,7 +272,7 @@ That's all there is to it!
--- The Artistic License 1.0 ---
-This software is Copyright (c) 2020 by Ingy döt Net.
+This software is Copyright (c) 2021 by Ingy döt Net.
This is free software, licensed under:
diff --git a/META.json b/META.json
index 9834a90..77f7cc7 100644
--- a/META.json
+++ b/META.json
@@ -51,7 +51,7 @@
"web" : "https://github.com/ingydotnet/xxx-pm"
}
},
- "version" : "0.35",
+ "version" : "0.38",
"x_generated_by_perl" : "v5.28.0",
"x_serialization_backend" : "Cpanel::JSON::XS version 4.06"
}
diff --git a/META.yml b/META.yml
index b263f67..d8b6854 100644
--- a/META.yml
+++ b/META.yml
@@ -25,6 +25,6 @@ resources:
bugtracker: https://github.com/ingydotnet/xxx-pm/issues
homepage: https://github.com/ingydotnet/xxx-pm
repository: https://github.com/ingydotnet/xxx-pm.git
-version: '0.35'
+version: '0.38'
x_generated_by_perl: v5.28.0
x_serialization_backend: 'YAML::Tiny version 1.73'
diff --git a/Makefile.PL b/Makefile.PL
index 05d64b6..9af66d2 100644
--- a/Makefile.PL
+++ b/Makefile.PL
@@ -19,7 +19,7 @@ my %WriteMakefileArgs = (
"PREREQ_PM" => {
"YAML::PP" => "0.018"
},
- "VERSION" => "0.35",
+ "VERSION" => "0.38",
"test" => {
"TESTS" => "t/*.t"
}
diff --git a/README b/README
index 4a0cbe8..1be4c7b 100644
--- a/README
+++ b/README
@@ -4,7 +4,7 @@ NAME
VERSION
- This document describes XXX version 0.35.
+ This document describes XXX version 0.38.
SYNOPSIS
@@ -61,6 +61,32 @@ FUNCTIONS
mnemonic: You should confess all your sins before you sleep. zzzzzzzz
+ DDD
+
+ DDD will start an interactive debugger session using the Enbugger
+ module. By default it will use the Perl debugger, but you can switch
+ to the fancier Devel::Trepan debugger by setting the enviroment
+ variable PERL_XXX_DEBUGGER=trepan.
+
+ In the debugger session you will be able to both read and modify all
+ variables including lexical variables.
+
+ mnemonic: Debug, Debug, Debug!
+
+USE XXX WITHOUT USE XXX;
+
+ If you export PERL5OPT='-MXXX=global' in your shell environment, then
+ XXX will be always be loaded, and all the functions will also be
+ exported into the main namespace. That means you can call XXX from any
+ package with ::XXX (since :: is a synonym for main::).
+
+ Also XXX will be exported as $::XXX which you can use like this:
+
+ $self->foo->$::WWW->bar;
+
+ This will warn a YAML dump of $self, returning $self so that bar will
+ be called correctly.
+
CONFIGURATION
By default, XXX uses YAML::PP to dump your data. You can change this
@@ -114,7 +140,7 @@ AUTHOR
COPYRIGHT AND LICENSE
- Copyright 2006-2020. Ingy döt Net.
+ Copyright 2006-2021. Ingy döt Net.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
diff --git a/lib/XXX.pm b/lib/XXX.pm
index 7c8b9c4..c9ddc01 100644
--- a/lib/XXX.pm
+++ b/lib/XXX.pm
@@ -1,9 +1,9 @@
use strict; use warnings;
package XXX;
-our $VERSION = '0.35';
+our $VERSION = '0.38';
use base 'Exporter';
-our @EXPORT = qw( WWW XXX YYY ZZZ );
+our @EXPORT = qw( WWW XXX YYY ZZZ DDD );
our $DumpModule = 'YAML::PP';
@@ -25,6 +25,18 @@ sub import {
}
last;
}
+ if (grep /^-?global$/, @args) {
+ *main::WWW = \&WWW;
+ *main::XXX = \&XXX;
+ *main::YYY = \&YYY;
+ *main::ZZZ = \&ZZZ;
+ *main::DDD = \&DDD;
+ $main::WWW = \&WWW;
+ $main::XXX = \&XXX;
+ $main::YYY = \&YYY;
+ $main::ZZZ = \&ZZZ;
+ $main::DDD = \&DDD;
+ }
@_ = ($package);
goto &Exporter::import;
}
@@ -127,4 +139,12 @@ sub ZZZ {
Carp::confess(_xxx_dump(@_));
}
+sub DDD {
+ require Enbugger;
+ my $debugger = $ENV{PERL_XXX_DEBUGGER} || 'perl5db';
+ Enbugger->load_debugger($debugger);
+ @_ = 'Enbugger';
+ goto Enbugger->can('stop');
+}
+
1;
diff --git a/lib/XXX.pod b/lib/XXX.pod
index 04f42c4..3cce5b4 100644
--- a/lib/XXX.pod
+++ b/lib/XXX.pod
@@ -12,7 +12,7 @@ XXX - See Your Data in the Nude
=head1 VERSION
-This document describes L<XXX> version B<0.35>.
+This document describes L<XXX> version B<0.38>.
=for html
<a href="https://travis-ci.org/ingydotnet/xxx-pm"><img src="https://travis-ci.org/ingydotnet/xxx-pm.png" alt="xxx-pm"></a>
@@ -30,37 +30,38 @@ This document describes L<XXX> version B<0.35>.
=head1 DESCRIPTION
-XXX.pm exports a function called XXX that you can put just about anywhere
- in your Perl code to make it die with a YAML dump of the arguments to
- its right.
+C<XXX.pm> exports a function called C<XXX> that you can put just about
+ anywhere in your Perl code to make it die with a YAML dump of the
+ arguments to its right.
The charm of XXX-debugging is that it is easy to type, rarely requires parens
and stands out visually so that you remember to remove it.
-XXX.pm also exports WWW, YYY and ZZZ which do similar debugging things.
+C<XXX.pm> also exports C<WWW>, C<YYY> and C<ZZZ> which do similar
+ debugging things.
=head1 FUNCTIONS
=over
-=item WWW
+=item C<WWW>
-WWW will warn a dump of its arguments, and then return the original arguments.
-This means you can stick it in the middle of expressions.
+C<WWW> will warn a dump of its arguments, and then return the original
+arguments. This means you can stick it in the middle of expressions.
NOTE: If you use WWW with Test::More, it will C<diag()> rather than C<warn()>.
mnemonic: W for warn
-=item XXX
+=item C<XXX>
-XXX will die with a dump of its arguments.
+C<XXX> will die with a dump of its arguments.
mnemonic: XXX == Death, Nudity
-=item YYY
+=item C<YYY>
-YYY will print a dump of its arguments, and then return the original
+C<YYY> will print a dump of its arguments, and then return the original
arguments. This means you can stick it in the middle of expressions.
NOTE: If you use YYY with Test::More, it will C<note()> rather than
@@ -68,17 +69,44 @@ NOTE: If you use YYY with Test::More, it will C<note()> rather than
mnemonic: YYY == Why Why Why??? or YAML YAML YAML
-=item ZZZ
+=item C<ZZZ>
-ZZZ will Carp::confess a dump of its arguments.
+C<ZZZ> will Carp::confess a dump of its arguments.
mnemonic: You should confess all your sins before you sleep. zzzzzzzz
+=item C<DDD>
+
+C<DDD> will start an interactive debugger session using the C<Enbugger>
+module. By default it will use the Perl debugger, but you can switch to the
+fancier Devel::Trepan debugger by setting the enviroment variable
+C<PERL_XXX_DEBUGGER=trepan>.
+
+In the debugger session you will be able to both read and modify all variables
+including lexical variables.
+
+mnemonic: Debug, Debug, Debug!
+
=back
+=head1 USE XXX WITHOUT C<USE XXX;>
+
+If you C<export PERL5OPT='-MXXX=global'> in your shell environment, then
+C<XXX> will be always be loaded, and all the functions will also be exported
+into the C<main> namespace. That means you can call C<XXX> from any package
+with C<::XXX> (since C<::> is a synonym for C<main::>).
+
+Also C<XXX> will be exported as C<$::XXX> which you can use like this:
+
+ $self->foo->$::WWW->bar;
+
+This will warn a YAML dump of C<$self>, returning C<$self> so that C<bar> will
+be called correctly.
+
=head1 CONFIGURATION
-By default, XXX uses YAML::PP to dump your data. You can change this like so:
+By default, C<XXX> uses YAML::PP to dump your data. You can change this like
+so:
use XXX -with => 'Data::Dumper';
use XXX -with => 'Data::Dump';
@@ -108,9 +136,9 @@ the C<$XXX::DumpModule> global variable.
=head1 STACK TRACE LEVEL
-If you call a debugging function that calls XXX for you, XXX will print the
-wrong file and line number. To force XXX to skip a package in the call stack,
-just define the C<XXX_skip> constant like this:
+If you call a debugging function that calls C<XXX> for you, C<XXX> will print
+the wrong file and line number. To force C<XXX> to skip a package in the call
+stack, just define the C<XXX_skip> constant like this:
package MyDebugger;
use constant XXX_skip => 1;
@@ -128,7 +156,7 @@ Ingy döt Net <ingy@cpan.org>
=head1 COPYRIGHT AND LICENSE
-Copyright 2006-2020. Ingy döt Net.
+Copyright 2006-2021. Ingy döt Net.
This program is free software; you can redistribute it and/or modify it under
the same terms as Perl itself.