From 8c7fd2d536be7f5676522c07be4fa307c2bb9030 Mon Sep 17 00:00:00 2001 From: Timofey Potapov Date: Sun, 13 Oct 2024 17:34:02 +0200 Subject: [PATCH] 1.31 - Improved Build process. --- Build.PL | 39 +++++++++++++++++++++++++++++++-------- Changes | 6 ++++++ README.md | 2 +- lib/e.pm | 6 ++---- 4 files changed, 40 insertions(+), 13 deletions(-) diff --git a/Build.PL b/Build.PL index b26f4c6..1c7e6a4 100755 --- a/Build.PL +++ b/Build.PL @@ -6,16 +6,39 @@ use warnings; use Module::Build; Module::Build->VERSION( '0.4004' ); -sub _readme { - eval { require Pod::Markdown }; - return if $@; - print "Building README\n"; - system "pod2markdown lib/e.pm > README.md"; -} -_readme(); - my $class = Module::Build->subclass( code => q{ + use Cwd qw( cwd ); + + #--------------------------------- + # Build + #--------------------------------- + + sub ACTION_build { + my ($s) = @_; + $s->_readme(); + $s->SUPER::ACTION_build; + } + + # Only for the maintainer on "Build build". + sub _readme { + my ($s) = @_; + return if cwd() !~ m{ / git / perlmy / [^/]+ $ }x; + + my ($installed) = + grep { -x "$_/pod2markdown" } + split /:/, $ENV{PATH}; + return if !$installed; + + print "Building README\n"; + my $lib = $s->{properties}{dist_version_from}; + system "pod2markdown $lib > README.md"; + } + + #--------------------------------- + # Install + #--------------------------------- + sub ACTION_install { my ($s) = @_; $s->SUPER::ACTION_install; diff --git a/Changes b/Changes index 7118761..9fd3b2d 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Revision history for e +================= +1.31 - 2024-10- +================= + +Improved Build.PL. + ================= 1.30 - 2024-09-27 ================= diff --git a/README.md b/README.md index 5f43d65..e82f19e 100644 --- a/README.md +++ b/README.md @@ -26,7 +26,7 @@ ⠹⡽⣾⣿⠹⣿⣆⣾⢯⣿⣿ ⡞ ⠻⣿⣿⣿⠁ ⢠⣿⢏ ⡀ ⡟ ⢀⣴⣿⠃⢁⡼⠁ ⠈ ⠈⠛ ⢻⣿⣧⢸⢟⠶⢾⡇ ⣸⡿⠁ ⢠⣾⡟⢼ ⣷ ⡇ ⣰⠋⠙⠁ ⠈⣿⣻⣾⣦⣇⢸⣇⣀⣶⡿⠁⣀⣀⣾⢿⡇⢸ ⣟⡦⣧⣶⠏ unleashed - ⠸⢿⡍⠛⠻⠿⠿⠿⠋⣠⡾⢋⣾⣏⣸⣷⡸⣇⢰⠟⠛⠻⡄ v1.30 + ⠸⢿⡍⠛⠻⠿⠿⠿⠋⣠⡾⢋⣾⣏⣸⣷⡸⣇⢰⠟⠛⠻⡄ v1.31 ⢻⡄ ⠐⠚⠋⣠⡾⣧⣿⠁⠙⢳⣽⡟ ⠈⠳⢦⣤⣤⣀⣤⡶⠛ ⠈⢿⡆ ⢿⡇ ⠈ ⠈⠓ ⠈ diff --git a/lib/e.pm b/lib/e.pm index 5f4e886..4544eee 100644 --- a/lib/e.pm +++ b/lib/e.pm @@ -30,7 +30,7 @@ package e; ⠹⡽⣾⣿⠹⣿⣆⣾⢯⣿⣿ ⡞ ⠻⣿⣿⣿⠁ ⢠⣿⢏ ⡀ ⡟ ⢀⣴⣿⠃⢁⡼⠁ ⠈ ⠈⠛ ⢻⣿⣧⢸⢟⠶⢾⡇ ⣸⡿⠁ ⢠⣾⡟⢼ ⣷ ⡇ ⣰⠋⠙⠁ ⠈⣿⣻⣾⣦⣇⢸⣇⣀⣶⡿⠁⣀⣀⣾⢿⡇⢸ ⣟⡦⣧⣶⠏ unleashed - ⠸⢿⡍⠛⠻⠿⠿⠿⠋⣠⡾⢋⣾⣏⣸⣷⡸⣇⢰⠟⠛⠻⡄ v1.30 + ⠸⢿⡍⠛⠻⠿⠿⠿⠋⣠⡾⢋⣾⣏⣸⣷⡸⣇⢰⠟⠛⠻⡄ v1.31 ⢻⡄ ⠐⠚⠋⣠⡾⣧⣿⠁⠙⢳⣽⡟ ⠈⠳⢦⣤⣤⣀⣤⡶⠛ ⠈⢿⡆ ⢿⡇ ⠈ ⠈⠓ ⠈ @@ -45,7 +45,7 @@ use 5.006; use strict; use warnings; -our $VERSION = '1.30'; +our $VERSION = '1.31'; =head1 SYNOPSIS @@ -396,8 +396,6 @@ Work with arrays. Turn list into a L object. -=cut - =head3 set Work with sets.