Devel-Examine-Subs
view release on metacpan or search on metacpan
lib/Devel/Examine/Subs/Postprocessor.pm view on Meta::CPAN
}
@last_line_nums = sort {$a<=>$b} @last_line_nums;
return $last_line_nums[-1];
};
}
sub _test {
trace() if $ENV{TRACE};
return sub {
trace() if $ENV{TRACE};
my ($p, $struct) = @_;
return $struct;
};
}
sub objects {
trace() if $ENV{TRACE};
# uses 'subs' post_proc
return sub {
trace() if $ENV{TRACE};
my $p = shift;
my $struct = shift;
my @return;
return if not ref($struct) eq 'ARRAY';
my $search = $p->{search};
if ($search && ! $p->{regex}){
$search = "\Q$search";
}
my $des_sub;
for my $sub (@$struct){
$des_sub
= Devel::Examine::Subs::Sub->new($sub, $sub->{name});
push @return, $des_sub;
}
return \@return;
};
}
sub _vim_placeholder {1;}
1;
__END__
=head1 NAME
Devel::Examine::Subs::Postprocessor - Provides core Pre-Filter callbacks for
=for html
<a href="https://github.com/stevieb9/devel-examine-subs/actions"><img src="https://github.com/stevieb9/devel-examine-subs/workflows/CI/badge.svg"/></a>
<a href='https://coveralls.io/github/stevieb9/devel-examine-subs?branch=master'><img src='https://coveralls.io/repos/stevieb9/devel-examine-subs/badge.svg?branch=master&service=github' alt='Coverage Status' /></a>
Devel::Examine::Subs
=head1 DESCRIPTION
This module generates and supplies the core post-processor module callbacks.
Postprocessors run after the core Processor, and before any Engine is run.
=head1 SYNOPSIS
Post-processors can be daisy chained as text strings that represent a built-in
post-processor, or as callbacks, or both.
See C<Devel::Examine::Subs::_post_proc()> for implementation details.
=head1 METHODS
All methods other than C<exists()> takes an href of configuration data as its
first parameter.
=head2 C<exists('post-processor')>
Verifies whether the post-processor name specified as the string parameter
exists and is valid.
=head2 C<subs()>
Returns an aref of hash refs, each containing info per sub.
=head2 C<file_lines_contain()>
Returns an aref similar to C<subs()>, but includes an array within each sub
href that contains lines that match a search term.
=head2 C<end_of_last_sub()>
Takes data from C<subs()>.
Returns a scalar containing the last line number of the last sub in a file.
=head1 AUTHOR
Steve Bertrand, C<< <steveb at cpan.org> >>
=head1 SUPPORT
You can find documentation for this module with the perldoc command.
perldoc Devel::Examine::Subs
=head1 LICENSE AND COPYRIGHT
Copyright 2016-2017 Steve Bertrand.
This program is free software; you can redistribute it and/or modify it under
the terms of either: the GNU General Public License as published by the Free
Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
=cut
( run in 2.343 seconds using v1.01-cache-2.11-cpan-ceb78f64989 )