Skip to content

Commit

Permalink
1.06 - Version increase for repl, trace/watch.
Browse files Browse the repository at this point in the history
  • Loading branch information
Timofey Potapov committed May 15, 2024
1 parent a6bf9f8 commit c98c97c
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 19 deletions.
6 changes: 3 additions & 3 deletions Build.PL
Original file line number Diff line number Diff line change
Expand Up @@ -32,14 +32,14 @@ my $builder = $class->new(
requires => {
'perl' => '5.016',
'Sub::Util' => '0',
'Runtime::Debugger' => '0.20',
'Data::Trace' => '0.19',
'Runtime::Debugger' => '1.01',
'Data::Trace' => '1.01',
'Tiny::Prof' => '0',
'Mojolicious' => '0',
'YAML::XS' => '0',
'Data::Printer' => '0',
},
add_to_cleanup => [ 'e-*', 'MANIFEST*.bak', 'README*', 'blib/', ],
add_to_cleanup => [ 'e-*', 'MANIFEST*.bak', 'README*', 'blib/' ],
meta_merge => {
resources => {
bugtracker => 'https://github.com/poti1/e/issues',
Expand Down
6 changes: 6 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
Revision history for e

=================
1.06 - 2024-05-14
=================

Version increase for repl, trace/watch.

=================
1.05 - 2024-05-14
=================
Expand Down
17 changes: 14 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,20 +68,31 @@ Invoke the Tiny::Prof:

perl -Me -e 'prof'

# DESCRIPTION

This module imports many features that make
one-liners and script debugging much faster.

For performance, a simple 'use e' statement
will import nearly no other libraries thereby
making its startup impact quite low.

# SUBROUTINES

## monkey\_patch

insert subroutines into the symbol table.
Insert subroutines into the symbol table.

Extracted from Mojo::Util for performance.

Can be updated once this issue is resolved:
Perhaps can be updated based on the outcome
of this issue:
[https://github.com/mojolicious/mojo/pull/2173](https://github.com/mojolicious/mojo/pull/2173)

## import

Inserts commands into caller's namespace.
These keys will become sub names in the
caller's namespace.

# AUTHOR

Expand Down
37 changes: 24 additions & 13 deletions lib/e.pm
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ e - Unleash the power of e!
=cut

our $VERSION = '1.05';
our $VERSION = '1.06';

=head1 SYNOPSIS
Expand Down Expand Up @@ -80,23 +80,38 @@ Invoke the Tiny::Prof:
perl -Me -e 'prof'
=head1 DESCRIPTION
This module imports many features that make
one-liners and script debugging much faster.
For performance, a simple 'use e' statement
will import nearly no other libraries thereby
making its startup impact quite low.
=cut

=head1 SUBROUTINES
=head2 monkey_patch
insert subroutines into the symbol table.
Insert subroutines into the symbol table.
Extracted from Mojo::Util for performance.
Can be updated once this issue is resolved:
Perhaps can be updated based on the outcome
of this issue:
L<https://github.com/mojolicious/mojo/pull/2173>
=cut

sub monkey_patch {
my ( $class, %patch ) = @_;

require Sub::Util; # Can omit set_subname, but it makes traces nicer.
# Can be omitted, but it makes traces much
# nicer since it adds names to subs.
require Sub::Util;

no strict 'refs';

for ( keys %patch ) {
Expand All @@ -107,7 +122,8 @@ sub monkey_patch {

=head2 import
Inserts commands into caller's namespace.
These keys will become sub names in the
caller's namespace.
=cut

Expand All @@ -121,28 +137,23 @@ sub import {

# Debugging.
repl => sub {

require Runtime::Debugger;
Runtime::Debugger->VERSION( '0.20' )
; # Since not using "use MODULE VERSION".
Runtime::Debugger::repl(
levels_up => 1,
@_,
);
},

# Tracing.
trace => sub { # Stack or var trace.
trace => sub {
require Data::Trace;
Data::Trace->VERSION( '0.19' )
; # Since not using "use MODULE VERSION".
Data::Trace::Trace( @_ );
},

# Alias for trace.
watch => sub { # Stack or var trace.
watch => sub {
require Data::Trace;
Data::Trace->VERSION( '0.19' )
; # Since not using "use MODULE VERSION".
Data::Trace::Trace( @_ );
},

Expand Down

0 comments on commit c98c97c

Please sign in to comment.