From 6eea9b73ab02b7d847a18f9d867b2ee3fe4540ee Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Mon, 13 Mar 2023 20:22:18 -0300 Subject: [PATCH 1/2] Change Fancy::Open to File::Slurp::Affix --- lib/Random/Alpha.pm | 14 +++++++------- lib/Random/Color.pm | 6 +++--- lib/Random/Color/Web.pm | 6 +++--- lib/Random/Dragon.pm | 6 +++--- lib/Random/Food.pm | 8 ++++---- 5 files changed, 20 insertions(+), 20 deletions(-) diff --git a/lib/Random/Alpha.pm b/lib/Random/Alpha.pm index 613db2b..312900b 100644 --- a/lib/Random/Alpha.pm +++ b/lib/Random/Alpha.pm @@ -6,18 +6,18 @@ use Exporter qw(import); use File::ShareDir qw(module_dir); use Fancy::Rand qw(fancy_rand); -use Fancy::Open qw(fancy_open); +use File::Slurp::Affix qw(slurp_affix); our $VERSION = '1.000'; our @EXPORT_OK = qw(random_alpha); my $directory = module_dir('Random::Alpha'); -my @Greek_letters = fancy_open("$directory/Greek_letters.txt"); -my @Greek_upper_ce = fancy_open("$directory/Greek_upper_ce.txt"); -my @Greek_lower_ce = fancy_open("$directory/Greek_lower_ce.txt"); -my @Hebrew_letters = fancy_open("$directory/Hebrew.txt"); -my @Hebrew_ce = fancy_open("$directory/Hebrew_ce.txt"); -my @Hebew_final_ce = fancy_open("$directory/Hebrew_final_ce.txt"); +my @Greek_letters = slurp_affix("$directory/Greek_letters.txt"); +my @Greek_upper_ce = slurp_affix("$directory/Greek_upper_ce.txt"); +my @Greek_lower_ce = slurp_affix("$directory/Greek_lower_ce.txt"); +my @Hebrew_letters = slurp_affix("$directory/Hebrew.txt"); +my @Hebrew_ce = slurp_affix("$directory/Hebrew_ce.txt"); +my @Hebew_final_ce = slurp_affix("$directory/Hebrew_final_ce.txt"); my @consonants = (1,2,3,5,6,7,9,10,11,12,13,15,16,17,18,19,21,22,23,24,25); my @vowels = (0,4,8,14,20); diff --git a/lib/Random/Color.pm b/lib/Random/Color.pm index c6df4f4..b8c74d0 100644 --- a/lib/Random/Color.pm +++ b/lib/Random/Color.pm @@ -6,14 +6,14 @@ use Exporter qw(import); use File::ShareDir qw(module_dir); use Fancy::Rand qw(fancy_rand); -use Fancy::Open qw(fancy_open); +use File::Slurp::Affix qw(slurp_affix); our $VERSION = '1.000'; our @EXPORT_OK = qw(random_color); my $directory = module_dir('Random::Color'); -my @Crayola_crayons = fancy_open("$directory/Crayola_crayon_colors.txt");; -my @MandMs = fancy_open("$directory/MandMs_colors.txt"); +my @Crayola_crayons = slurp_affix("$directory/Crayola_crayon_colors.txt");; +my @MandMs = slurp_affix("$directory/MandMs_colors.txt"); my %colors = ( 'additive primary' => [qw(red green blue)], diff --git a/lib/Random/Color/Web.pm b/lib/Random/Color/Web.pm index 1323707..cbae512 100644 --- a/lib/Random/Color/Web.pm +++ b/lib/Random/Color/Web.pm @@ -6,13 +6,13 @@ use Exporter qw(import); use File::ShareDir qw(module_dir); use Fancy::Rand qw(fancy_rand); -use Fancy::Open qw(fancy_open); +use File::Slurp::Affix qw(slurp_affix); our $VERSION = '1.000'; our @EXPORT_OK = qw(random_web_color); my $directory = module_dir('Random::Color::Web'); -my @css_3 = fancy_open("$directory/css_3.txt"); +my @css_3 = slurp_affix("$directory/css_3.txt"); my %html_colors = ( 'pink' => [qw(mediumvioletred deeppink palevioletred hotpink lightpink pink)], @@ -41,4 +41,4 @@ sub random_web_color { # This module is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See https://dev.perl.org/licenses/artistic.html. # Copyright © 2020, Lady Aleena (aleena@cpan.org). All rights reserved. -1; \ No newline at end of file +1; diff --git a/lib/Random/Dragon.pm b/lib/Random/Dragon.pm index cf12a39..5b4b03f 100644 --- a/lib/Random/Dragon.pm +++ b/lib/Random/Dragon.pm @@ -6,7 +6,7 @@ use Exporter qw(import); use File::ShareDir qw(module_dir); use Fancy::Rand qw(fancy_rand tiny_rand instant_rand); -use Fancy::Open qw(fancy_open); +use File::Slurp::Affix qw(slurp_affix); use Random::Color qw(random_color); use Random::Xanth::Dragon qw(random_Xanth_dragon random_old_Xanth_dragon); use Random::RPG::Monster qw(random_RPG_dragon); @@ -23,8 +23,8 @@ our @EXPORT_OK = qw( ); my $directory = module_dir('Random::Dragon'); -my @DreamWorks_dragons = fancy_open("$directory/DreamWorks_dragons.txt"); -my @Harry_Potter_dragons = fancy_open("$directory/Harry_Potter_dragons.txt"); +my @DreamWorks_dragons = slurp_affix("$directory/DreamWorks_dragons.txt"); +my @Harry_Potter_dragons = slurp_affix("$directory/Harry_Potter_dragons.txt"); my $dragons; $dragons->{'DreamWorks'} = [@DreamWorks_dragons]; diff --git a/lib/Random/Food.pm b/lib/Random/Food.pm index 2eed70e..204512b 100644 --- a/lib/Random/Food.pm +++ b/lib/Random/Food.pm @@ -7,15 +7,15 @@ use File::ShareDir qw(module_dir); use Fancy::Rand qw(fancy_rand); use Fancy::Map qw(fancy_map); -use Fancy::Open qw(fancy_open); +use File::Slurp::Affix qw(slurp_affix); our $VERSION = '1.000'; our @EXPORT_OK = qw(random_food random_drink); my $directory = module_dir('Random::Food'); -my @Klondike_flavors = fancy_open("$directory/Klondike_flavors.txt", { 'after' => " Klondike bar" }); -my @Kool_Aid_flavors = fancy_open("$directory/Kool-Aid_flavors.txt", { 'after' => " Kool-Aid" }); -my @MandMs_flavors = fancy_open("$directory/MandMs_flavors.txt", { 'after' => " M&M" }); +my @Klondike_flavors = slurp_affix("$directory/Klondike_flavors.txt", { 'after' => " Klondike bar" }); +my @Kool_Aid_flavors = slurp_affix("$directory/Kool-Aid_flavors.txt", { 'after' => " Kool-Aid" }); +my @MandMs_flavors = slurp_affix("$directory/MandMs_flavors.txt", { 'after' => " M&M" }); my %foods = ( 'fruits' => [qw(apple apricot banana blueberry cherry cranberry grape grapefruit lemon lime orange peach pear plum raspberry strawberry tomato)], From f97da07f63dfe52ee397a58382a534749dd96cce Mon Sep 17 00:00:00 2001 From: Timothy Legge Date: Mon, 13 Mar 2023 20:31:24 -0300 Subject: [PATCH 2/2] Time::Duration::AddTimes exports total_duration --- t/00-Time-Duration-AddTimes.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/t/00-Time-Duration-AddTimes.t b/t/00-Time-Duration-AddTimes.t index 178dc60..48c0ce6 100644 --- a/t/00-Time-Duration-AddTimes.t +++ b/t/00-Time-Duration-AddTimes.t @@ -4,7 +4,7 @@ use warnings; use Test::More; BEGIN { - use_ok( 'Time::Duration::AddTimes', qw(duration) ) + use_ok( 'Time::Duration::AddTimes', qw(total_duration) ) or BAIL_OUT("Time::Duration::AddTimes is not available\n"); }