From f78c353efe6ee43a22439f41a70d3c0e3dc4b03b Mon Sep 17 00:00:00 2001 From: Valery Kalesnik Date: Tue, 3 Aug 2021 12:17:51 -0700 Subject: [PATCH] Convert to Dist::Zilla --- CHANGES => Changes | 2 ++ MANIFEST | 9 ------- Makefile.PL | 55 ------------------------------------------ README | 36 --------------------------- dist.ini | 40 ++++++++++++++++++++++++++++++ lib/Term/UI.pm | 5 +++- lib/Term/UI/History.pm | 11 ++++++++- t/00_load.t | 7 +----- t/01_history.t | 7 +----- t/02_ui.t | 6 +++-- 10 files changed, 62 insertions(+), 116 deletions(-) rename CHANGES => Changes (99%) delete mode 100644 MANIFEST delete mode 100644 Makefile.PL delete mode 100644 README create mode 100644 dist.ini diff --git a/CHANGES b/Changes similarity index 99% rename from CHANGES rename to Changes index 8ff7314..dda4e8f 100644 --- a/CHANGES +++ b/Changes @@ -1,3 +1,5 @@ +{{$NEXT}} + 0.50 Fri 6 Aug 17:52:26 BST 2021 * Fix number of tests to skip (Michal Josef Špaček) diff --git a/MANIFEST b/MANIFEST deleted file mode 100644 index cb05682..0000000 --- a/MANIFEST +++ /dev/null @@ -1,9 +0,0 @@ -CHANGES -lib/Term/UI.pm -lib/Term/UI/History.pm -Makefile.PL -MANIFEST This list of files -README -t/00_load.t -t/01_history.t -t/02_ui.t diff --git a/Makefile.PL b/Makefile.PL deleted file mode 100644 index b7d0687..0000000 --- a/Makefile.PL +++ /dev/null @@ -1,55 +0,0 @@ -use ExtUtils::MakeMaker; -use strict; - -WriteMakefile1( - LICENSE => 'perl', - META_MERGE => { - "meta-spec" => { version => 2 }, - resources => { - repository => { - type => 'git', - web => 'https://github.com/jib/term-ui', - url => 'git://github.com/jib/term-ui.git', - }, - }, - }, - - NAME => 'Term::UI', - VERSION_FROM => 'lib/Term/UI.pm', # finds $VERSION - dist => { COMPRESS => 'gzip -9f', SUFFIX => 'gz' }, - PREREQ_PM => { - 'if' => 0, - 'parent' => 0, - 'Test::More' => 0.31, - 'Params::Check' => 0, - 'Term::ReadLine' => 0, - 'Locale::Maketext::Simple' => 0, - 'Log::Message::Simple' => 0, - }, - INSTALLDIRS => ( $] >= 5.009005 && $] < 5.012 ? 'perl' : 'site' ), - AUTHOR => 'Jos Boumans ', - ABSTRACT => 'User interfaces via Term::ReadLine made easy' -); - -sub WriteMakefile1 { #Written by Alexandr Ciornii, version 0.21. Added by eumm-upgrade. - my %params=@_; - my $eumm_version=$ExtUtils::MakeMaker::VERSION; - $eumm_version=eval $eumm_version; - die "EXTRA_META is deprecated" if exists $params{EXTRA_META}; - die "License not specified" if not exists $params{LICENSE}; - if ($params{BUILD_REQUIRES} and $eumm_version < 6.5503) { - #EUMM 6.5502 has problems with BUILD_REQUIRES - $params{PREREQ_PM}={ %{$params{PREREQ_PM} || {}} , %{$params{BUILD_REQUIRES}} }; - delete $params{BUILD_REQUIRES}; - } - delete $params{CONFIGURE_REQUIRES} if $eumm_version < 6.52; - delete $params{MIN_PERL_VERSION} if $eumm_version < 6.48; - delete $params{META_MERGE} if $eumm_version < 6.46; - delete $params{META_ADD} if $eumm_version < 6.46; - delete $params{LICENSE} if $eumm_version < 6.31; - delete $params{AUTHOR} if $] < 5.005; - delete $params{ABSTRACT_FROM} if $] < 5.005; - delete $params{BINARY_LOCATION} if $] < 5.005; - - WriteMakefile(%params); -} diff --git a/README b/README deleted file mode 100644 index 17de4e5..0000000 --- a/README +++ /dev/null @@ -1,36 +0,0 @@ -This is the README file for Term::UI. - -Please refer to 'perldoc Term::UI' after installation for details. - -##################################################################### - -* Description - -Term::UI provides methods to ask both elaborate questions as well -as simple yes/no questions via a Term::ReadLine interface using a -template. It can also parse options per unix style. - -##################################################################### - -* Installation - -Term::UI follows the standard perl module install process - -perl Makefile.PL -make -make test -make install - -The module uses no C or XS parts, so no c-compiler is required. - -###################################################################### - -AUTHOR - This module by Jos Boumans . - -COPYRIGHT - This module is copyright (c) 2002 Jos Boumans . All - rights reserved. - - This library is free software; you may redistribute and/or modify it - under the same terms as Perl itself. diff --git a/dist.ini b/dist.ini new file mode 100644 index 0000000..5744ec0 --- /dev/null +++ b/dist.ini @@ -0,0 +1,40 @@ +name = Term-UI +author = Chris Williams chris@bingosnet.co.uk +license = Perl_5 +copyright_holder = Chris Williams +copyright_year = 2021 + +version = 0.50 + +[@Basic] + +[AutoPrereqs] +[PodSyntaxTests] +[PodCoverageTests] + +[PkgVersion] +die_on_existing_version = 1 + +[PruneFiles] +match = ^dist.ini +match = ^to_do.txt +match = ~$ +match = ^todo.org + +;[ModuleBuild] + +[NextRelease] +time_zone = UTC + +[PodVersion] + +[MetaJSON] + +[Test::Kwalitee] +;skiptest = has_license_in_source_file + +[MinimumPerl] + +[MetaProvides::Package] + +[DualLife] diff --git a/lib/Term/UI.pm b/lib/Term/UI.pm index d9fad28..78fa509 100644 --- a/lib/Term/UI.pm +++ b/lib/Term/UI.pm @@ -1,9 +1,10 @@ package Term::UI; -$Term::UI::VERSION = '0.50'; + use if $] > 5.017, 'deprecate'; use strict; +use utf8; use warnings; use Carp; @@ -20,6 +21,8 @@ push @Term::ReadLine::Stub::ISA, __PACKAGE__ unless grep { $_ eq __PACKAGE__ } @Term::ReadLine::Stub::ISA; +=encoding utf8 + =pod =head1 NAME diff --git a/lib/Term/UI/History.pm b/lib/Term/UI/History.pm index cf3398a..a868f7d 100644 --- a/lib/Term/UI/History.pm +++ b/lib/Term/UI/History.pm @@ -1,7 +1,8 @@ package Term::UI::History; -$Term::UI::History::VERSION = '0.50'; + use strict; +use utf8; use warnings; use parent @@ -16,6 +17,8 @@ our @EXPORT = qw[ history ]; my $log = Log::Message->new(); +=encoding utf8 + =pod =head1 NAME @@ -68,6 +71,12 @@ sub history { ); } +=head2 history_as_string() + +Retrieve the entire session as a printable string. + +=cut + sub history_as_string { my $class = shift; diff --git a/t/00_load.t b/t/00_load.t index fef12c1..3d3dea1 100755 --- a/t/00_load.t +++ b/t/00_load.t @@ -1,14 +1,9 @@ #!/usr/bin/env perl use strict; +use utf8; use warnings; -BEGIN { - chdir 't' if -d 't'; - use File::Spec; - use lib File::Spec->catdir( qw[.. lib] ); -} - use Test::More 'tests' => 1; my $Class = 'Term::UI'; diff --git a/t/01_history.t b/t/01_history.t index 8e8e685..1195e15 100755 --- a/t/01_history.t +++ b/t/01_history.t @@ -1,14 +1,9 @@ #!/usr/bin/env perl use strict; +use utf8; use warnings; -BEGIN { - chdir 't' if -d 't'; - use File::Spec; - use lib File::Spec->catdir( qw[.. lib] ); -} - use Test::More 'no_plan'; my $Class = 'Term::UI::History'; diff --git a/t/02_ui.t b/t/02_ui.t index 059ad80..892751a 100755 --- a/t/02_ui.t +++ b/t/02_ui.t @@ -3,10 +3,10 @@ ### Term::UI test suite ### use strict; +use utf8; use warnings; -use lib qw[../lib lib]; -use Test::More 'tests' => 23; +use Test::More; use Term::ReadLine (); use_ok( 'Term::UI' ); @@ -194,3 +194,5 @@ my $tmpl = { } } # End SKIP block + +done_testing();