Developer-Dashboard

 view release on metacpan or  search on metacpan

lib/Developer/Dashboard/PageRuntime.pm  view on Meta::CPAN

# _run_saved_ajax_perl_file($path)
# Executes one saved Perl Ajax file through the in-module bootstrap wrapper so
# Windows does not have to carry a multi-line `perl -e` payload through the
# native process command line.
# Input: saved Ajax Perl file path string.
# Output: true value after the wrapped file has been evaluated.
sub _run_saved_ajax_perl_file {
    my ( $class, $path ) = @_;
    die "Missing saved ajax Perl file path\n" if !defined $path || $path eq '';
    my $wrapper = $class->_saved_ajax_perl_wrapper;
    local @ARGV = ($path);
    eval $wrapper;
    die $@ if $@;
    return 1;
}

# _code_header($state)
# Builds the older lexical stash header injected before each CODE block.
# Input: mutable stash hash reference.
# Output: Perl source string.
sub _code_header {

script/check-all-metric-coverage  view on Meta::CPAN

# Purpose: classify a Devel::Cover text report arriving on standard input.
# Input: the raw @ARGV list; only --database is accepted, naming the coverage
#        database to sniff when an instrument failure has to be explained.
# Output: an exit code - 0 all four metrics at 100.0, 1 a genuine shortfall,
#         2 the report could not be read, 3 the instrument could not read its
#         own database.
sub main {
    my @argv = @_;

    my $database = 'cover_db';
    local @ARGV = @argv;
    GetOptions( 'database=s' => \$database )
        or return _unreadable('unrecognized option; only --database is accepted');
    return _unreadable( 'unexpected argument: ' . join ' ', @ARGV ) if @ARGV;

    my @lines = <STDIN>;

    # Echo the report first and flush it, so the verdict written to standard
    # error cannot appear above the table it is a verdict about. Standard output
    # is block-buffered whenever this runs in a pipeline, which is always.
    local $| = 1;

script/coverage-gate  view on Meta::CPAN

#         instrument could not read its own database, 4 another gate already
#         holds the database and this run refused rather than corrupt it, 5 the
#         tree moved while the suite ran so the number describes no single state
#         of it.
sub main {
    my @argv = @_;

    my $database = 'cover_db';
    my ( $dry_run, $help ) = ( 0, 0 );

    local @ARGV = @argv;
    GetOptions(
        'database=s' => \$database,
        'dry-run'    => \$dry_run,
        'help'       => \$help,
    ) or return _usage('unrecognized option');

    if ($help) {
        print _usage_text();
        return EXIT_CLEAN;
    }

script/cpan-audit-declared-chain  view on Meta::CPAN

# Output: an exit code - 0 clean, 1 at least one permitted vulnerable
#         resolution, 2 the gate could not audit anything and refuses to
#         report a clean result it did not establish.
sub main {
    my @argv = @_;

    my $repo_root = File::Spec->rel2abs( File::Spec->catdir( dirname(__FILE__), File::Spec->updir ) );
    my $cpanfile  = File::Spec->catfile( $repo_root, 'cpanfile' );
    my $exclusions = File::Spec->catfile( $repo_root, 'cpan-audit-exclusions.txt' );

    local @ARGV = @argv;
    GetOptions(
        'cpanfile=s'     => \$cpanfile,
        'exclude-file=s' => \$exclusions,
    ) or return _usage('unrecognized option');
    my @positional = @ARGV;

    return _usage('exactly one Perl library root is required')
        if @positional != 1;
    my $perl5_root = $positional[0];
    return _usage("not a directory: $perl5_root") if !-d $perl5_root;

t/94-dockercompose-coverage.t  view on Meta::CPAN

      or diag( explain \@lines );
    like( $lines[0], qr/(?:^| )config$/, 'first invocation is the materialize-via-config call' );
    ok( ( grep { /-f / } $lines[0] ), 'the materialize call carries the original multi -f layers' )
      or diag( explain \@lines );

    my $final_call = $lines[-1];
    my @f_flags = ( $final_call =~ /-f (\S+)/g );
    is( scalar(@f_flags), 1, 'the executed call passes exactly one -f, pointing at the merged file' )
      or diag( explain \@lines );
    ok( -f $f_flags[0], 'the single -f file the executed call names actually exists on disk' );
    my $merged_content = do { local ( @ARGV, $/ ) = $f_flags[0]; <> };
    like( $merged_content, qr/merged-marker/, 'the merged file holds the materialized config, not a raw layer file' );
    like( $final_call, qr/ app$/, 'the executed call still carries the original passthrough args (app)' );
}

# Operational commands must retain the invocation Compose root after layered
# files are materialized into a temporary merged file. Without an explicit
# project directory, Compose derives relative paths and the default project
# name from that temporary file instead of the user's local Compose project.
{
    my $old = getcwd();



( run in 1.798 second using v1.01-cache-2.11-cpan-ac8be02dad9 )