App-perlimports

 view release on metacpan or  search on metacpan

lib/App/perlimports/Include.pm  view on Meta::CPAN

package App::perlimports::Include;

use Moo;

our $VERSION = '0.000053';

use Data::Dumper qw( Dumper );
use List::Util   qw( any none uniq );
use Memoize      qw( flush_cache memoize );
use MooX::StrictConstructor;
use PPI::Document               ();
use PPIx::Utils::Classification qw( is_function_call is_perl_builtin );
use Ref::Util                   qw( is_plain_arrayref is_plain_hashref );
use Sub::HandlesVia;
use Try::Tiny       qw( catch try );
use Types::Standard qw(ArrayRef Bool HashRef InstanceOf Maybe Object Str);

with 'App::perlimports::Role::Logger';

memoize('is_function_call');

sub BUILD {
    flush_cache('is_function_call');
}

has _explicit_exports => (
    is          => 'ro',
    isa         => HashRef,
    handles_via => 'Hash',
    handles     => {
        _delete_export         => 'delete',
        _explicit_export_count => 'count',
        _has_explicit_exports  => 'count',
        _import_name           => 'get',
        _is_importable         => 'exists',
    },
    lazy    => 1,
    builder => '_build_explicit_exports',
);

has _document => (
    is       => 'ro',
    isa      => InstanceOf ['App::perlimports::Document'],
    required => 1,
    init_arg => 'document',
);

has _export_inspector => (
    is        => 'ro',
    isa       => InstanceOf ['App::perlimports::ExportInspector'],
    predicate => '_has_export_inspector',     # used in test
    lazy      => 1,
    builder   => '_build_export_inspector',
);

has formatted_ppi_statement => (
    is      => 'ro',
    isa     => InstanceOf ['PPI::Statement::Include'],
    lazy    => 1,
    builder => '_build_formatted_ppi_statement',
);

has _ignored_modules => (
    is        => 'ro',
    isa       => ArrayRef,
    init_arg  => 'ignored_modules',
    predicate => '_has_ignored_modules',
);

has _imports => (
    is      => 'ro',
    isa     => ArrayRef,
    lazy    => 1,

 view all matches for this distribution
 view release on metacpan -  search on metacpan

( run in 0.583 second using v1.00-cache-2.02-grep-82fe00e-cpan-2c419f77a38b )