Skip to content

Commit

Permalink
Hash-MoreUtils: update dist to modernized tooling
Browse files Browse the repository at this point in the history
Merge my infrastructure for having suitable distributions from File::ConfigDir

Signed-off-by: Jens Rehsack <[email protected]>
  • Loading branch information
rehsack committed May 4, 2017
1 parent aedea8a commit effd212
Show file tree
Hide file tree
Showing 9 changed files with 295 additions and 39 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ pm_to_blib
*.bak
*.swp
MANIFEST
nytprof*
Hash-MoreUtils-*
19 changes: 19 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
install:
- cpanm --notest --skip-satisfied App::mymeta_requires
- perl Makefile.PL
- make manifest
- mymeta-requires --runtime --build --test --configure --develop --recommends --suggests | cpanm
language: perl
perl:
- "5.24"
- "5.22"
- "5.21"
- "5.20-extras"
- "5.20"
- "5.18-extras"
- "5.18"
- "5.16"
- "5.14"
- "5.12"
- "5.10"
22 changes: 0 additions & 22 deletions Build.PL

This file was deleted.

3 changes: 2 additions & 1 deletion MANIFEST
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
Build.PL
Changes
lib/Hash/MoreUtils.pm
Makefile.PL
MANIFEST
MANIFEST.SKIP
META.json
META.yml
README
Expand Down
41 changes: 26 additions & 15 deletions MANIFEST.SKIP
Original file line number Diff line number Diff line change
@@ -1,22 +1,33 @@
\B\.svn\b
\B\.git\b
\.gitignore$
.travis.yml
\.[Bb][Aa][Kk]$
\.orig$
\.rej$
\.old$
\..*sw[po]
.*~
Makefile$
\.project
\bblib\b
pm_to_blib
.*\.csv
MANIFEST.SKIP
MYMETA.*
^_build/.*
\.tdy$
\.tmp$
\..*swp
^Makefile$
^Build$
^Build\.bat$
^Hash-MoreUtils-.*
\.gitignore
\bxt\b/
nytprof.*
\.Inline/.*
_Inline/.*
\.bak$
\.tar$
\.tgz$
\.tar\.gz$
^mess/
^tmp/
^testdata/
^blib/
^sandbox/
^pm_to_blib$
^_build/.*
~$
.*\.planner
^\..*
Hash-MoreUtils-.*
\bxt
^MYMETA\.json$
^MYMETA\..*$
127 changes: 127 additions & 0 deletions Makefile.PL
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
use strict;
use warnings;

use 5.008001;

use ExtUtils::MakeMaker;

my %RUN_DEPS = (
'Carp' => 0,
'File::Basename' => 0,
'File::Path' => '2.00',
'File::Spec' => 0,
'FindBin' => 0,
);
my %CONFIGURE_DEPS = (
'ExtUtils::MakeMaker' => 0,
);
my %BUILD_DEPS = ();

my %TEST_DEPS = (
'Test::More' => 0.90,
);

WriteMakefile1(
MIN_PERL_VERSION => '5.008001',
META_ADD => {
'meta-spec' => { version => 2 },
resources => {
homepage => 'https://metacpan.org/release/Hash-MoreUtils',
repository => {
url => 'https://github.com:perl5-utils/Hash-MoreUtils.git',
web => 'https://github.com/perl5-utils/Hash-MoreUtils',
type => 'git',
},
bugtracker => {
web => 'http://rt.cpan.org/Public/Dist/Display.html?Name=Hash-MoreUtils',
mailto => '[email protected]',
},
license => 'http://dev.perl.org/licenses/',
},
prereqs => {
develop => {
requires => {
'Test::CPAN::Changes' => 0,
'Test::CheckManifest' => 0,
'Module::CPANTS::Analyse' => '0.96',
'Test::Kwalitee' => 0,
'Test::Pod' => 0,
'Test::Pod::Coverage' => 0,
'Test::Pod::Spelling::CommonMistakes' => 0,
'Test::Spelling' => 0,
},
},
configure => {
requires => {%CONFIGURE_DEPS},
},
build => { requires => {%BUILD_DEPS} },
test => { requires => {%TEST_DEPS} },
runtime => {
recommends => {
'File::HomeDir' => '0.50',
'List::MoreUtils' => '0.22',
},
requires => {
%RUN_DEPS,
perl => '5.8.1',
},
},
},
},
NAME => 'Hash::MoreUtils',
VERSION_FROM => 'lib/Hash/MoreUtils.pm',
ABSTRACT_FROM => 'lib/Hash/MoreUtils.pm',
LICENSE => 'perl',
AUTHOR => [ 'Hans Dieter Pearcey <[email protected]>', 'Jens Rehsack <[email protected]>' ],
CONFIGURE_REQUIRES => \%CONFIGURE_DEPS,
PREREQ_PM => \%RUN_DEPS,
BUILD_REQUIRES => \%BUILD_DEPS,
TEST_REQUIRES => \%TEST_DEPS,
test => { TESTS => 't/*.t xt/*.t' },
);

sub WriteMakefile1
{ # originally 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 ( !exists( $params{LICENSE} ) );
$params{TEST_REQUIRES}
and $eumm_version < 6.6303
and $params{BUILD_REQUIRES} = { %{ $params{BUILD_REQUIRES} || {} }, %{ delete $params{TEST_REQUIRES} } };
#EUMM 6.5502 has problems with BUILD_REQUIRES
$params{BUILD_REQUIRES}
and $eumm_version < 6.5503
and $params{PREREQ_PM} = { %{ $params{PREREQ_PM} || {} }, %{ delete $params{BUILD_REQUIRES} } };
ref $params{AUTHOR}
and "ARRAY" eq ref $params{AUTHOR}
and $eumm_version < 6.5702
and $params{AUTHOR} = join( ", ", @{ $params{AUTHOR} } );
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}{prereqs} if ( $eumm_version < 6.58 );
delete $params{META_ADD}{'meta-spec'} if ( $eumm_version < 6.58 );
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 );

# more or less taken from Moose' Makefile.PL
if ( $params{CONFLICTS} )
{
my $ok = CheckConflicts(%params);
exit(0) if ( $params{PREREQ_FATAL} and not $ok );
my $cpan_smoker = grep { $_ =~ m/(?:CR_SMOKER|CPAN_REPORTER|AUTOMATED_TESTING)/ } keys %ENV;
unless ( $cpan_smoker || $ENV{PERL_MM_USE_DEFAULT} )
{
sleep 4 unless ($ok);
}
delete $params{CONFLICTS};
}

WriteMakefile(%params);
}

13 changes: 13 additions & 0 deletions xt/kwalitee.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!perl

## in a separate test file

use strict;
use warnings;

use Test::More;
use Test::Kwalitee 'kwalitee_ok';

kwalitee_ok();

done_testing;
60 changes: 60 additions & 0 deletions xt/profile.pl
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
#!perl

use strict;
use warnings;

use Hash::MoreUtils qw(:all);

my %h = (a => 1,
b => 2,
c => undef);
my %r;

for (1..10000)
{
%r = slice(\%h, qw(a));

%r = slice(\%h, qw(a d));

%r = slice(\%h);

%r = slice_def(\%h, qw(a c d));

%r = slice_exists(\%h, qw(a c d));

%r = slice_exists(\%h);

%r = slice_def \%h;

%r = slice_grep { $_ gt 'a' } \%h;

%r = slice_grep { $_{$_} && $_{$_} > 1 } \%h;

# slice_map and friends

%r = slice_map(\%h, (a => "A"));

%r = slice_map(\%h, (a => "A", d => "D"));

%r = slice_map(\%h);

%r = slice_def_map(\%h, (a => "A", c => "C", d => "D"));
%r = slice_exists_map(\%h, (a => "A", c => "C", d => "D"));
%r = slice_exists_map(\%h);

%r = slice_def_map \%h;

%r = slice_grep_map { $_ gt 'a' } \%h, (a => "A", b => "B", c => "C");

%r = slice_grep_map { $_{$_} && $_{$_} > 1 } \%h, (a => "A", b => "B", c => "C");

# hashsort and safe_reverse

%r = hashsort \%h;

my %he = slice_def(\%h);
%r = safe_reverse(\%he);

%he = ( a => 1, b => 1 );
my %hec = safe_reverse(\%he);
}
47 changes: 47 additions & 0 deletions xt/spelling.t
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
## in a separate test file
use Test::More;

use Test::Spelling;

add_stopwords(<DATA>);
all_pod_files_spelling_ok();

__END__
AnyData
Zucker
CSV
csv
DBI
DTD
SQL
Dowideit
SvenDowideit
tiedhash
submodule
username
mpeg
CGI
HTMLtable
Ini
NCSA
Fieldnames
weblog
logfiles
API
PODs
adTie
ProtocolEncoding
prettyPrint
Sisk's
TableExtract
Jochen
Wiedmann
Malcom
Persico
Wickline
README
Atomicity
Passwd
myfile
parsers
preassign

0 comments on commit effd212

Please sign in to comment.