The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v5.030.
use strict;
use warnings;

use 5.010001;

use ExtUtils::MakeMaker;



my %WriteMakefileArgs = (
  "ABSTRACT" => "Create nice formatted tables using extended ASCII and ANSI colors",
  "AUTHOR" => "perlancar <perlancar\@cpan.org>",
  "CONFIGURE_REQUIRES" => {
    "ExtUtils::MakeMaker" => 0,
    "Perl::osnames" => "0.09"
  },
  "DISTNAME" => "Text-ANSITable",
  "EXE_FILES" => [
    "bin/ansitable-list-color-themes",
    "bin/ansitable-list-style-sets",
    "bin/ansitable-list-border-styles"
  ],
  "LICENSE" => "perl",
  "MIN_PERL_VERSION" => "5.010001",
  "NAME" => "Text::ANSITable",
  "PREREQ_PM" => {
    "Border::Style::Role" => 0,
    "Color::RGB::Util" => 0,
    "Color::Theme::Role::ANSI" => 0,
    "Data::Unixish::ANSI" => "0.02",
    "Data::Unixish::Apply" => "1.33",
    "DateTime" => 0,
    "Function::Fallback::CoreOrPP" => 0,
    "JSON" => 0,
    "Log::Any" => 0,
    "Module::List" => 0,
    "Moo" => 0,
    "Package::MoreUtil" => 0,
    "Parse::VarName" => 0,
    "Term::App::Role::Attrs" => 0,
    "Text::ANSI::Util" => "0.08",
    "experimental" => 0,
    "namespace::clean" => 0
  },
  "TEST_REQUIRES" => {
    "File::Spec" => 0,
    "IO::Handle" => 0,
    "IPC::Open3" => 0,
    "Test::Exception" => 0,
    "Test::More" => "0.98"
  },
  "VERSION" => "0.40",
  "test" => {
    "TESTS" => "t/*.t"
  }
);


my %FallbackPrereqs = (
  "Border::Style::Role" => 0,
  "Color::RGB::Util" => 0,
  "Color::Theme::Role::ANSI" => 0,
  "Data::Unixish::ANSI" => "0.02",
  "Data::Unixish::Apply" => "1.33",
  "DateTime" => 0,
  "ExtUtils::MakeMaker" => 0,
  "File::Spec" => 0,
  "Function::Fallback::CoreOrPP" => 0,
  "IO::Handle" => 0,
  "IPC::Open3" => 0,
  "JSON" => 0,
  "Log::Any" => 0,
  "Module::List" => 0,
  "Moo" => 0,
  "Package::MoreUtil" => 0,
  "Parse::VarName" => 0,
  "Perl::osnames" => "0.09",
  "Term::App::Role::Attrs" => 0,
  "Test::Exception" => 0,
  "Test::More" => "0.98",
  "Text::ANSI::Util" => "0.08",
  "experimental" => 0,
  "namespace::clean" => 0
);


unless ( eval { ExtUtils::MakeMaker->VERSION(6.63_03) } ) {
  delete $WriteMakefileArgs{TEST_REQUIRES};
  delete $WriteMakefileArgs{BUILD_REQUIRES};
  $WriteMakefileArgs{PREREQ_PM} = \%FallbackPrereqs;
}

delete $WriteMakefileArgs{CONFIGURE_REQUIRES}
  unless eval { ExtUtils::MakeMaker->VERSION(6.52) };

WriteMakefile(%WriteMakefileArgs);




# modify generated Makefile to generate shell completion scripts. this piece
# is generated by Dist::Zilla::Plugin::GenShellCompletion version 0.07.
GEN_SHELL_COMPLETION:
{
    use Perl::osnames 0.09 qw(is_posix);
    last unless is_posix();

    print "Modifying Makefile to generate shell completion on install\n";
    open my($fh), "<", "Makefile" or die "Can't open generated Makefile: $!";
    my $content = do { local $/; ~~<$fh> };

    $content =~ s/^(install :: pure_install doc_install)/$1 comp_install/m
        or die "Can't find pattern in Makefile (1)";

    $content =~ s/^(uninstall :: .+)/$1 comp_uninstall/m
        or die "Can't find pattern in Makefile (2)";

    $content .= qq|\ncomp_install :\n\t| .
        q|$(PERLRUN) -E'if(eval { require App::shcompgen; 1 }) { system "shcompgen", "--verbose", "generate", "--replace", @ARGV }' -- $(EXE_FILES)| .
        qq|\n\n|;

    $content .= qq|\ncomp_uninstall :\n\t| .
        q|$(PERLRUN) -E'if(eval { require App::shcompgen; 1 }) { system "shcompgen", "--verbose", "remove", @ARGV }' -- $(EXE_FILES)| .
        qq|\n\n|;

    open $fh, ">", "Makefile" or die "Can't write modified Makefile: $!";
    print $fh $content;
}