Progress-Any-0.219/0000775000175000017500000000000013715657656011541 5ustar u1u1Progress-Any-0.219/Makefile.PL0000644000175000017500000000252113715657656013511 0ustar u1u1# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.012. use strict; use warnings; use 5.010001; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "Record progress to any output", "AUTHOR" => "perlancar ", "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0 }, "DISTNAME" => "Progress-Any", "LICENSE" => "perl", "MIN_PERL_VERSION" => "5.010001", "NAME" => "Progress::Any", "PREREQ_PM" => { "Time::Duration" => 0, "Time::HiRes" => 0, "strict" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => "0.98" }, "VERSION" => "0.219", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::Exception" => 0, "Test::More" => "0.98", "Time::Duration" => 0, "Time::HiRes" => 0, "strict" => 0, "warnings" => 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); Progress-Any-0.219/META.yml0000644000175000017500000003307313715657656013016 0ustar u1u1--- abstract: 'Record progress to any output' author: - 'perlancar ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Test::Exception: '0' Test::More: '0.98' configure_requires: ExtUtils::MakeMaker: '0' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010' license: perl meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Progress-Any requires: Time::Duration: '0' Time::HiRes: '0' perl: '5.010001' strict: '0' warnings: '0' resources: bugtracker: https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any homepage: https://metacpan.org/release/Progress-Any repository: git://github.com/perlancar/perl-Progress-Any.git version: '0.219' x_Dist_Zilla: perl: version: '5.030000' plugins: - class: Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease name: '@Author::PERLANCAR/PERLANCAR::CheckPendingRelease' version: '0.001' - class: Dist::Zilla::Plugin::GatherDir config: Dist::Zilla::Plugin::GatherDir: exclude_filename: [] exclude_match: [] follow_symlinks: 0 include_dotfiles: 0 prefix: '' prune_directory: [] root: . name: '@Author::PERLANCAR/@Filter/GatherDir' version: '6.012' - class: Dist::Zilla::Plugin::PruneCruft name: '@Author::PERLANCAR/@Filter/PruneCruft' version: '6.012' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Author::PERLANCAR/@Filter/ManifestSkip' version: '6.012' - class: Dist::Zilla::Plugin::MetaYAML name: '@Author::PERLANCAR/@Filter/MetaYAML' version: '6.012' - class: Dist::Zilla::Plugin::License name: '@Author::PERLANCAR/@Filter/License' version: '6.012' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Author::PERLANCAR/@Filter/PodCoverageTests' version: '6.012' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Author::PERLANCAR/@Filter/PodSyntaxTests' version: '6.012' - class: Dist::Zilla::Plugin::ExtraTests name: '@Author::PERLANCAR/@Filter/ExtraTests' version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/@Filter/ExecDir' version: '6.012' - class: Dist::Zilla::Plugin::ShareDir name: '@Author::PERLANCAR/@Filter/ShareDir' version: '6.012' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Author::PERLANCAR/@Filter/MakeMaker' version: '6.012' - class: Dist::Zilla::Plugin::Manifest name: '@Author::PERLANCAR/@Filter/Manifest' version: '6.012' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Author::PERLANCAR/@Filter/ConfirmRelease' version: '6.012' - class: Dist::Zilla::Plugin::ExecDir name: '@Author::PERLANCAR/ExecDir script' version: '6.012' - class: Dist::Zilla::Plugin::PERLANCAR::BeforeBuild name: '@Author::PERLANCAR/PERLANCAR::BeforeBuild' version: '0.602' - class: Dist::Zilla::Plugin::Rinci::AbstractFromMeta name: '@Author::PERLANCAR/Rinci::AbstractFromMeta' version: '0.10' - class: Dist::Zilla::Plugin::PodnameFromFilename name: '@Author::PERLANCAR/PodnameFromFilename' version: '0.02' - class: Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec name: '@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec' version: '0.060' - class: Dist::Zilla::Plugin::PERLANCAR::MetaResources name: '@Author::PERLANCAR/PERLANCAR::MetaResources' version: '0.040' - class: Dist::Zilla::Plugin::CheckChangeLog name: '@Author::PERLANCAR/CheckChangeLog' version: '0.05' - class: Dist::Zilla::Plugin::CheckMetaResources name: '@Author::PERLANCAR/CheckMetaResources' version: '0.001' - class: Dist::Zilla::Plugin::CheckSelfDependency config: Dist::Zilla::Plugin::CheckSelfDependency: finder: - ':InstallModules' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000036' version: '0.006' name: '@Author::PERLANCAR/CheckSelfDependency' version: '0.011' - class: Dist::Zilla::Plugin::CopyrightYearFromGit name: '@Author::PERLANCAR/CopyrightYearFromGit' version: '0.006' - class: Dist::Zilla::Plugin::IfBuilt name: '@Author::PERLANCAR/IfBuilt' version: '0.03' - class: Dist::Zilla::Plugin::MetaJSON name: '@Author::PERLANCAR/MetaJSON' version: '6.012' - class: Dist::Zilla::Plugin::MetaConfig name: '@Author::PERLANCAR/MetaConfig' version: '6.012' - class: Dist::Zilla::Plugin::PERLANCAR::Authority name: '@Author::PERLANCAR/PERLANCAR::Authority' version: '0.001' - class: Dist::Zilla::Plugin::OurDate name: '@Author::PERLANCAR/OurDate' version: '0.03' - class: Dist::Zilla::Plugin::OurDist name: '@Author::PERLANCAR/OurDist' version: '0.02' - class: Dist::Zilla::Plugin::OurPkgVersion name: '@Author::PERLANCAR/OurPkgVersion' version: '0.21' - class: Dist::Zilla::Plugin::PodWeaver config: Dist::Zilla::Plugin::PodWeaver: finder: - ':InstallModules' - ':ExecFiles' plugins: - class: Pod::Weaver::Plugin::EnsurePod5 name: '@CorePrep/EnsurePod5' version: '4.015' - class: Pod::Weaver::Plugin::H1Nester name: '@CorePrep/H1Nester' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Author::PERLANCAR/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Author::PERLANCAR/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/prelude' version: '4.015' - class: Pod::Weaver::Section::Generic name: SYNOPSIS version: '4.015' - class: Pod::Weaver::Section::Generic name: DESCRIPTION version: '4.015' - class: Pod::Weaver::Section::Generic name: OVERVIEW version: '4.015' - class: Pod::Weaver::Section::Collect name: ATTRIBUTES version: '4.015' - class: Pod::Weaver::Section::Collect name: METHODS version: '4.015' - class: Pod::Weaver::Section::Collect name: FUNCTIONS version: '4.015' - class: Pod::Weaver::Section::Leftovers name: '@Author::PERLANCAR/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Author::PERLANCAR/postlude' version: '4.015' - class: Pod::Weaver::Section::Completion::GetoptLongComplete name: '@Author::PERLANCAR/Completion::GetoptLongComplete' version: '0.08' - class: Pod::Weaver::Section::Completion::GetoptLongSubcommand name: '@Author::PERLANCAR/Completion::GetoptLongSubcommand' version: '0.04' - class: Pod::Weaver::Section::Completion::GetoptLongMore name: '@Author::PERLANCAR/Completion::GetoptLongMore' version: '0.001' - class: Pod::Weaver::Section::Homepage::DefaultCPAN name: '@Author::PERLANCAR/Homepage::DefaultCPAN' version: '0.05' - class: Pod::Weaver::Section::Source::DefaultGitHub name: '@Author::PERLANCAR/Source::DefaultGitHub' version: '0.07' - class: Pod::Weaver::Section::Bugs::DefaultRT name: '@Author::PERLANCAR/Bugs::DefaultRT' version: '0.06' - class: Pod::Weaver::Section::Authors name: '@Author::PERLANCAR/Authors' version: '4.015' - class: Pod::Weaver::Section::Legal name: '@Author::PERLANCAR/Legal' version: '4.015' - class: Pod::Weaver::Plugin::Rinci name: '@Author::PERLANCAR/Rinci' version: '0.780' - class: Pod::Weaver::Plugin::AppendPrepend name: '@Author::PERLANCAR/AppendPrepend' version: '0.01' - class: Pod::Weaver::Plugin::EnsureUniqueSections name: '@Author::PERLANCAR/EnsureUniqueSections' version: '0.163250' - class: Pod::Weaver::Plugin::SingleEncoding name: '@Author::PERLANCAR/SingleEncoding' version: '4.015' - class: Pod::Weaver::Plugin::PERLANCAR::SortSections name: '@Author::PERLANCAR/PERLANCAR::SortSections' version: '0.082' name: '@Author::PERLANCAR/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::PruneFiles name: '@Author::PERLANCAR/PruneFiles' version: '6.012' - class: Dist::Zilla::Plugin::Pod2Readme name: '@Author::PERLANCAR/Pod2Readme' version: '0.004' - class: Dist::Zilla::Plugin::Rinci::AddPrereqs name: '@Author::PERLANCAR/Rinci::AddPrereqs' version: '0.144' - class: Dist::Zilla::Plugin::Rinci::AddToDb name: '@Author::PERLANCAR/Rinci::AddToDb' version: '0.020' - class: Dist::Zilla::Plugin::Rinci::EmbedValidator name: '@Author::PERLANCAR/Rinci::EmbedValidator' version: '0.251' - class: Dist::Zilla::Plugin::SetScriptShebang name: '@Author::PERLANCAR/SetScriptShebang' version: '0.01' - class: Dist::Zilla::Plugin::Test::Compile config: Dist::Zilla::Plugin::Test::Compile: bail_out_on_fail: '0' fail_on_warning: author fake_home: 0 filename: t/00-compile.t module_finder: - ':InstallModules' needs_display: 0 phase: test script_finder: - ':PerlExecFiles' skips: [] switch: [] name: '@Author::PERLANCAR/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::Test::Perl::Critic::Subset config: Dist::Zilla::Plugin::Test::Perl::Critic::Subset: finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' name: '@Author::PERLANCAR/Test::Perl::Critic::Subset' version: 3.001.005 - class: Dist::Zilla::Plugin::Test::Rinci name: '@Author::PERLANCAR/Test::Rinci' version: '0.040' - class: Dist::Zilla::Plugin::StaticInstall config: Dist::Zilla::Plugin::StaticInstall: dry_run: 0 mode: on name: '@Author::PERLANCAR/StaticInstall' version: '0.012' - class: Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest name: '@Author::PERLANCAR/EnsureSQLSchemaVersionedTest' version: '0.03' - class: Dist::Zilla::Plugin::Acme::CPANModules::Blacklist name: '@Author::PERLANCAR/Acme::CPANModules::Blacklist' version: '0.001' - class: Dist::Zilla::Plugin::Prereqs::EnsureVersion name: '@Author::PERLANCAR/Prereqs::EnsureVersion' version: '0.050' - class: Dist::Zilla::Plugin::Prereqs::CheckCircular name: '@Author::PERLANCAR/Prereqs::CheckCircular' version: '0.006' - class: Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple name: '@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple' version: '0.04' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: TestRequires version: '6.012' - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: runtime type: requires name: Prereqs version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.012' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.012' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.012' x_authority: cpan:PERLANCAR x_generated_by_perl: v5.30.0 x_serialization_backend: 'YAML::Tiny version 1.73' x_static_install: 1 Progress-Any-0.219/weaver.ini0000644000175000017500000000002513715657656013526 0ustar u1u1[@Author::PERLANCAR] Progress-Any-0.219/dist.ini0000644000175000017500000000031613715657656013203 0ustar u1u1version=0.219 name=Progress-Any [@Author::PERLANCAR] :version=0.600 [Prereqs / TestRequires] Test::Exception=0 Test::More=0.98 [Prereqs] perl=5.010001 strict=0 warnings=0 Time::Duration=0 Time::HiRes=0 Progress-Any-0.219/META.json0000644000175000017500000005051313715657656013164 0ustar u1u1{ "abstract" : "Record progress to any output", "author" : [ "perlancar " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.012, CPAN::Meta::Converter version 2.150010", "license" : [ "perl_5" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Progress-Any", "prereqs" : { "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::Perl::Critic" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08" } }, "runtime" : { "requires" : { "Time::Duration" : "0", "Time::HiRes" : "0", "perl" : "5.010001", "strict" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::Exception" : "0", "Test::More" : "0.98" } } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any" }, "homepage" : "https://metacpan.org/release/Progress-Any", "repository" : { "type" : "git", "url" : "git://github.com/perlancar/perl-Progress-Any.git", "web" : "https://github.com/perlancar/perl-Progress-Any" } }, "version" : "0.219", "x_Dist_Zilla" : { "perl" : { "version" : "5.030000" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::PERLANCAR::CheckPendingRelease", "name" : "@Author::PERLANCAR/PERLANCAR::CheckPendingRelease", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::GatherDir", "config" : { "Dist::Zilla::Plugin::GatherDir" : { "exclude_filename" : [], "exclude_match" : [], "follow_symlinks" : 0, "include_dotfiles" : 0, "prefix" : "", "prune_directory" : [], "root" : "." } }, "name" : "@Author::PERLANCAR/@Filter/GatherDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Author::PERLANCAR/@Filter/PruneCruft", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Author::PERLANCAR/@Filter/ManifestSkip", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Author::PERLANCAR/@Filter/MetaYAML", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::License", "name" : "@Author::PERLANCAR/@Filter/License", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Author::PERLANCAR/@Filter/PodCoverageTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Author::PERLANCAR/@Filter/PodSyntaxTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExtraTests", "name" : "@Author::PERLANCAR/@Filter/ExtraTests", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/@Filter/ExecDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Author::PERLANCAR/@Filter/ShareDir", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Author::PERLANCAR/@Filter/MakeMaker", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Author::PERLANCAR/@Filter/Manifest", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Author::PERLANCAR/@Filter/ConfirmRelease", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Author::PERLANCAR/ExecDir script", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::BeforeBuild", "name" : "@Author::PERLANCAR/PERLANCAR::BeforeBuild", "version" : "0.602" }, { "class" : "Dist::Zilla::Plugin::Rinci::AbstractFromMeta", "name" : "@Author::PERLANCAR/Rinci::AbstractFromMeta", "version" : "0.10" }, { "class" : "Dist::Zilla::Plugin::PodnameFromFilename", "name" : "@Author::PERLANCAR/PodnameFromFilename", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::EnsurePrereqToSpec", "name" : "@Author::PERLANCAR/PERLANCAR::EnsurePrereqToSpec", "version" : "0.060" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::MetaResources", "name" : "@Author::PERLANCAR/PERLANCAR::MetaResources", "version" : "0.040" }, { "class" : "Dist::Zilla::Plugin::CheckChangeLog", "name" : "@Author::PERLANCAR/CheckChangeLog", "version" : "0.05" }, { "class" : "Dist::Zilla::Plugin::CheckMetaResources", "name" : "@Author::PERLANCAR/CheckMetaResources", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::CheckSelfDependency", "config" : { "Dist::Zilla::Plugin::CheckSelfDependency" : { "finder" : [ ":InstallModules" ] }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000036", "version" : "0.006" } }, "name" : "@Author::PERLANCAR/CheckSelfDependency", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::CopyrightYearFromGit", "name" : "@Author::PERLANCAR/CopyrightYearFromGit", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::IfBuilt", "name" : "@Author::PERLANCAR/IfBuilt", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Author::PERLANCAR/MetaJSON", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Author::PERLANCAR/MetaConfig", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::PERLANCAR::Authority", "name" : "@Author::PERLANCAR/PERLANCAR::Authority", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::OurDate", "name" : "@Author::PERLANCAR/OurDate", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::OurDist", "name" : "@Author::PERLANCAR/OurDist", "version" : "0.02" }, { "class" : "Dist::Zilla::Plugin::OurPkgVersion", "name" : "@Author::PERLANCAR/OurPkgVersion", "version" : "0.21" }, { "class" : "Dist::Zilla::Plugin::PodWeaver", "config" : { "Dist::Zilla::Plugin::PodWeaver" : { "finder" : [ ":InstallModules", ":ExecFiles" ], "plugins" : [ { "class" : "Pod::Weaver::Plugin::EnsurePod5", "name" : "@CorePrep/EnsurePod5", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::H1Nester", "name" : "@CorePrep/H1Nester", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Author::PERLANCAR/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Author::PERLANCAR/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/prelude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "SYNOPSIS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "DESCRIPTION", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Generic", "name" : "OVERVIEW", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "ATTRIBUTES", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "METHODS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Collect", "name" : "FUNCTIONS", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Leftovers", "name" : "@Author::PERLANCAR/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Author::PERLANCAR/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongComplete", "name" : "@Author::PERLANCAR/Completion::GetoptLongComplete", "version" : "0.08" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongSubcommand", "name" : "@Author::PERLANCAR/Completion::GetoptLongSubcommand", "version" : "0.04" }, { "class" : "Pod::Weaver::Section::Completion::GetoptLongMore", "name" : "@Author::PERLANCAR/Completion::GetoptLongMore", "version" : "0.001" }, { "class" : "Pod::Weaver::Section::Homepage::DefaultCPAN", "name" : "@Author::PERLANCAR/Homepage::DefaultCPAN", "version" : "0.05" }, { "class" : "Pod::Weaver::Section::Source::DefaultGitHub", "name" : "@Author::PERLANCAR/Source::DefaultGitHub", "version" : "0.07" }, { "class" : "Pod::Weaver::Section::Bugs::DefaultRT", "name" : "@Author::PERLANCAR/Bugs::DefaultRT", "version" : "0.06" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Author::PERLANCAR/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Author::PERLANCAR/Legal", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::Rinci", "name" : "@Author::PERLANCAR/Rinci", "version" : "0.780" }, { "class" : "Pod::Weaver::Plugin::AppendPrepend", "name" : "@Author::PERLANCAR/AppendPrepend", "version" : "0.01" }, { "class" : "Pod::Weaver::Plugin::EnsureUniqueSections", "name" : "@Author::PERLANCAR/EnsureUniqueSections", "version" : "0.163250" }, { "class" : "Pod::Weaver::Plugin::SingleEncoding", "name" : "@Author::PERLANCAR/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Plugin::PERLANCAR::SortSections", "name" : "@Author::PERLANCAR/PERLANCAR::SortSections", "version" : "0.082" } ] } }, "name" : "@Author::PERLANCAR/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::PruneFiles", "name" : "@Author::PERLANCAR/PruneFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Pod2Readme", "name" : "@Author::PERLANCAR/Pod2Readme", "version" : "0.004" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddPrereqs", "name" : "@Author::PERLANCAR/Rinci::AddPrereqs", "version" : "0.144" }, { "class" : "Dist::Zilla::Plugin::Rinci::AddToDb", "name" : "@Author::PERLANCAR/Rinci::AddToDb", "version" : "0.020" }, { "class" : "Dist::Zilla::Plugin::Rinci::EmbedValidator", "name" : "@Author::PERLANCAR/Rinci::EmbedValidator", "version" : "0.251" }, { "class" : "Dist::Zilla::Plugin::SetScriptShebang", "name" : "@Author::PERLANCAR/SetScriptShebang", "version" : "0.01" }, { "class" : "Dist::Zilla::Plugin::Test::Compile", "config" : { "Dist::Zilla::Plugin::Test::Compile" : { "bail_out_on_fail" : 0, "fail_on_warning" : "author", "fake_home" : 0, "filename" : "t/00-compile.t", "module_finder" : [ ":InstallModules" ], "needs_display" : 0, "phase" : "test", "script_finder" : [ ":PerlExecFiles" ], "skips" : [], "switch" : [] } }, "name" : "@Author::PERLANCAR/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Test::Perl::Critic::Subset", "config" : { "Dist::Zilla::Plugin::Test::Perl::Critic::Subset" : { "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ] } }, "name" : "@Author::PERLANCAR/Test::Perl::Critic::Subset", "version" : "3.001.005" }, { "class" : "Dist::Zilla::Plugin::Test::Rinci", "name" : "@Author::PERLANCAR/Test::Rinci", "version" : "0.040" }, { "class" : "Dist::Zilla::Plugin::StaticInstall", "config" : { "Dist::Zilla::Plugin::StaticInstall" : { "dry_run" : 0, "mode" : "on" } }, "name" : "@Author::PERLANCAR/StaticInstall", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::EnsureSQLSchemaVersionedTest", "name" : "@Author::PERLANCAR/EnsureSQLSchemaVersionedTest", "version" : "0.03" }, { "class" : "Dist::Zilla::Plugin::Acme::CPANModules::Blacklist", "name" : "@Author::PERLANCAR/Acme::CPANModules::Blacklist", "version" : "0.001" }, { "class" : "Dist::Zilla::Plugin::Prereqs::EnsureVersion", "name" : "@Author::PERLANCAR/Prereqs::EnsureVersion", "version" : "0.050" }, { "class" : "Dist::Zilla::Plugin::Prereqs::CheckCircular", "name" : "@Author::PERLANCAR/Prereqs::CheckCircular", "version" : "0.006" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN::WWWPAUSESimple", "name" : "@Author::PERLANCAR/UploadToCPAN::WWWPAUSESimple", "version" : "0.04" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "TestRequires", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "runtime", "type" : "requires" } }, "name" : "Prereqs", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.012" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.012" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.012" } }, "x_authority" : "cpan:PERLANCAR", "x_generated_by_perl" : "v5.30.0", "x_serialization_backend" : "Cpanel::JSON::XS version 4.12", "x_static_install" : 1 } Progress-Any-0.219/t/0000775000175000017500000000000013715657656012004 5ustar u1u1Progress-Any-0.219/t/author-pod-syntax.t0000644000175000017500000000045413715657656015600 0ustar u1u1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodSyntaxTests. use strict; use warnings; use Test::More; use Test::Pod 1.41; all_pod_files_ok(); Progress-Any-0.219/t/01-basics.t0000644000175000017500000001546613715657656013665 0ustar u1u1#!/usr/bin/perl use 5.010; use strict; use warnings; use Progress::Any; use Test::More 0.98; use Test::Exception; use Time::HiRes qw(sleep); # XXX test finish() # XXX test reset() # XXX test update() argument: force_update subtest "get_indicator, {total_,pos}, {total_,}target, percent_complete" => sub { %Progress::Any::indicators = (); my $p_ab = Progress::Any->get_indicator(task=>"a.b", target=>10); is($p_ab->pos, 0, "a.b's pos"); is($p_ab->total_pos, 0, "a.b's total_pos"); is($p_ab->target, 10, "a.b's target"); is($p_ab->total_target, 10, "a.b's total target"); is($p_ab->percent_complete, 0, "a.b's percent_complete"); my $p_a = Progress::Any->get_indicator(task=>"a"); is($p_a->pos, 0, "a's target"); is($p_a->total_pos, 0, "a's target"); is_deeply($p_a->target, 0, "a's target"); is_deeply($p_a->total_target, 10, "a's total target"); is_deeply($p_a->percent_complete, 0, "a's percent_complete"); my $p_ = Progress::Any->get_indicator(task=>""); is($p_->pos, 0, "root's target"); is($p_->total_pos, 0, "root's target"); is_deeply($p_->target, 0, "root's target"); is_deeply($p_->total_target, 10, "root's total target"); is_deeply($p_->percent_complete, 0, "root's percent_complete"); my $p_abd = Progress::Any->get_indicator(task=>"a.b.d", target=>7, pos=>2); is($p_abd->pos, 2, "a.b.d's pos"); is($p_abd->total_pos, 2, "a.b.d's total_pos"); is($p_abd->target, 7, "a.b.d's target"); is($p_abd->total_target, 7, "a.b.d's total target"); is(sprintf("%.0f", $p_abd->percent_complete), 29, "a.b.d's percent_complete"); is($p_ab->total_pos, 2, "a.b's total_pos"); is($p_ab->total_target, 17, "a.b's total target"); is(sprintf("%.0f", $p_ab->percent_complete), 12, "a.b's percent_complete"); $p_a->target(0); is($p_a->total_pos, 2, "a's total pos"); is($p_a->total_target, 17, "a's total target"); is(sprintf("%.0f", $p_a->percent_complete), 12, "a's percent_complete"); $p_->target(0); is($p_->total_pos, 2, "root's total pos"); is($p_->total_target, 17, "root's total target"); is(sprintf("%.0f", $p_->percent_complete), 12, "root's percent_complete"); my $p_ac = Progress::Any->get_indicator(task=>"a.c", target=>5, pos=>1); is($p_ac->pos, 1, "a.c's pos"); is($p_ac->total_pos, 1, "a.c's total_pos"); is($p_ac->target, 5, "a.c's target"); is($p_ac->total_target, 5, "a.c's total target"); is(sprintf("%.0f", $p_ac->percent_complete), 20, "a.c's percent_complete"); is($p_a->total_pos, 3, "a's pos"); is($p_a->total_target, 22, "a's total target"); is(sprintf("%.0f", $p_a->percent_complete), 14, "a's percent_complete"); is($p_->total_pos, 3, "root's pos"); is($p_->total_target, 22, "root's total target"); is(sprintf("%.0f", $p_->percent_complete), 14, "root's percent_complete"); my $p_abe = Progress::Any->get_indicator(task=>"a.b.e", target=>undef); is($p_abe->pos, 0, "a.b.e's pos"); ok(!defined($p_abe->target), "a.b.e's target is undef"); ok(!defined($p_abe->percent_complete), "a.b.e's percent_complete is undef"); ok(!defined($p_ab->total_target), "a.b's total_target is undef"); ok(!defined($p_ab->percent_complete), "a.b's percent_complete is undef"); ok(!defined($p_a->total_target), "a's total_target is undef"); ok(!defined($p_a->percent_complete), "a's percent_complete is undef"); ok(!defined($p_->total_target), "root's total_target is undef"); ok(!defined($p_->percent_complete), "root's percent_complete is undef"); dies_ok { Progress::Any->get_indicator(task=>'a b') } 'invalid task in get_indicator() -> dies'; dies_ok { Progress::Any->get_indicator(task=>'foo', foo=>1) } 'unknown arg in get_indicator() -> dies'; dies_ok { Progress::Any->get_indicator(task=>'foo', target=>-1) } 'invalid target in get_indicator() -> dies'; dies_ok { Progress::Any->get_indicator(task=>'foo', pos=>-1) } 'invalid pos in get_indicator() -> dies'; }; subtest "update, state, elapsed, start, stop, finish" => sub { plan skip_all => "Temp. put in RELEASE_TESTING due to fragility of timing" unless $ENV{RELEASE_TESTING}; %Progress::Any::indicators = (); my $p = Progress::Any->get_indicator(task=>"a.b", target=>10); is($p->state, 'stopped', 'state before update() 1'); is($p->pos, 0, 'pos before update() 1'); sleep 0.05; is($p->elapsed, 0, "elapsed doesn't run before update() 1"); $p->update; is($p->state, 'started', 'state after update() 1'); is($p->pos, 1, 'pos after update() 1'); my $p_a = Progress::Any->get_indicator(task=>"a"); is($p_a->state, 'started', 'parent a is automatically started by update()'); my $p_ = Progress::Any->get_indicator(task=>""); is($p_->state, 'started', 'parent root is automatically started by update()'); sleep 1; is(sprintf("%.0f", $p->elapsed), "1", "elapsed runs after update() 1"); $p->stop; sleep 1; is(sprintf("%.0f", $p->elapsed), "1", "elapsed doesn't run after stop()"); $p->start; sleep 1; is(sprintf("%.0f", $p->elapsed), "2", "elapsed runs again after start()"); $p->update(pos=>8); is($p->pos, 8, "update() 2 with specified pos"); dies_ok { $p->update(foo=>1) } 'unknown arg in update() -> dies'; }; # XXX subtest remaining, set remaining, remaining_total subtest "fill_template" => sub { plan skip_all => "Currently release testing only due to timing-related and fail on some CT machines" unless $ENV{RELEASE_TESTING}; %Progress::Any::indicators = (); my $pa = Progress::Any->get_indicator(task=>"a", title=>"alf", target=>40); my $pb = Progress::Any->get_indicator(task=>"b", title=>"boo", target=>40); my $p_ = Progress::Any->get_indicator(task=>"", target=>0); $pa->update(); sleep 0.05; is($pa->fill_template("%t"), "alf", "t"); is($pa->fill_template("%3n"), " a", "n, width"); is($pa->fill_template("%-3m", message=>"b"), "b ", "m, negative width"); is($pa->fill_template("%m"), "", "m defaults to ''"); is($pa->fill_template("%%"), "%", "%"); is($pa->fill_template("%%"), "%", "%"); is($pa->fill_template("%e"), "1s ", "e, default"); is($pa->fill_template("%2e"), "1s", "e, width"); like($pa->fill_template("%p%%"), qr/^ [23]%$/, "p"); # on most systems it's 2% but on some 3% is($p_->fill_template("%p%%"), " 1%", "p root"); is($pa->fill_template("%r"), "2s ", "r"); #is($p_->fill_template("%r"), "4s ", "r root"); is($pa->fill_template("%R"), "2s left ", "R"); $pa->target(undef); is($pa->fill_template("%R"), "1s elapsed ", "R"); is($pa->fill_template("%p"), " ?", "p unknown"); is($pa->fill_template("%T"), "?", "T unknown"); is($pa->fill_template("%z"), "%z", "unknown template returns as-is"); }; DONE_TESTING: done_testing; Progress-Any-0.219/t/author-pod-coverage.t0000644000175000017500000000053613715657656016046 0ustar u1u1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } # This file was automatically generated by Dist::Zilla::Plugin::PodCoverageTests. use Test::Pod::Coverage 1.08; use Pod::Coverage::TrustPod; all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); Progress-Any-0.219/t/00-compile.t0000644000175000017500000000273613715657656014044 0ustar u1u1use 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 3 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Progress/Any.pm', 'Progress/Any/Output.pm', 'Progress/Any/Output/Null.pm' ); # no fake home requested my @switches = ( -d 'blib' ? '-Mblib' : '-Ilib', ); use File::Spec; use IPC::Open3; use IO::Handle; open my $stdin, '<', File::Spec->devnull or die "can't open devnull: $!"; my @warnings; for my $lib (@module_files) { # see L my $stderr = IO::Handle->new; diag('Running: ', join(', ', map { my $str = $_; $str =~ s/'/\\'/g; q{'} . $str . q{'} } $^X, @switches, '-e', "require q[$lib]")) if $ENV{PERL_COMPILE_TEST_DEBUG}; my $pid = open3($stdin, '>&STDERR', $stderr, $^X, @switches, '-e', "require q[$lib]"); binmode $stderr, ':crlf' if $^O eq 'MSWin32'; my @_warnings = <$stderr>; waitpid($pid, 0); is($?, 0, "$lib loaded ok"); shift @_warnings if @_warnings and $_warnings[0] =~ /^Using .*\bblib/ and not eval { +require blib; blib->VERSION('1.01') }; if (@_warnings) { warn @_warnings; push @warnings, @_warnings; } } is(scalar(@warnings), 0, 'no warnings found') or diag 'got warnings: ', ( Test::More->can('explain') ? Test::More::explain(\@warnings) : join("\n", '', @warnings) ) if $ENV{AUTHOR_TESTING}; Progress-Any-0.219/t/author-critic.t0000644000175000017500000000102013715657656014735 0ustar u1u1#!perl BEGIN { unless ($ENV{AUTHOR_TESTING}) { print qq{1..0 # SKIP these tests are for testing by the author\n}; exit } } use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Perl::Critic::Subset 3.001.005 use Test::Perl::Critic (-profile => "") x!! -e ""; my $filenames = ['lib/Progress/Any.pm','lib/Progress/Any/Output.pm','lib/Progress/Any/Output/Null.pm']; unless ($filenames && @$filenames) { $filenames = -d "blib" ? ["blib"] : ["lib"]; } all_critic_ok(@$filenames); Progress-Any-0.219/LICENSE0000644000175000017500000004403113715657656012546 0ustar u1u1This software is copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. Terms of the Perl programming language system itself a) the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version, or b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- This software is Copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software, licensed under: The GNU General Public License, Version 1, February 1989 GNU GENERAL PUBLIC LICENSE Version 1, February 1989 Copyright (C) 1989 Free Software Foundation, Inc. 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The license agreements of most software companies try to keep users at the mercy of those companies. By contrast, our General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. The General Public License applies to the Free Software Foundation's software and to any other program whose authors commit to using it. You can use it for your programs, too. When we speak of free software, we are referring to freedom, not price. Specifically, the General Public License is designed to make sure that you have the freedom to give away or sell copies of free software, that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of a such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any work containing the Program or a portion of it, either verbatim or with modifications. Each licensee is addressed as "you". 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this General Public License and to the absence of any warranty; and give any other recipients of the Program a copy of this General Public License along with the Program. You may charge a fee for the physical act of transferring a copy. 2. You may modify your copy or copies of the Program or any portion of it, and copy and distribute such modifications under the terms of Paragraph 1 above, provided that you also do the following: a) cause the modified files to carry prominent notices stating that you changed the files and the date of any change; and b) cause the whole of any work that you distribute or publish, that in whole or in part contains the Program or any part thereof, either with or without modifications, to be licensed at no charge to all third parties under the terms of this General Public License (except that you may choose to grant warranty protection to some or all third parties, at your option). c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the simplest and most usual way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this General Public License. d) You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. Mere aggregation of another independent work with the Program (or its derivative) on a volume of a storage or distribution medium does not bring the other work under the scope of these terms. 3. You may copy and distribute the Program (or a portion or derivative of it, under Paragraph 2) in object code or executable form under the terms of Paragraphs 1 and 2 above provided that you also do one of the following: a) accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Paragraphs 1 and 2 above; or, b) accompany it with a written offer, valid for at least three years, to give any third party free (except for a nominal charge for the cost of distribution) a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Paragraphs 1 and 2 above; or, c) accompany it with the information you received as to where the corresponding source code may be obtained. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form alone.) Source code for a work means the preferred form of the work for making modifications to it. For an executable file, complete source code means all the source code for all modules it contains; but, as a special exception, it need not include source code for modules which are standard libraries that accompany the operating system on which the executable file runs, or for standard header files or definitions files that accompany that operating system. 4. You may not copy, modify, sublicense, distribute or transfer the Program except as expressly provided under this General Public License. Any attempt otherwise to copy, modify, sublicense, distribute or transfer the Program is void, and will automatically terminate your rights to use the Program under this License. However, parties who have received copies, or rights to use copies, from you under this General Public License will not have their licenses terminated so long as such parties remain in full compliance. 5. By copying, distributing or modifying the Program (or any work based on the Program) you indicate your acceptance of this license to do so, and all its terms and conditions. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. 7. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of the license which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of the license, you may choose any version ever published by the Free Software Foundation. 8. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 9. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 10. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS Appendix: How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to humanity, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) 19yy This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 1, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston MA 02110-1301 USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) 19xx name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (a program to direct compilers to make passes at assemblers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice That's all there is to it! --- The Artistic License 1.0 --- This software is Copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software, licensed under: The Artistic License 1.0 The Artistic License Preamble The intent of this document is to state the conditions under which a Package may be copied, such that the Copyright Holder maintains some semblance of artistic control over the development of the package, while giving the users of the package the right to use and distribute the Package in a more-or-less customary fashion, plus the right to make reasonable modifications. Definitions: - "Package" refers to the collection of files distributed by the Copyright Holder, and derivatives of that collection of files created through textual modification. - "Standard Version" refers to such a Package if it has not been modified, or has been modified in accordance with the wishes of the Copyright Holder. - "Copyright Holder" is whoever is named in the copyright or copyrights for the package. - "You" is you, if you're thinking about copying or distributing this Package. - "Reasonable copying fee" is whatever you can justify on the basis of media cost, duplication charges, time of people involved, and so on. (You will not be required to justify it to the Copyright Holder, but only to the computing community at large as a market that must bear the fee.) - "Freely Available" means that no fee is charged for the item itself, though there may be fees involved in handling the item. It also means that recipients of the item may redistribute it under the same conditions they received it. 1. You may make and give away verbatim copies of the source form of the Standard Version of this Package without restriction, provided that you duplicate all of the original copyright notices and associated disclaimers. 2. You may apply bug fixes, portability fixes and other modifications derived from the Public Domain or from the Copyright Holder. A Package modified in such a way shall still be considered the Standard Version. 3. You may otherwise modify your copy of this Package in any way, provided that you insert a prominent notice in each changed file stating how and when you changed that file, and provided that you do at least ONE of the following: a) place your modifications in the Public Domain or otherwise make them Freely Available, such as by posting said modifications to Usenet or an equivalent medium, or placing the modifications on a major archive site such as ftp.uu.net, or by allowing the Copyright Holder to include your modifications in the Standard Version of the Package. b) use the modified Package only within your corporation or organization. c) rename any non-standard executables so the names do not conflict with standard executables, which must also be provided, and provide a separate manual page for each non-standard executable that clearly documents how it differs from the Standard Version. d) make other distribution arrangements with the Copyright Holder. 4. You may distribute the programs of this Package in object code or executable form, provided that you do at least ONE of the following: a) distribute a Standard Version of the executables and library files, together with instructions (in the manual page or equivalent) on where to get the Standard Version. b) accompany the distribution with the machine-readable source of the Package with your modifications. c) accompany any non-standard executables with their corresponding Standard Version executables, giving the non-standard executables non-standard names, and clearly documenting the differences in manual pages (or equivalent), together with instructions on where to get the Standard Version. d) make other distribution arrangements with the Copyright Holder. 5. You may charge a reasonable copying fee for any distribution of this Package. You may charge any fee you choose for support of this Package. You may not charge a fee for this Package itself. However, you may distribute this Package in aggregate with other (possibly commercial) programs as part of a larger (possibly commercial) software distribution provided that you do not advertise this Package as a product of your own. 6. The scripts and library files supplied as input to or produced as output from the programs of this Package do not automatically fall under the copyright of this Package, but belong to whomever generated them, and may be sold commercially, and may be aggregated with this Package. 7. C or perl subroutines supplied by you and linked into this Package shall not be considered part of this Package. 8. The name of the Copyright Holder may not be used to endorse or promote products derived from this software without specific prior written permission. 9. THIS PACKAGE IS PROVIDED "AS IS" AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. The End Progress-Any-0.219/lib/0000775000175000017500000000000013715657656012307 5ustar u1u1Progress-Any-0.219/lib/Progress/0000775000175000017500000000000013715657656014113 5ustar u1u1Progress-Any-0.219/lib/Progress/Any.pm0000644000175000017500000007514113715657656015206 0ustar u1u1package Progress::Any; our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY our $DATE = '2020-08-15'; # DATE our $DIST = 'Progress-Any'; # DIST our $VERSION = '0.219'; # VERSION use 5.010001; use strict; use warnings; use Time::Duration qw(); use Time::HiRes qw(time); sub import { my ($self, @args) = @_; my $caller = caller(); for (@args) { if ($_ eq '$progress') { my $progress = $self->get_indicator(task => ''); { no strict 'refs'; my $v = "$caller\::progress"; *$v = \$progress; } } else { die "Unknown import argument: $_"; } } } # store Progress::Any objects for each task our %indicators; # key = task name # store output objects our %outputs; # key = task name, value = [$outputobj, ...] # internal attributes: # - _elapsed (float*) = accumulated elapsed time so far # - _start_time (float) = when is the last time the indicator state is changed # from 'stopped' to 'started'. when indicator is changed from 'started' to # 'stopped', this will be set to undef. # - _remaining = used to store user's estimation of remaining time. will be # unset after each update(). # return 1 if created, 0 if already created/initialized sub _init_indicator { my ($class, $task, $default_target) = @_; #say "D: _init_indicator($task)"; # prevent double initialization return $indicators{$task} if $indicators{$task}; my $progress = bless({ task => $task, title => $task, target => $default_target, pos => 0, state => 'stopped', _remaining => undef, _set_remaining_time => undef, _elapsed => 0, _start_time => 0, }, $class); $indicators{$task} = $progress; # if we create an indicator named a.b.c, we must also create a.b, a, and ''. if ($task =~ s/\.?\w+\z//) { $class->_init_indicator($task, 0); } $progress; } sub get_indicator { my ($class, %args) = @_; my %oargs = %args; my $task = delete($args{task}); if (!defined($task)) { my @caller = caller(0); #say "D:caller=".join(",",map{$_//""} @caller); $task = $caller[0] eq '(eval)' ? 'main' : $caller[0]; $task =~ s/::/./g; $task =~ s/[^.\w]+/_/g; } die "Invalid task syntax '$task', please only use dotted words" unless $task =~ /\A(?:\w+(\.\w+)*)?\z/; my %uargs; my $p = $class->_init_indicator($task); for my $an (qw/title target pos remaining state/) { if (exists $args{$an}) { $uargs{$an} = delete($args{$an}); } } die "Unknown argument(s) to get_indicator(): ".join(", ", keys(%args)) if keys(%args); $p->_update(%uargs) if keys %uargs; $p; } my %attrs = ( title => {is => 'rw'}, target => {is => 'rw'}, pos => {is => 'rw'}, state => {is => 'rw'}, ); # create attribute methods for my $an (keys %attrs) { next if $attrs{$an}{manual}; my $code; if ($attrs{$an}{is} eq 'rw') { $code = sub { my $self = shift; if (@_) { $self->_update($an => shift); } $self->{$an}; }; } else { $code = sub { my $self = shift; die "Can't set value, $an is an ro attribute" if @_; $self->{$an}; }; } no strict 'refs'; *{$an} = $code; } sub elapsed { my $self = shift; if ($self->{state} eq 'started') { return $self->{_elapsed} + (time()-$self->{_start_time}); } else { return $self->{_elapsed}; } } sub total_pos { my $self = shift; my $t = $self->{task}; my $res = $self->{pos}; for (keys %indicators) { if ($t eq '') { next if $_ eq ''; } else { next unless index($_, "$t.") == 0; } $res += $indicators{$_}{pos}; } $res; } sub total_target { my $self = shift; my $t = $self->{task}; my $res = $self->{target}; return undef unless defined($res); for (keys %indicators) { if ($t eq '') { next if $_ eq ''; } else { next unless index($_, "$t.") == 0; } return undef unless defined $indicators{$_}{target}; $res += $indicators{$_}{target}; } $res; } sub percent_complete { my $self = shift; my $total_pos = $self->total_pos; my $total_target = $self->total_target; return undef unless defined($total_target); if ($total_target == 0) { if ($self->{state} eq 'finished') { return 100; } else { return 0; } } else { return $total_pos / $total_target * 100; } } sub remaining { my $self = shift; if (defined $self->{_remaining}) { if ($self->{state} eq 'started') { my $r = $self->{_remaining}-(time()-$self->{_set_remaining_time}); return $r > 0 ? $r : 0; } else { return $self->{_remaining}; } } else { if (defined $self->{target}) { if ($self->{pos} == 0) { return 0; } else { return ($self->{target} - $self->{pos})/$self->{pos} * $self->elapsed; } } else { return undef; } } } sub total_remaining { my $self = shift; my $t = $self->{task}; my $res = $self->remaining; return undef unless defined $res; for (keys %indicators) { if ($t eq '') { next if $_ eq ''; } else { next unless index($_, "$t.") == 0; } my $res2 = $indicators{$_}->remaining; return undef unless defined $res2; $res += $res2; } $res; } # the routine to use to update rw attributes, does validation and checks to make # sure things are consistent. sub _update { my ($self, %args) = @_; # no need to check for unknown arg in %args, it's an internal method anyway my $now = time(); my $task = $self->{task}; #use Data::Dump; print "D: _update($task) "; dd \%args; SET_TITLE: { last unless exists $args{title}; my $val = $args{title}; die "Invalid value for title, must be defined" unless defined($val); $self->{title} = $val; } SET_TARGET: { last unless exists $args{target}; my $val = $args{target}; die "Invalid value for target, must be a positive number or undef" unless !defined($val) || $val >= 0; # ensure that pos does not exceed target if (defined($val) && $self->{pos} > $val) { $self->{pos} = $val; } $self->{target} = $val; undef $self->{_remaining}; } SET_POS: { last unless exists $args{pos}; my $val = $args{pos}; die "Invalid value for pos, must be a positive number" unless defined($val) && $val >= 0; # ensure that pos does not exceed target if (defined($self->{target}) && $val > $self->{target}) { $val = $self->{target}; } $self->{pos} = $val; undef $self->{_remaining}; } SET_REMAINING: { last unless exists $args{remaining}; my $val = $args{remaining}; die "Invalid value for remaining, must be a positive number" unless defined($val) && $val >= 0; $self->{_remaining} = $val; $self->{_set_remaining_time} = $now; } SET_STATE: { last unless exists $args{state}; my $old = $self->{state}; my $val = $args{state} // 'started'; die "Invalid value for state, must be stopped/started/finished" unless $val =~ /\A(?:stopped|started|finished)\z/; last if $old eq $val; if ($val eq 'started') { $self->{_start_time} = $now; # automatically start parents my @parents; { my $t = $task; while (1) { last unless $t =~ s/\.\w+\z//; push @parents, $t; } push @parents, ''; } for my $t (@parents) { my $p = $indicators{$t}; if ($p->{state} ne 'started') { $p->{state} = 'started'; $p->{_start_time} = $now; } } } else { $self->{_elapsed} += $now - $self->{_start_time}; if ($val eq 'finished') { die "BUG: Can't finish task '$task', pos is still < target" if defined($self->{target}) && $self->{pos} < $self->{target}; $self->{_remaining} = 0; $self->{_set_remaining_time} = $now; } } $self->{state} = $val; } DONE: #use Data::Dump; print "after update: "; dd $self; return; } sub _should_update_output { my ($self, $output, $now, $priority) = @_; my $key = "$output"; if (!defined($output->{_mtime})) { # output has never been updated, update return 1; } elsif ($self->{state} eq 'finished') { # finishing, update the output to show finished state return 1; } elsif ($output->{force_update}) { # this is an undocumented force update for now, the output itself or # something else can set this to force an update. but this will only be # done once because we delete the key; if another update wants to be # forced, they need to set this again. delete $output->{force_update}; return 1; } elsif ($priority eq 'high') { # high priority, send to output module return 1; } else { # normal-/low-priority update, update if not too frequent if (!defined($output->{freq})) { # negative number means seconds, positive means pos delta. only # update if that number of seconds, or that difference in pos has # been passed. $output->{freq} = -0.5; } if ($output->{freq} == 0) { return 1; } if ($output->{freq} < 0) { return 1 if $now >= $output->{_mtime} - $output->{freq}; } else { return 1 if abs($self->{pos} - $output->{_pos}) >= $output->{freq}; } return 0; } } sub update { my ($self, %args) = @_; my $pos = delete($args{pos}) // $self->{pos} + 1; my $state = delete($args{state}) // 'started'; $self->_update(pos => $pos, state => $state); my $message = delete($args{message}); my $priority = delete($args{priority}) // 'normal'; my $force_update = delete($args{force_update}); my %other_args_for_output; for (keys %args) { if (/\Amessage\.alt\./) { $other_args_for_output{$_} = delete $args{$_}; } } die "Unknown argument(s) to update(): ".join(", ", keys(%args)) if keys(%args); my $now = time(); # find output(s) and call it { last unless $ENV{PROGRESS} // 1; my $task = $self->{task}; while (1) { if ($outputs{$task}) { for my $output (@{ $outputs{$task} }) { next unless $force_update || $self->_should_update_output($output, $now, $priority); if (ref($message) eq 'CODE') { $message = $message->(); } $output->update( indicator => $indicators{$task}, message => $message, priority => $priority, time => $now, # temporary, internal API. to let an output module know # the same update() when there are multiple instances of # it _update_id => $now, %other_args_for_output, ); $output->{_mtime} = $now; $output->{_pos} = $pos; } } last unless $task =~ s/\.?\w+\z//; } } } sub start { my $self = shift; $self->_update(state => 'started'); } sub stop { my $self = shift; $self->_update(state => 'stopped'); } sub finish { my ($self, %args) = @_; $self->update(pos=>$self->{target}, state=>'finished', %args); } sub reset { my ($self, %args) = @_; $self->update(pos=>0, state=>'started', %args); } our $template_regex = qr{( # all=1 % ( #width=2 -?\d+ )? ( #dot=3 \.?) ( #prec=4 \d+)? ( #conv=5 [A-Za-z%]) )}x; sub fill_template { my ($self, $template0, %args) = @_; # TODO: some caching so "%e%e" produces two identical numbers my ($template, $opts); if (ref $template0 eq 'HASH') { $opts = $template0; $template = $opts->{template}; } else { $template = $template0; $opts = {}; } state $sub = sub { my %args = @_; my ($all, $width, $dot, $prec, $conv) = ($1, $2, $3, $4, $5); my $p = $args{indicator}; my ($fmt, $sconv, $data); if ($conv eq 'n') { $data = $p->{task}; } elsif ($conv eq 't') { $data = $p->{title}; } elsif ($conv eq '%') { $data = '%'; } elsif ($conv eq 'm') { $data = $args{message} // ''; } elsif ($conv eq 'p') { my $val = $p->percent_complete; $width //= 3; if (defined $val) { $data = $val; $prec //= 0; $sconv = "f"; } else { $data = '?'; } } elsif ($conv eq 'P') { $data = $p->total_pos; $prec //= 0; $sconv = "f"; } elsif ($conv eq 'T') { my $val = $p->total_target; if (defined $val) { $data = $val; $prec //= 0; $sconv = "f"; } else { $data = '?'; } } elsif ($conv eq 'e') { my $val = $p->elapsed; $val = 1 if $val < 1; # TMP, prevent duration() return "just now" $data = Time::Duration::concise(Time::Duration::duration($val)); $width //= -8; } elsif ($conv eq 'r') { my $val = $p->total_remaining; if (defined $val) { $val = 1 if $val < 1; # TMP, prevent duration() return "just now $data = Time::Duration::concise(Time::Duration::duration($val)); } else { $data = '?'; } $width //= -8; } elsif ($conv eq 'R') { my $val = $p->total_remaining; if (defined $val) { $val = 1 if $val < 1; # TMP, prevent duration() return "just now $data = Time::Duration::concise(Time::Duration::duration($val)). " left"; # XXX i18n } else { $val = $p->elapsed; $val = 1 if $val < 1; # TMP, prevent duration() return "just now $data = Time::Duration::concise(Time::Duration::duration($val)). " elapsed"; # XXX i18n } $width //= -(8 + 1 + 7); } else { if ($opts->{handle_unknown_conversion}) { my @res = $opts->{handle_unknown_conversion}->( indicator => $p, args => \%args, all => $all, width => $width, dot => $dot, conv => $conv, prec => $prec, ); if (@res) { ($fmt, $data) = @res; } else { # return as-is $fmt = '%s'; $data = $all; } } else { # return as-is $fmt = '%s'; $data = $all; } } # sprintf format $sconv //= 's'; $dot = "." if $sconv eq 'f'; $fmt //= join("", grep {defined} ("%", $width, $dot, $prec, $sconv)); #say "D:fmt=$fmt"; sprintf $fmt, $data; }; $template =~ s{$template_regex}{$sub->(%args, indicator=>$self)}egox; $template; } 1; # ABSTRACT: Record progress to any output __END__ =pod =encoding UTF-8 =head1 NAME Progress::Any - Record progress to any output =head1 VERSION This document describes version 0.219 of Progress::Any (from Perl distribution Progress-Any), released on 2020-08-15. =head1 SYNOPSIS Example of using in a script with terminal progress bar as output (progress bar will be cleared on C): use Progress::Any '$progress'; use Progress::Any::Output 'TermProgressBarColor'; $progress->target(10); for (1..10) { $progress->update(message => "Doing item $_"); sleep 1; } $progress->finish(); Sample output: % ./script.pl 60% [Doing item 6==== ]3s left Another example, this time with terminal message as output: use Progress::Any '$progress'; use Progress::Any::Output 'TermMessage', template => '[%n] %P/%T (%6.2p%%) %m'; $progress->target(10); for (1..10) { $progress->update(message => "Item $_/10"); sleep 1; } sleep 1; $progress->finish(message => "Finished!"); Sample output: % ./script.pl [] 1/10 ( 10.00%) Item 1/10 [] 2/10 ( 20.00%) Item 2/10 ... [] 10/10 (100.00%) Item 10/10 [] 10/10 (100.00%) Finished! Example of using in a module as well as script: # in lib/MyApp.pm package MyApp; use Progress::Any; sub download { my @urls = @_; return unless @urls; my $progress = Progress::Any->get_indicator( task => "download", pos=>0, target=>~~@urls); for my $url (@urls) { # download the $url ... $progress->update(message => "Downloaded $url"); } $progress->finish; } # in script.pl use MyApp; use Progress::Any::Output; Progress::Any::Output->set('TermProgressBarColor'); MyApp::download("url1", "url2", "url3", "url4", "url5"); Sample output: % ./script.pl 20% [====== Downloaded url1 ]0m00s Left Example that demonstrates multiple indicator objects: use Progress::Any; use Progress::Any::Output; my $pdl = Progress::Any->get_indicator(task => 'download'); Progress::Any::Output->set({task=>'download'}, 'TermMessage', template => '[%-8t] [%P/%2T] %m'); my $pcp = Progress::Any->get_indicator(task => 'copy'); Progress::Any::Output->set({task=>'copy' }, 'TermMessage', template => '[%-8t] [%P/%2T] %m'); $pdl->target(10); $pdl->update(message => "downloading A"); $pcp->update(message => "copying A"); sleep 1; $pdl->update(message => "downloading B"); $pcp->update(message => "copying B"); will show something like: [download] [1/10] downloading A [copy ] [1/ ?] copying A [download] [2/10] downloading B [copy ] [2/ ?] copying B =head2 Example of using with Perinci::CmdLine If you use L, you can mark your function as expecting a Progress::Any object and it will be supplied to you in a special argument C<-progress>: use File::chdir; use Perinci::CmdLine; $SPEC{check_dir} = { v => 1.1, args => { dir => {summary=>"Path to check", schema=>"str*", req=>1, pos=>0}, }, features => {progress=>1}, }; sub check_dir { my %args = @_; my $progress = $args{-progress}; my $dir = $args{dir}; (-d $dir) or return [412, "No such dir: $dir"]; local $CWD = $dir; opendir my($dh), $dir; my @ent = readdir($dh); $progress->pos(0); $progress->target(~~@ent); for (@ent) { # do the check ... $progress->update(message => $_); sleep 1; } $progress->finish; [200]; } Perinci::CmdLine->new(url => '/main/check_dir')->run; =head1 DESCRIPTION C is an interface for applications that want to display progress to users. It decouples progress updating and output, rather similar to how L decouples log producers and consumers (output). The API is also rather similar to Log::Any, except I is called I and I is called I. Progress::Any records position/target and calculates elapsed time, estimated remaining time, and percentage of completion. One or more output modules (Progress::Any::Output::*) display this information. In your modules, you typically only need to use Progress::Any, get one or more indicators, set target and update it during work. In your application, you use Progress::Any::Output and set/add one or more outputs to display the progress. By setting output only in the application and not in modules, you separate the formatting/display concern from the logic. Screenshots: =head1 STATUS API might still change, will be stabilized in 1.0. =begin HTML


Using TermProgressBarColor output


Using DesktopNotify output =end HTML The list of features: =over =item * multiple progress indicators You can use different indicator for each task/subtask. =item * customizable output Output is handled by one of C modules. Currently available outputs: C (no output), C (display as simple message on terminal), C (display as color progress bar on terminal), C (log using L), C (call a subroutine). Other possible output ideas: IM/Twitter/SMS, GUI, web/AJAX, remote/RPC (over L for example, so that L-based command-line clients can display progress update from remote functions). =item * multiple outputs One or more outputs can be used to display one or more indicators. =item * hierarchical progress A task can be divided into subtasks. If a subtask is updated, its parent task (and its parent, and so on) are also updated proportionally. =item * message Aside from setting a number/percentage, allow including a message when updating indicator. =item * undefined target Target can be undefined, so a bar output might not show any bar (or show them, but without percentage indicator), but can still show messages. =item * retargetting Target can be changed in the middle of things. =back =head1 EXPORTS =head2 $progress => OBJ The root indicator. Equivalent to: Progress::Any->get_indicator(task => '') =head1 ATTRIBUTES Below are the attributes of an indicator/task: =head2 task String. Default: from caller's package, or C

. Task name. If not specified will be set to caller's package (C<::> will be replaced with C<.>), e.g. if you are calling this method from C, then task will be set to C. If caller is code inside eval, C
will be used instead. =head2 title String. Default: task name. Specify task title. Task title is a longer description for a task and can contain spaces and other characters. It is displayed in some outputs, as well as using C<%t> in C. For example, for a task called C, its title might be C. =head2 target Non-negative number. Default: 0. The total number of items to finish. Can be set to undef to mean that we don't know (yet) how many items there are to finish (in which case, we cannot estimate percent of completion and remaining time). =head2 pos Non-negative number. Default: 0. The number of items that are already done. It cannot be larger than C, if C is defined. If C is set to a value smaller than C or C is set to a value larger than C, C will be changed to be C. =head2 state String. Default: C. State of task/indicator. Either: C, C, or C. Initially it will be set to C, which means elapsed time won't be running and will stay at 0. C will set the state to C to get elapsed time to run. At the end of task, you can call C (or alternatively set C to C) to stop the elapsed time again. The difference between C and C is: when C and C are both at 0, percent completed is assumed to be 0% when state is C, but 100% when state is C. =head1 METHODS =head2 get_indicator Usage: Progress::Any->get_indicator(%args) => obj Get a progress indicator for a certain task. C<%args> contain attribute values, at least C must be specified. Note that this module maintains a list of indicator singleton objects for each task (in C<%indicators> package variable), so subsequent C for the same task will return the same object. =head2 update Usage: $progress->update(%args) Update indicator. Will also, usually, update associated output(s) if necessary. Arguments: =over =item * pos => NUM Set the new position. If unspecified, defaults to current position + 1. If pos is larger than target, outputs will generally still show 100%. Note that fractions are allowed. =item * message => str|code Set a message to be displayed when updating indicator. Aside from a string, you can also pass a coderef here. It can be used to delay costly calculation. The message will only be calculated when actually sent to output. =item * priority => str ("normal"|"low"|"high", default: "normal") Set importance level of this update. Default is C. Output can choose to ignore updates lower than a certain level. =item * state => STR Can be set to C to finish a task. =item * force_update => BOOL Default false. Some outputs choose only to update themselves after a certain amount of time or number of updates have passed; this forces their update. =back =head2 finish Usage: $progress->finish(%args) Equivalent to: $progress->update( ( pos => $progress->target ) x !!defined($progress->target), state => 'finished', %args, ); =head2 reset Usage: $progress->reset(%args) Equivalent to: $progress->update( pos => 0, state => 'started', %args, ); =head2 start Usage: $progress->start() Set state to C. =head2 stop Usage: $progress->stop() Set state to C. =head2 elapsed Usage: $progress->elapsed() => float Get elapsed time. Just like a stop-watch, when state is C elapsed time will run and when state is C, it will freeze. =head2 remaining Usage: $progress->remaining() => undef|float Give estimated remaining time until task is finished, which will depend on how fast the C is called, i.e. how fast C is approaching C. Will be undef if C is undef. =head2 total_remaining Usage: $progress->total_remaining() => undef|FLOAT Give estimated remaining time added by all its subtasks' remaining. Return undef if any one of those time is undef. =head2 total_pos Usage: $progress->total_pos() => float Total of indicator's pos and all of its subtasks'. =head2 total_target Usage: $progress->total_target() => undef|float Total of indicator's target and all of its subtasks'. Return undef if any one of those is undef. =head2 percent_complete Usage: $progress->percent_complete() => undef|float Give percentage of completion, calculated using C<< total_pos / total_target * 100 >>. Undef if total_target is undef. =head2 fill_template Usage: $progress->fill_template($template) => str Fill template with values, like in C. Usually used by output modules. Available templates: =over =item * C<%(width)n> Task name (the value of the C attribute). C is optional, an integer, like in C, can be negative to mean left-justify instead of right. =item * C<%(width)t> Task title (the value of the C attribute). =item * C<%(width)e> Elapsed time (the result from the C<elapsed()> method). Currently using L<Time::Duration> concise format, e.g. 10s, 1m40s, 16m40s, 1d4h, and so on. Format might be configurable and localizable in the future. Default width is -8. Examples: 2m30s 10s =item * C<%(width)r> Estimated remaining time (the result of the C<total_remaining()> method). Currently using L<Time::Duration> concise format, e.g. 10s, 1m40s, 16m40s, 1d4h, and so on. Will show C<?> if unknown. Format might be configurable and localizable in the future. Default width is -8. Examples: 1m40s 5s =item * C<%(width)R> Estimated remaining time I<or> elapsed time, if estimated remaining time is not calculatable (e.g. when target is undefined). Format might be configurable and localizable in the future. Default width is -(8+1+7). Examples: 30s left 1m40s elapsed =item * C<%(width).(prec)p> Percentage of completion (the result of the C<percent_complete()> method). C<width> and C<precision> are optional, like C<%f> in Perl's C<sprintf()>, default is C<%3.0p>. If percentage is unknown (due to target being undef), will show C<?>. =item * C<%(width)P> Current position (the result of the C<total_pos()> method). =item * C<%(width)T> Target (the result of the C<total_target()> method). If undefined, will show C<?>. =item * C<%m> Message (the C<update()> parameter). If message is unspecified, will show empty string. =item * C<%%> A literal C<%> sign. =back =head1 FAQ =head1 ENVIRONMENT =head2 PROGRESS Boolean. Default 1. Can be set to 0 to display progress output. =head1 HOMEPAGE Please visit the project's homepage at L<https://metacpan.org/release/Progress-Any>. =head1 SOURCE Source repository is at L<https://github.com/perlancar/perl-Progress-Any>. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L<Progress::Any::Examples> distribution contains example scripts. Other progress modules on CPAN: L<Term::ProgressBar>, L<Term::ProgressBar::Simple>, L<Time::Progress>, among others. Output modules: C<Progress::Any::Output::*> See examples on how Progress::Any is used by other modules: L<Perinci::CmdLine> (supplying progress object to functions), L<Git::Bunch> (using progress object). =head1 AUTHOR perlancar <perlancar@cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut �������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/lib/Progress/Any/����������������������������������������������������������������0000775�0001750�0001750�00000000000�13715657656�014642� 5����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/lib/Progress/Any/Output.pm�������������������������������������������������������0000644�0001750�0001750�00000007557�13715657656�016514� 0����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Progress::Any::Output; our $AUTHORITY = 'cpan:PERLANCAR'; # AUTHORITY our $DATE = '2020-08-15'; # DATE our $DIST = 'Progress-Any'; # DIST our $VERSION = '0.219'; # VERSION use 5.010001; use strict; use warnings; require Progress::Any; sub import { my $self = shift; __PACKAGE__->set(@_) if @_; } sub _set_or_add { my $class = shift; my $which = shift; my $opts; if (@_ && ref($_[0]) eq 'HASH') { $opts = {%{shift()}}; # shallow copy } else { $opts = {}; } # allow adding options via -name => val syntax, for ease in using via -M in # one-liners. while (1) { last unless @_ && $_[0] =~ /\A-(.+)/; $opts->{$1} = $_[1]; splice @_, 0, 2; } my $output = shift or die "Please specify output name"; $output =~ /\A(?:\w+(::\w+)*)?\z/ or die "Invalid output syntax '$output'"; my $task = $opts->{task} // ""; my $outputo; unless (ref $outputo) { my $outputpm = $output; $outputpm =~ s!::!/!g; $outputpm .= ".pm"; require "Progress/Any/Output/$outputpm"; no strict 'refs'; $outputo = "Progress::Any::Output::$output"->new(@_); } if ($which eq 'set') { $Progress::Any::outputs{$task} = [$outputo]; } else { $Progress::Any::outputs{$task} //= []; push @{ $Progress::Any::outputs{$task} }, $outputo; } $outputo; } sub set { my $class = shift; $class->_set_or_add('set', @_); } sub add { my $class = shift; $class->_set_or_add('add', @_); } 1; # ABSTRACT: Assign output to progress indicators __END__ =pod =encoding UTF-8 =head1 NAME Progress::Any::Output - Assign output to progress indicators =head1 VERSION This document describes version 0.219 of Progress::Any::Output (from Perl distribution Progress-Any), released on 2020-08-15. =head1 SYNOPSIS In your application: use Progress::Any::Output; Progress::Any::Output->set('TermProgressBarColor'); or: use Progress::Any::Output 'TermProgressBarColor'; To give parameters to output: use Progress::Any::Output; Progress::Any::Output->set('TermProgressBarColor', width=>50, ...); or: use Progress::Any::Output 'TermProgressBarColor', width=>50, ...; To assign output to a certain (sub)task: use Progress::Any::Output -task => "main.download", 'TermMessage'; or: use Progress::Any::Output; Progress::Any::Output->set({task=>'main.download'}, 'TermMessage'); To add additional output, use C<add()> instead of C<set()>. =head1 DESCRIPTION See L<Progress::Any> for overview. =head1 METHODS =head2 Progress::Any::Output->set([ \%opts ], $output[, @args]) => obj Set (or replace) output. Will load and instantiate C<Progress::Any::Output::$output>. To only set output for a certain (sub)task, set C<%opts> to C<< { task => $task } >>. C<@args> will be passed to output module's constructor. Return the instantiated object. If C<$output> is an object (a reference, really), it will be used as-is. =head2 Progress::Any::Output->add([ \%opts ], $output[, @args]) Like set(), but will add output instead of replace existing one(s). =head1 HOMEPAGE Please visit the project's homepage at L<https://metacpan.org/release/Progress-Any>. =head1 SOURCE Source repository is at L<https://github.com/perlancar/perl-Progress-Any>. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 SEE ALSO L<Progress::Any> =head1 AUTHOR perlancar <perlancar@cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut �������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/lib/Progress/Any/Output/���������������������������������������������������������0000775�0001750�0001750�00000000000�13715657656�016142� 5����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/lib/Progress/Any/Output/Null.pm��������������������������������������������������0000644�0001750�0001750�00000002420�13715657656�017406� 0����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������package Progress::Any::Output::Null; use 5.010; use strict; use warnings; our $VERSION = '0.219'; # VERSION sub new { my ($class, %args) = @_; bless \%args, $class; } sub update { 1; } 1; # ABSTRACT: Null output __END__ =pod =encoding UTF-8 =head1 NAME Progress::Any::Output::Null - Null output =head1 VERSION This document describes version 0.219 of Progress::Any::Output::Null (from Perl distribution Progress-Any), released on 2020-08-15. =for Pod::Coverage ^(new|update)$ =head1 HOMEPAGE Please visit the project's homepage at L<https://metacpan.org/release/Progress-Any>. =head1 SOURCE Source repository is at L<https://github.com/perlancar/perl-Progress-Any>. =head1 BUGS Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. =head1 AUTHOR perlancar <perlancar@cpan.org> =head1 COPYRIGHT AND LICENSE This software is copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. =cut ������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/README���������������������������������������������������������������������������0000644�0001750�0001750�00000035330�13715657656�012423� 0����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������NAME Progress::Any - Record progress to any output VERSION This document describes version 0.219 of Progress::Any (from Perl distribution Progress-Any), released on 2020-08-15. SYNOPSIS Example of using in a script with terminal progress bar as output (progress bar will be cleared on "finish()"): use Progress::Any '$progress'; use Progress::Any::Output 'TermProgressBarColor'; $progress->target(10); for (1..10) { $progress->update(message => "Doing item $_"); sleep 1; } $progress->finish(); Sample output: % ./script.pl 60% [Doing item 6==== ]3s left Another example, this time with terminal message as output: use Progress::Any '$progress'; use Progress::Any::Output 'TermMessage', template => '[%n] %P/%T (%6.2p%%) %m'; $progress->target(10); for (1..10) { $progress->update(message => "Item $_/10"); sleep 1; } sleep 1; $progress->finish(message => "Finished!"); Sample output: % ./script.pl [] 1/10 ( 10.00%) Item 1/10 [] 2/10 ( 20.00%) Item 2/10 ... [] 10/10 (100.00%) Item 10/10 [] 10/10 (100.00%) Finished! Example of using in a module as well as script: # in lib/MyApp.pm package MyApp; use Progress::Any; sub download { my @urls = @_; return unless @urls; my $progress = Progress::Any->get_indicator( task => "download", pos=>0, target=>~~@urls); for my $url (@urls) { # download the $url ... $progress->update(message => "Downloaded $url"); } $progress->finish; } # in script.pl use MyApp; use Progress::Any::Output; Progress::Any::Output->set('TermProgressBarColor'); MyApp::download("url1", "url2", "url3", "url4", "url5"); Sample output: % ./script.pl 20% [====== Downloaded url1 ]0m00s Left Example that demonstrates multiple indicator objects: use Progress::Any; use Progress::Any::Output; my $pdl = Progress::Any->get_indicator(task => 'download'); Progress::Any::Output->set({task=>'download'}, 'TermMessage', template => '[%-8t] [%P/%2T] %m'); my $pcp = Progress::Any->get_indicator(task => 'copy'); Progress::Any::Output->set({task=>'copy' }, 'TermMessage', template => '[%-8t] [%P/%2T] %m'); $pdl->target(10); $pdl->update(message => "downloading A"); $pcp->update(message => "copying A"); sleep 1; $pdl->update(message => "downloading B"); $pcp->update(message => "copying B"); will show something like: [download] [1/10] downloading A [copy ] [1/ ?] copying A [download] [2/10] downloading B [copy ] [2/ ?] copying B Example of using with Perinci::CmdLine If you use Perinci::CmdLine, you can mark your function as expecting a Progress::Any object and it will be supplied to you in a special argument "-progress": use File::chdir; use Perinci::CmdLine; $SPEC{check_dir} = { v => 1.1, args => { dir => {summary=>"Path to check", schema=>"str*", req=>1, pos=>0}, }, features => {progress=>1}, }; sub check_dir { my %args = @_; my $progress = $args{-progress}; my $dir = $args{dir}; (-d $dir) or return [412, "No such dir: $dir"]; local $CWD = $dir; opendir my($dh), $dir; my @ent = readdir($dh); $progress->pos(0); $progress->target(~~@ent); for (@ent) { # do the check ... $progress->update(message => $_); sleep 1; } $progress->finish; [200]; } Perinci::CmdLine->new(url => '/main/check_dir')->run; DESCRIPTION "Progress::Any" is an interface for applications that want to display progress to users. It decouples progress updating and output, rather similar to how Log::Any decouples log producers and consumers (output). The API is also rather similar to Log::Any, except *Adapter* is called *Output* and *category* is called *task*. Progress::Any records position/target and calculates elapsed time, estimated remaining time, and percentage of completion. One or more output modules (Progress::Any::Output::*) display this information. In your modules, you typically only need to use Progress::Any, get one or more indicators, set target and update it during work. In your application, you use Progress::Any::Output and set/add one or more outputs to display the progress. By setting output only in the application and not in modules, you separate the formatting/display concern from the logic. Screenshots: STATUS API might still change, will be stabilized in 1.0. The list of features: * multiple progress indicators You can use different indicator for each task/subtask. * customizable output Output is handled by one of "Progress::Any::Output::*" modules. Currently available outputs: "Null" (no output), "TermMessage" (display as simple message on terminal), "TermProgressBarColor" (display as color progress bar on terminal), "LogAny" (log using Log::Any), "Callback" (call a subroutine). Other possible output ideas: IM/Twitter/SMS, GUI, web/AJAX, remote/RPC (over Riap for example, so that Perinci::CmdLine-based command-line clients can display progress update from remote functions). * multiple outputs One or more outputs can be used to display one or more indicators. * hierarchical progress A task can be divided into subtasks. If a subtask is updated, its parent task (and its parent, and so on) are also updated proportionally. * message Aside from setting a number/percentage, allow including a message when updating indicator. * undefined target Target can be undefined, so a bar output might not show any bar (or show them, but without percentage indicator), but can still show messages. * retargetting Target can be changed in the middle of things. EXPORTS $progress => OBJ The root indicator. Equivalent to: Progress::Any->get_indicator(task => '') ATTRIBUTES Below are the attributes of an indicator/task: task String. Default: from caller's package, or "main". Task name. If not specified will be set to caller's package ("::" will be replaced with "."), e.g. if you are calling this method from "Foo::Bar::baz()", then task will be set to "Foo.Bar". If caller is code inside eval, "main" will be used instead. title String. Default: task name. Specify task title. Task title is a longer description for a task and can contain spaces and other characters. It is displayed in some outputs, as well as using %t in "fill_template()". For example, for a task called "copy", its title might be "Copying files to remote server". target Non-negative number. Default: 0. The total number of items to finish. Can be set to undef to mean that we don't know (yet) how many items there are to finish (in which case, we cannot estimate percent of completion and remaining time). pos Non-negative number. Default: 0. The number of items that are already done. It cannot be larger than "target", if "target" is defined. If "target" is set to a value smaller than "pos" or "pos" is set to a value larger than "target", "pos" will be changed to be "target". state String. Default: "stopped". State of task/indicator. Either: "stopped", "started", or "finished". Initially it will be set to "stopped", which means elapsed time won't be running and will stay at 0. "update()" will set the state to "started" to get elapsed time to run. At the end of task, you can call "finish()" (or alternatively set "state" to "finished") to stop the elapsed time again. The difference between "stopped" and "finished" is: when "target" and "pos" are both at 0, percent completed is assumed to be 0% when state is "stopped", but 100% when state is "finished". METHODS get_indicator Usage: Progress::Any->get_indicator(%args) => obj Get a progress indicator for a certain task. %args contain attribute values, at least "task" must be specified. Note that this module maintains a list of indicator singleton objects for each task (in %indicators package variable), so subsequent "get_indicator()" for the same task will return the same object. update Usage: $progress->update(%args) Update indicator. Will also, usually, update associated output(s) if necessary. Arguments: * pos => NUM Set the new position. If unspecified, defaults to current position + 1. If pos is larger than target, outputs will generally still show 100%. Note that fractions are allowed. * message => str|code Set a message to be displayed when updating indicator. Aside from a string, you can also pass a coderef here. It can be used to delay costly calculation. The message will only be calculated when actually sent to output. * priority => str ("normal"|"low"|"high", default: "normal") Set importance level of this update. Default is "normal". Output can choose to ignore updates lower than a certain level. * state => STR Can be set to "finished" to finish a task. * force_update => BOOL Default false. Some outputs choose only to update themselves after a certain amount of time or number of updates have passed; this forces their update. finish Usage: $progress->finish(%args) Equivalent to: $progress->update( ( pos => $progress->target ) x !!defined($progress->target), state => 'finished', %args, ); reset Usage: $progress->reset(%args) Equivalent to: $progress->update( pos => 0, state => 'started', %args, ); start Usage: $progress->start() Set state to "started". stop Usage: $progress->stop() Set state to "stopped". elapsed Usage: $progress->elapsed() => float Get elapsed time. Just like a stop-watch, when state is "started" elapsed time will run and when state is "stopped", it will freeze. remaining Usage: $progress->remaining() => undef|float Give estimated remaining time until task is finished, which will depend on how fast the "update()" is called, i.e. how fast "pos" is approaching "target". Will be undef if "target" is undef. total_remaining Usage: $progress->total_remaining() => undef|FLOAT Give estimated remaining time added by all its subtasks' remaining. Return undef if any one of those time is undef. total_pos Usage: $progress->total_pos() => float Total of indicator's pos and all of its subtasks'. total_target Usage: $progress->total_target() => undef|float Total of indicator's target and all of its subtasks'. Return undef if any one of those is undef. percent_complete Usage: $progress->percent_complete() => undef|float Give percentage of completion, calculated using "total_pos / total_target * 100". Undef if total_target is undef. fill_template Usage: $progress->fill_template($template) => str Fill template with values, like in "sprintf()". Usually used by output modules. Available templates: * "%(width)n" Task name (the value of the "task" attribute). "width" is optional, an integer, like in "sprintf()", can be negative to mean left-justify instead of right. * "%(width)t" Task title (the value of the "title" attribute). * "%(width)e" Elapsed time (the result from the "elapsed()" method). Currently using Time::Duration concise format, e.g. 10s, 1m40s, 16m40s, 1d4h, and so on. Format might be configurable and localizable in the future. Default width is -8. Examples: 2m30s 10s * "%(width)r" Estimated remaining time (the result of the "total_remaining()" method). Currently using Time::Duration concise format, e.g. 10s, 1m40s, 16m40s, 1d4h, and so on. Will show "?" if unknown. Format might be configurable and localizable in the future. Default width is -8. Examples: 1m40s 5s * "%(width)R" Estimated remaining time *or* elapsed time, if estimated remaining time is not calculatable (e.g. when target is undefined). Format might be configurable and localizable in the future. Default width is -(8+1+7). Examples: 30s left 1m40s elapsed * "%(width).(prec)p" Percentage of completion (the result of the "percent_complete()" method). "width" and "precision" are optional, like %f in Perl's "sprintf()", default is "%3.0p". If percentage is unknown (due to target being undef), will show "?". * "%(width)P" Current position (the result of the "total_pos()" method). * "%(width)T" Target (the result of the "total_target()" method). If undefined, will show "?". * %m Message (the "update()" parameter). If message is unspecified, will show empty string. * "%%" A literal "%" sign. FAQ ENVIRONMENT PROGRESS Boolean. Default 1. Can be set to 0 to display progress output. HOMEPAGE Please visit the project's homepage at <https://metacpan.org/release/Progress-Any>. SOURCE Source repository is at <https://github.com/perlancar/perl-Progress-Any>. BUGS Please report any bugs or feature requests on the bugtracker website <https://rt.cpan.org/Public/Dist/Display.html?Name=Progress-Any> When submitting a bug or request, please include a test-file or a patch to an existing test-file that illustrates the bug or desired feature. SEE ALSO Progress::Any::Examples distribution contains example scripts. Other progress modules on CPAN: Term::ProgressBar, Term::ProgressBar::Simple, Time::Progress, among others. Output modules: "Progress::Any::Output::*" See examples on how Progress::Any is used by other modules: Perinci::CmdLine (supplying progress object to functions), Git::Bunch (using progress object). AUTHOR perlancar <perlancar@cpan.org> COPYRIGHT AND LICENSE This software is copyright (c) 2020, 2018, 2015, 2014, 2013, 2012 by perlancar@cpan.org. This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. ��������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/Changes��������������������������������������������������������������������������0000644�0001750�0001750�00000015575�13715657656�013047� 0����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������0.219 2020-08-15 Released-By: PERLANCAR; Urgency: medium - update(): Allow & pass message.* arguments. 0.218 2020-07-10 Released-By: PERLANCAR; Urgency: medium - Pass _update_id to output, to allow an output module know that the update is done for the same indicator's update(). 0.217 2020-07-09 Released-By: PERLANCAR; Urgency: low - No functional changes. - [doc] Fix typo in example in Synopsis. 0.216 2020-07-09 Released-By: PERLANCAR; Urgency: medium - Add reset(). - Add optional argument 'force_update' to update(). 0.215 2020-06-21 Released-By: PERLANCAR; Urgency: medium - Output: Accept -optname => optval, ... as an alternative to {optname=>val, ...} syntax, to ease specifying on perl one-liners using -M CLI option. - [doc] Mention Progress::Any::Examples. 0.214 2018-03-26 Released-By: PERLANCAR - Forget to remove old code. 0.213 2018-03-26 Released-By: PERLANCAR - [Incompatible change] [internal] Remove output_data structure, store state in output objects directly. This simplifies things a bit. - [Bugfix][Regression] Initialize parent indicators with target=0 so percent-completion can be calculated. 0.212 2018-03-16 Released-By: PERLANCAR - Make regex to parse template available as package variable '$template_regex'. - fill_template(): Accept handle_unknown_conversion option to handle unknown conversion. 0.211 2018-03-17 Released-By: PERLANCAR - [Incompatible change] update(): Rename 'level' argument to 'priority'. High-priority updates are now not frequency-throttled. - [Bugfix] Indicator object's target was not initially set to undef but to 0. - Don't frequency-throttle update to output that has freq = 0. - Read output module data via output_data(). - [doc] Fix/update/add examples. 0.210 2018-03-16 Released-By: PERLANCAR - Observe PROGRESS environment variable to let user turn off progress updating. 0.20 2015-01-27 Released-By: PERLANCAR - Merge Progress::Any::Output back from separate distribution Progress-Any-Output to Progress-Any (similar to what is done with Log-Any vs Log-Any-Adapter). 0.19 2015-01-22 Released-By: PERLANCAR - Allow message to be coderef for delaying costly calculation, will be converted to string when sent to output. 0.18 2014-10-14 Released-By: PERLANCAR - No functional changes. - Work around Pod::Weaver's quirks (the screenshots HTML ended up in the Status section). 0.17 2014-10-14 Released-By: PERLANCAR - No functional changes. - Include screenshots. 0.16 2014-10-14 Released-By: PERLANCAR - No functional changes. - Show usage example with Perinci::CmdLine. 0.15 2014-07-29 Released-By: SHARYANTO - No functional changes. - Fix Synopsis [RT#97563]. 0.14 2014-05-01 Released-By: SHARYANTO - No functional changes. - Temporarily make template test release testing only due to being timing-related and fail on some CT machines [CT]. 0.13 2014-02-26 Released-By: SHARYANTO - Add frequency limiting for updating outputs. Currently set at (at most per) 0.5s. Will be configurable in the future. 0.12 2013-09-11 Released-By: SHARYANTO - No functional changes. Temporarily put some tests (elapsed, etc) on RELEASE_TESTING due to fragility of timing/sleep. Will need to use time mocking in the future [CT]. 0.11 2013-09-08 Released-By: SHARYANTO - No functional changes. Increase granularity of elapsed tests from 0.05s to 1s due to faliure in many systems [CT]. 0.10 2013-09-03 Released-By: SHARYANTO - Rework internals and some API. This is the second API revision. [ENHANCEMENTS] - Allow reinitializing 'pos' and 'target' Released-By: and all other rw attributes at subsequent get_indicator() for the same task. This is to make program more predictable, instead of silently ignoring parameters. - Allow indicator to be start()'ed and stop()'ed at any time. - Add task title (in addition to its name). - Allow specifying estimated remaining of a task when creating an indicator, via passing 'remaining'. - New fill templates: %r (remaining time), %R (remaining time or elapsed time). [INCOMPATIBLE CHANGES] - The $progress export is now set to the root ('') indicator instead of 'main', so it includes all indicators. - fill_template(): re-rationalize template names: %a Released-By: elapsed time becomes %e, %c (pos) becomes %P, %C (target) becomes %T, %t (task name) becomes %n. [REMOVED FEATURES] - Remove 'status' in update() because it is unneeded (concerning outputs can use 'message' instead). 0.09 2013-05-18 Released-By: SHARYANTO - Bugfix: double counting of children's targets. 0.08 2013-05-18 Released-By: SHARYANTO - Bugfix: update() didn't recognize 'finished' parameter. - Maintain a root-level indicator (task='') to capture updates from all progress indicators. 0.07 2013-05-18 Released-By: SHARYANTO [ENHANCEMENTS] - Add total_target(). 0.06 2013-05-18 Released-By: SHARYANTO [INCOMPATIBLE CHANGES] - Change default task in get_indicator() to be caller's package, not subroutine. 0.05 2013-05-18 Released-By: SHARYANTO; Note: Happy birthday, bro! [INCOMPATIBLE CHANGES] - Revise API, now more resembles Log::Any and incompatible with previous version of Progress::Any. Split output to Progress-Any-Output (like Log-Any-Adapter is split from Log-Any), remove set_output(). Remove init() and replace it with pos() and target() because we might need to reinit (reset pos and target) any time. Remove 'inc' argument in update() to make things more orthogonal (you can always do update(pos => $progress->pos + $x). Check task syntax in get_indicator(). [ENHANCEMENTS] - API: parent indicators now get update()'d also whenever we do update()/pos($val)/target($val) on an indicator. - Progress::Any is now the one which is responsible for calculating elapsed time/ETA/% completion. Output now just displays stuffs. This makes output simpler and reduce duplicated code. 0.04 2013-01-10 Released-By: SHARYANTO - No functional changes. More POD tweaks/fixes. 0.03 2013-01-10 Released-By: SHARYANTO - No functional changes. Update/fix Synopsis. 0.02 2012-10-24 Released-By: SHARYANTO - Some tweaks/fixes: don't pre-init $progress, give default message to reset() and finish(). 0.01 2012-10-24 Released-By: SHARYANTO - First, early release. �����������������������������������������������������������������������������������������������������������������������������������Progress-Any-0.219/MANIFEST�������������������������������������������������������������������������0000644�0001750�0001750�00000000520�13715657656�012665� 0����������������������������������������������������������������������������������������������������ustar �u1������������������������������u1���������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.012. Changes LICENSE MANIFEST META.json META.yml Makefile.PL README dist.ini lib/Progress/Any.pm lib/Progress/Any/Output.pm lib/Progress/Any/Output/Null.pm t/00-compile.t t/01-basics.t t/author-critic.t t/author-pod-coverage.t t/author-pod-syntax.t weaver.ini ����������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������������