Acme-CPANModules-TextTable

 view release on metacpan or  search on metacpan

lib/Acme/CPANModules/TextTable.pm  view on Meta::CPAN

our $DATE = '2023-10-31'; # DATE
our $DIST = 'Acme-CPANModules-TextTable'; # DIST
our $VERSION = '0.016'; # VERSION

sub _make_table {
    my ($cols, $rows, $celltext) = @_;
    my $res = [];
    push @$res, [];
    for (0..$cols-1) { $res->[0][$_] = "col" . ($_+1) }
    for my $row (1..$rows) {
        push @$res, [ map { $celltext // "row$row.$_" } 1..$cols ];
    }
    $res;
}

our $LIST = {
    summary => 'List of modules that generate text tables',
    description => <<'_',

Currently excluded from this list are:

lib/Acme/CPANModules/TextTable.pm  view on Meta::CPAN

            module => 'Text::SimpleTable',
            description => <<'_',

As its name implies, a simple table-generating module with minimal documentation
and a few choices or border characters. You have to set the width of all columns
manually.

_
            bench_code => sub {
                my ($table) = @_;
                my @colspec = map {[9, $_]} @{ $table->[0] };
                my $ts = Text::SimpleTable->new(@colspec);
                for (1 .. $#{$table}) { $ts->row(@{ $table->[$_] }) }
                $ts->draw;
            },
            features => {
                align_cell     => {value=>0},
                align_column   => {value=>0},
                align_row      => {value=>0},
                box_char       => {value=>0},
                color_data     => {value=>0},

lib/Acme/CPANModules/TextTable.pm  view on Meta::CPAN

        {
            module => 'Text::MarkdownTable',
            bench_code => sub {
                my ($table) = @_;
                my $out = "";
                my $t = Text::MarkdownTable->new(file => \$out);
                my $fields = $table->[0];
                foreach (1..@$table-1) {
                    my $row = $table->[$_];
                    $t->add( {
                        map { $fields->[$_] => $row->[$_] } 0..@$fields-1
                    });
                }
                $t->done;
                $out;
            },
            features => {
                wide_char_data => 0,
                color_data =>  0,
                box_char => 0,
                multiline_data => {value=>0, summary=>'Newlines stripped'},

lib/Acme/CPANModules_ScenarioR/TextTable.pm  view on Meta::CPAN

## no critic
package Acme::CPANModules_ScenarioR::TextTable;

our $VERSION = 0.016; # VERSION

our $results = do{my$var=[[200,"OK",[{_name=>"participant=Text::UnicodeBox::Table",_succinct_name=>"Text::UnicodeBox::Table",errors=>0.0024,participant=>"Text::UnicodeBox::Table",pct_faster_vs_slowest=>0,pct_slower_vs_fastest=>365.666666666667,rate=>...

1;
# ABSTRACT: List of modules that generate text tables

=head1 DESCRIPTION

This module is automatically generated by Pod::Weaver::Plugin::Bencher::Scenario during distribution build.

A Acme::CPANModules_ScenarioR::* module contains the raw result of sample benchmark and might be useful for some stuffs later.

t/00-compile.t  view on Meta::CPAN

use IO::Handle;

open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!";

my @warnings;
for my $lib (@module_files)
{
    # see L<perlfaq8/How can I capture STDERR from an external command?>
    my $stderr = IO::Handle->new;

    diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} }
            $^X, @switches, '-e', "require q[$lib]"))
        if $ENV{PERL_COMPILE_TEST_DEBUG};

    my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]");
    binmode $stderr, ':crlf' if $^O eq 'MSWin32';
    my @_warnings = <$stderr>;
    waitpid($pid, 0);
    is($?, 0, "$lib loaded ok");

    shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/



( run in 0.920 second using v1.01-cache-2.11-cpan-49f99fa48dc )