Text-Aligner-0.16000755000764000764 013652312404 14240 5ustar00shlomifshlomif000000000000README100644000764000764 142413652312404 15202 0ustar00shlomifshlomif000000000000Text-Aligner-0.16Text::Aligner A module to align text. INSTALLATION To install this module, run the following commands: perl Build.PL ./Build ./Build test ./Build install Alternatively, you should use your favourite CPAN client or distribution's package manager. SUPPORT AND DOCUMENTATION After installing, you can find documentation for this module with the perldoc command. perldoc Text::Aligner You can also look for information at: MetaCPAN http://metacpan.org/release/Text-Aligner CPAN Request Tracker: http://rt.cpan.org/NoAuth/Bugs.html?Dist=Text::Aligner COPYRIGHT AND LICENCE Copyright (c) 2002 Anno Siegel. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Changes100644000764000764 373113652312404 15620 0ustar00shlomifshlomif000000000000Text-Aligner-0.16Revision history for Perl extension Text::Aligner. 0.16 2020-04-29 - Fix a $VERSION mismatch in lib/Text/Aligner.pm . - Thanks to "[Tux]". 0.15 2020-04-28 - POD documentation cleanups - avoid using PodWeaver. - Thanks to "[Tux]". - The License is ISC. 0.14 2020-04-28 - Port dist.ini to @SHLOMIF, thus avoiding author tests in t/*.t. 0.13 2016-04-17 - Eliminate a warning "Negative repeat count does nothing" in recent perl5s in the test suite. - https://rt.cpan.org/Ticket/Display.html?id=113841 - Thanks to KENTNL for the report and SREZIC for some guidance. 0.12 2014-10-19 - Relicensed under the ISC license (with ANNO's permission). - Better documentation. 0.11 2014-10-10 - More meaningful README. - https://rt.cpan.org/Public/Bug/Display.html?id=99412 - Thanks to MITHALDU for the report. 0.10 2014-02-04 - Now requiring Term::ANSIColor version 2.02. - First version with the colorstrip() function. - Fixes some CPAN Testers failures on older perls. - Remove some *~ files. 0.09 2014-02-01 - Convert to Dist-Zilla / dist.ini for better CPANTS Kwalitee. - Various changes were involved. 0.08 2013-10-03 Correct typos. Thanks to dsteinbrunner for the report. - https://rt.cpan.org/Public/Bug/Display.html?id=89035 0.07 2010-09-12 One colorskip-dependent test moved into skip block as per rt. #61276 0.06 2010-08-28 bug fix: auto alignment didn't recognize colorized numbers 0.05 2010-08-28 added color support to aligner 0.04 2010-05-05 Tests fail with perl 5.130 (this righted itself, not released) 0.03 2004-05-04 Corrected a slew of (spurious) warnings during tests See rt.cpan.org: Bug #6208 Warnings in make test 0.02 2002-12-03 0.01 2002-11-11 - original version; created by ExtUtils::ModuleMaker 0.204 - initial release to CPAN 03.12.02 LICENSE100644000764000764 162113652312404 15326 0ustar00shlomifshlomif000000000000Text-Aligner-0.16The ISC License. ---------------------------------------------------------------------------- Copyright (c) 2002-2011, Anno Siegel Copyright (c) 2011, Shlomi Fish Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dist.ini100644000764000764 34313652312404 15745 0ustar00shlomifshlomif000000000000Text-Aligner-0.16name = Text-Aligner author = Shlomi Fish license = ISC copyright_holder = Anno Siegel copyright_year = 2002 version = 0.16 [@Filter] -bundle = @SHLOMIF -remove = License -remove = Readme dist = Text-Aligner META.yml100644000764000764 2346513652312404 15624 0ustar00shlomifshlomif000000000000Text-Aligner-0.16--- abstract: 'module to align text.' author: - 'Shlomi Fish ' build_requires: File::Spec: '0' IO::Handle: '0' IPC::Open3: '0' Module::Build: '0.28' Test::More: '0.88' constant: '0' configure_requires: ExtUtils::MakeMaker: '0' Module::Build: '0.28' dynamic_config: 0 generated_by: 'Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010' license: open_source meta-spec: url: http://module-build.sourceforge.net/META-spec-v1.4.html version: '1.4' name: Text-Aligner provides: Text::Aligner: file: lib/Text/Aligner.pm version: '0.16' Text::Aligner::Auto: file: lib/Text/Aligner.pm version: '0.16' Text::Aligner::MaxKeeper: file: lib/Text/Aligner.pm version: '0.16' requires: Exporter: '0' Term::ANSIColor: '2.02' perl: '5.008' strict: '0' vars: '0' warnings: '0' resources: bugtracker: https://github.com/shlomif/text-aligner/issues homepage: http://metacpan.org/release/Text-Aligner repository: git://github.com/shlomif/text-aligner.git version: '0.16' x_Dist_Zilla: perl: version: '5.030002' plugins: - class: Dist::Zilla::Plugin::Prereqs config: Dist::Zilla::Plugin::Prereqs: phase: test type: requires name: '@Filter/TestMoreDoneTesting' version: '6.014' - class: Dist::Zilla::Plugin::AutoPrereqs name: '@Filter/AutoPrereqs' version: '6.014' - class: Dist::Zilla::Plugin::ExecDir name: '@Filter/ExecDir' version: '6.014' - 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: '@Filter/GatherDir' version: '6.014' - class: Dist::Zilla::Plugin::ManifestSkip name: '@Filter/ManifestSkip' version: '6.014' - class: Dist::Zilla::Plugin::MetaYAML name: '@Filter/MetaYAML' version: '6.014' - class: Dist::Zilla::Plugin::PruneCruft name: '@Filter/PruneCruft' version: '6.014' - class: Dist::Zilla::Plugin::RunExtraTests config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Filter/RunExtraTests' version: '0.029' - class: Dist::Zilla::Plugin::ShareDir name: '@Filter/ShareDir' version: '6.014' - class: Dist::Zilla::Plugin::MakeMaker config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Filter/MakeMaker' version: '6.014' - class: Dist::Zilla::Plugin::CheckChangesHasContent name: '@Filter/CheckChangesHasContent' version: '0.011' - class: Dist::Zilla::Plugin::ConfirmRelease name: '@Filter/ConfirmRelease' version: '6.014' - class: Dist::Zilla::Plugin::Manifest name: '@Filter/Manifest' version: '6.014' - class: Dist::Zilla::Plugin::MetaConfig name: '@Filter/MetaConfig' version: '6.014' - class: Dist::Zilla::Plugin::MetaJSON name: '@Filter/MetaJSON' version: '6.014' - class: Dist::Zilla::Plugin::MetaProvides::Package config: Dist::Zilla::Plugin::MetaProvides::Package: finder_objects: - class: Dist::Zilla::Plugin::FinderCode name: '@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.014' include_underscores: 0 Dist::Zilla::Role::MetaProvider::Provider: $Dist::Zilla::Role::MetaProvider::Provider::VERSION: '2.002004' inherit_missing: '1' inherit_version: '1' meta_noindex: '1' Dist::Zilla::Role::ModuleMetadata: Module::Metadata: '1.000036' version: '0.006' name: '@Filter/MetaProvides::Package' version: '2.004003' - class: Dist::Zilla::Plugin::MetaResources name: '@Filter/MetaResources' version: '6.014' - class: Dist::Zilla::Plugin::ModuleBuild config: Dist::Zilla::Role::TestRunner: default_jobs: 1 name: '@Filter/ModuleBuild' version: '6.014' - class: Dist::Zilla::Plugin::PkgVersion name: '@Filter/PkgVersion' version: '6.014' - class: Dist::Zilla::Plugin::PodCoverageTests name: '@Filter/PodCoverageTests' version: '6.014' - class: Dist::Zilla::Plugin::PodSyntaxTests name: '@Filter/PodSyntaxTests' version: '6.014' - 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: '@Filter/Test::Compile' version: '2.058' - class: Dist::Zilla::Plugin::Test::CPAN::Changes config: Dist::Zilla::Plugin::Test::CPAN::Changes: changelog: Changes name: '@Filter/Test::CPAN::Changes' version: '0.012' - class: Dist::Zilla::Plugin::Test::EOL config: Dist::Zilla::Plugin::Test::EOL: filename: xt/author/eol.t finder: - ':ExecFiles' - ':InstallModules' - ':TestFiles' trailing_whitespace: 1 name: '@Filter/Test::EOL' version: '0.19' - class: Dist::Zilla::Plugin::Test::NoTabs config: Dist::Zilla::Plugin::Test::NoTabs: filename: xt/author/no-tabs.t finder: - ':InstallModules' - ':ExecFiles' - ':TestFiles' name: '@Filter/Test::NoTabs' version: '0.15' - class: Dist::Zilla::Plugin::Test::TrailingSpace name: '@Filter/Test::TrailingSpace' version: 0.2.0 - class: Dist::Zilla::Plugin::TestRelease name: '@Filter/TestRelease' version: '6.014' - 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::Plugin::SingleEncoding name: '@Default/SingleEncoding' version: '4.015' - class: Pod::Weaver::Section::Name name: '@Default/Name' version: '4.015' - class: Pod::Weaver::Section::Version name: '@Default/Version' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Default/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: '@Default/Leftovers' version: '4.015' - class: Pod::Weaver::Section::Region name: '@Default/postlude' version: '4.015' - class: Pod::Weaver::Section::Authors name: '@Default/Authors' version: '4.015' - class: Pod::Weaver::Section::Legal name: '@Default/Legal' version: '4.015' name: '@Filter/PodWeaver' version: '4.008' - class: Dist::Zilla::Plugin::UploadToCPAN name: '@Filter/UploadToCPAN' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':InstallModules' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':IncModules' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':TestFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ExtraTestFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ExecFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':PerlExecFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':ShareFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':MainModule' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':AllFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: ':NoFiles' version: '6.014' - class: Dist::Zilla::Plugin::FinderCode name: '@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM' version: '6.014' zilla: class: Dist::Zilla::Dist::Builder config: is_trial: '0' version: '6.014' x_generated_by_perl: v5.30.2 x_serialization_backend: 'YAML::Tiny version 1.73' MANIFEST100644000764000764 64613652312404 15440 0ustar00shlomifshlomif000000000000Text-Aligner-0.16# This file was automatically generated by Dist::Zilla::Plugin::Manifest v6.014. Build.PL Changes LICENSE MANIFEST MANIFEST.SKIP META.json META.yml Makefile.PL README dist.ini inc/Test/Run/Builder.pm lib/Text/Aligner.pm scripts/tag-release.pl t/00-compile.t t/01_ini.t t/10_Aligner.t xt/author/eol.t xt/author/no-tabs.t xt/author/pod-coverage.t xt/author/pod-syntax.t xt/release/cpan-changes.t xt/release/trailing-space.t Build.PL100644000764000764 244113652312404 15616 0ustar00shlomifshlomif000000000000Text-Aligner-0.16 # This file was automatically generated by Dist::Zilla::Plugin::ModuleBuild v6.014. use strict; use warnings; use Module::Build 0.28; my %module_build_args = ( "build_requires" => { "Module::Build" => "0.28" }, "configure_requires" => { "ExtUtils::MakeMaker" => 0, "Module::Build" => "0.28" }, "dist_abstract" => "module to align text.", "dist_author" => [ "Shlomi Fish " ], "dist_name" => "Text-Aligner", "dist_version" => "0.16", "license" => "open_source", "module_name" => "Text::Aligner", "recursive_test_files" => 1, "requires" => { "Exporter" => 0, "Term::ANSIColor" => "2.02", "perl" => "5.008", "strict" => 0, "vars" => 0, "warnings" => 0 }, "test_requires" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.88", "constant" => 0 } ); my %fallback_build_requires = ( "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Module::Build" => "0.28", "Test::More" => "0.88", "constant" => 0 ); unless ( eval { Module::Build->VERSION(0.4004) } ) { delete $module_build_args{test_requires}; $module_build_args{build_requires} = \%fallback_build_requires; } my $build = Module::Build->new(%module_build_args); $build->create_build_script; META.json100644000764000764 3715513652312404 15775 0ustar00shlomifshlomif000000000000Text-Aligner-0.16{ "abstract" : "module to align text.", "author" : [ "Shlomi Fish " ], "dynamic_config" : 0, "generated_by" : "Dist::Zilla version 6.014, CPAN::Meta::Converter version 2.150010", "license" : [ "open_source" ], "meta-spec" : { "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec", "version" : 2 }, "name" : "Text-Aligner", "prereqs" : { "build" : { "requires" : { "Module::Build" : "0.28" } }, "configure" : { "requires" : { "ExtUtils::MakeMaker" : "0", "Module::Build" : "0.28" } }, "develop" : { "requires" : { "Pod::Coverage::TrustPod" : "0", "Test::CPAN::Changes" : "0.19", "Test::EOL" : "0", "Test::More" : "0.96", "Test::NoTabs" : "0", "Test::Pod" : "1.41", "Test::Pod::Coverage" : "1.08", "Test::TrailingSpace" : "0.0203" } }, "runtime" : { "requires" : { "Exporter" : "0", "Term::ANSIColor" : "2.02", "perl" : "5.008", "strict" : "0", "vars" : "0", "warnings" : "0" } }, "test" : { "requires" : { "File::Spec" : "0", "IO::Handle" : "0", "IPC::Open3" : "0", "Test::More" : "0.88", "constant" : "0" } } }, "provides" : { "Text::Aligner" : { "file" : "lib/Text/Aligner.pm", "version" : "0.16" }, "Text::Aligner::Auto" : { "file" : "lib/Text/Aligner.pm", "version" : "0.16" }, "Text::Aligner::MaxKeeper" : { "file" : "lib/Text/Aligner.pm", "version" : "0.16" } }, "release_status" : "stable", "resources" : { "bugtracker" : { "web" : "https://github.com/shlomif/text-aligner/issues" }, "homepage" : "http://metacpan.org/release/Text-Aligner", "repository" : { "type" : "git", "url" : "git://github.com/shlomif/text-aligner.git", "web" : "https://github.com/shlomif/text-aligner" } }, "version" : "0.16", "x_Dist_Zilla" : { "perl" : { "version" : "5.030002" }, "plugins" : [ { "class" : "Dist::Zilla::Plugin::Prereqs", "config" : { "Dist::Zilla::Plugin::Prereqs" : { "phase" : "test", "type" : "requires" } }, "name" : "@Filter/TestMoreDoneTesting", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::AutoPrereqs", "name" : "@Filter/AutoPrereqs", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::ExecDir", "name" : "@Filter/ExecDir", "version" : "6.014" }, { "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" : "@Filter/GatherDir", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::ManifestSkip", "name" : "@Filter/ManifestSkip", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaYAML", "name" : "@Filter/MetaYAML", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::PruneCruft", "name" : "@Filter/PruneCruft", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::RunExtraTests", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Filter/RunExtraTests", "version" : "0.029" }, { "class" : "Dist::Zilla::Plugin::ShareDir", "name" : "@Filter/ShareDir", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MakeMaker", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Filter/MakeMaker", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::CheckChangesHasContent", "name" : "@Filter/CheckChangesHasContent", "version" : "0.011" }, { "class" : "Dist::Zilla::Plugin::ConfirmRelease", "name" : "@Filter/ConfirmRelease", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::Manifest", "name" : "@Filter/Manifest", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaConfig", "name" : "@Filter/MetaConfig", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaJSON", "name" : "@Filter/MetaJSON", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::MetaProvides::Package", "config" : { "Dist::Zilla::Plugin::MetaProvides::Package" : { "finder_objects" : [ { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.014" } ], "include_underscores" : 0 }, "Dist::Zilla::Role::MetaProvider::Provider" : { "$Dist::Zilla::Role::MetaProvider::Provider::VERSION" : "2.002004", "inherit_missing" : 1, "inherit_version" : 1, "meta_noindex" : 1 }, "Dist::Zilla::Role::ModuleMetadata" : { "Module::Metadata" : "1.000036", "version" : "0.006" } }, "name" : "@Filter/MetaProvides::Package", "version" : "2.004003" }, { "class" : "Dist::Zilla::Plugin::MetaResources", "name" : "@Filter/MetaResources", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::ModuleBuild", "config" : { "Dist::Zilla::Role::TestRunner" : { "default_jobs" : 1 } }, "name" : "@Filter/ModuleBuild", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::PkgVersion", "name" : "@Filter/PkgVersion", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::PodCoverageTests", "name" : "@Filter/PodCoverageTests", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::PodSyntaxTests", "name" : "@Filter/PodSyntaxTests", "version" : "6.014" }, { "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" : "@Filter/Test::Compile", "version" : "2.058" }, { "class" : "Dist::Zilla::Plugin::Test::CPAN::Changes", "config" : { "Dist::Zilla::Plugin::Test::CPAN::Changes" : { "changelog" : "Changes" } }, "name" : "@Filter/Test::CPAN::Changes", "version" : "0.012" }, { "class" : "Dist::Zilla::Plugin::Test::EOL", "config" : { "Dist::Zilla::Plugin::Test::EOL" : { "filename" : "xt/author/eol.t", "finder" : [ ":ExecFiles", ":InstallModules", ":TestFiles" ], "trailing_whitespace" : 1 } }, "name" : "@Filter/Test::EOL", "version" : "0.19" }, { "class" : "Dist::Zilla::Plugin::Test::NoTabs", "config" : { "Dist::Zilla::Plugin::Test::NoTabs" : { "filename" : "xt/author/no-tabs.t", "finder" : [ ":InstallModules", ":ExecFiles", ":TestFiles" ] } }, "name" : "@Filter/Test::NoTabs", "version" : "0.15" }, { "class" : "Dist::Zilla::Plugin::Test::TrailingSpace", "name" : "@Filter/Test::TrailingSpace", "version" : "0.2.0" }, { "class" : "Dist::Zilla::Plugin::TestRelease", "name" : "@Filter/TestRelease", "version" : "6.014" }, { "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::Plugin::SingleEncoding", "name" : "@Default/SingleEncoding", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Name", "name" : "@Default/Name", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Version", "name" : "@Default/Version", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/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" : "@Default/Leftovers", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Region", "name" : "@Default/postlude", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Authors", "name" : "@Default/Authors", "version" : "4.015" }, { "class" : "Pod::Weaver::Section::Legal", "name" : "@Default/Legal", "version" : "4.015" } ] } }, "name" : "@Filter/PodWeaver", "version" : "4.008" }, { "class" : "Dist::Zilla::Plugin::UploadToCPAN", "name" : "@Filter/UploadToCPAN", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":InstallModules", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":IncModules", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":TestFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExtraTestFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ExecFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":PerlExecFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":ShareFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":MainModule", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":AllFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : ":NoFiles", "version" : "6.014" }, { "class" : "Dist::Zilla::Plugin::FinderCode", "name" : "@Filter/MetaProvides::Package/AUTOVIV/:InstallModulesPM", "version" : "6.014" } ], "zilla" : { "class" : "Dist::Zilla::Dist::Builder", "config" : { "is_trial" : 0 }, "version" : "6.014" } }, "x_generated_by_perl" : "v5.30.2", "x_serialization_backend" : "Cpanel::JSON::XS version 4.19" } t000755000764000764 013652312404 14424 5ustar00shlomifshlomif000000000000Text-Aligner-0.1601_ini.t100644000764000764 33413652312404 16010 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/t# t/01_ini.t; just to load Text::Aligner by using it $|++; print "1..1 "; my($test) = 1; # 1 load use Text::Aligner; my($loaded) = 1; $loaded ? print "ok $test " : print "not ok $test "; $test++; # end of t/01_ini.t Makefile.PL100644000764000764 273013652312404 16275 0ustar00shlomifshlomif000000000000Text-Aligner-0.16# This file was automatically generated by Dist::Zilla::Plugin::MakeMaker v6.014. use strict; use warnings; use 5.008; use ExtUtils::MakeMaker; my %WriteMakefileArgs = ( "ABSTRACT" => "module to align text.", "AUTHOR" => "Shlomi Fish ", "BUILD_REQUIRES" => { "Module::Build" => "0.28" }, "CONFIGURE_REQUIRES" => { "ExtUtils::MakeMaker" => 0, "Module::Build" => "0.28" }, "DISTNAME" => "Text-Aligner", "LICENSE" => "open_source", "MIN_PERL_VERSION" => "5.008", "NAME" => "Text::Aligner", "PREREQ_PM" => { "Exporter" => 0, "Term::ANSIColor" => "2.02", "strict" => 0, "vars" => 0, "warnings" => 0 }, "TEST_REQUIRES" => { "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Test::More" => "0.88", "constant" => 0 }, "VERSION" => "0.16", "test" => { "TESTS" => "t/*.t" } ); my %FallbackPrereqs = ( "Exporter" => 0, "File::Spec" => 0, "IO::Handle" => 0, "IPC::Open3" => 0, "Module::Build" => "0.28", "Term::ANSIColor" => "2.02", "Test::More" => "0.88", "constant" => 0, "strict" => 0, "vars" => 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); MANIFEST.SKIP100644000764000764 313652312404 16130 0ustar00shlomifshlomif000000000000Text-Aligner-0.16~$ 10_Aligner.t100644000764000764 1273213652312404 16657 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/tuse Test::More; use strict; my $n_tests; use Text::Aligner 0.16; use Term::ANSIColor; use constant HAVE_COLORSTRIP => defined &Term::ANSIColor::colorstrip; # MaxKeeper BEGIN { $n_tests += 7 } my $mk = Text::Aligner::MaxKeeper->new; is( $mk->max, undef); $mk->remember( $_) for 0, 5, 3, -1, 5, 1; is( $mk->max, 5); $mk->forget( -1); is( $mk->max, 5); $mk->forget( 5); is( $mk->max, 5); $mk->forget( 5); is( $mk->max, 3); $mk->remember( 3); $mk->remember( 2); $mk->forget( 3); is( $mk->max, 3); $mk->forget( 3); is( $mk->max, 2); # _compile_alispec BEGIN { $n_tests += 6 } BEGIN { *_compile_alispec = \ &Text::Aligner::_compile_alispec } my @specs = qw( left center right num); is( ref( ( _compile_alispec( $_))[ 1]), 'CODE') for @specs, 0.5, 'num(,)', sub {}; # expected positions for combinations of string/specification BEGIN { $n_tests += 12*7 } # number of strings * number of specs no warnings 'qw'; my @strings = ( '', qw( x xy xyx xxxyxxxxxx 0 1 1. 12.13 .9 123 6,3)); my %ans = ( left => [ 0, qw( 0 0 0 0 0 0 0 0 0 0 0)], center => [ 0, qw( 0 1 1 5 0 0 1 2 1 1 1)], right => [ 0, qw( 1 2 3 10 1 1 2 5 2 3 3)], num => [ 0, qw( 1 2 3 10 1 1 1 2 0 3 3)], 'num(,)' => [ 0, qw( 1 2 3 10 1 1 2 5 2 3 1)], qr/x/ => [ 0, qw( 0 0 0 0 1 1 2 5 2 3 3)], qr/y/ => [ 0, qw( 1 1 1 3 1 1 2 5 2 3 3)], ); while ( my ( $spec, $ans) = each %ans ) { my @ans = @$ans; my $use_spec = $spec; $use_spec = qr/$use_spec/ if $use_spec =~ /\(\?/; # de-stringify Regex my $code = ( _compile_alispec( $use_spec))[ 1]; # the width is not tested for my $str ( @strings ) { my $wanted = shift @ans; my $got = $code->( $str); my $showstr = "'$str'"; is( "($spec, $showstr) -> $got", "($spec, $showstr) -> $wanted"); } } # Text::Aligner class BEGIN { $n_tests += 1 } # number recognition BEGIN { $n_tests += 2 } ok(Text::Aligner::_is_number(12.3)); ok(!Text::Aligner::_is_number('abc')); # moved to SKIP block # ok(Text::Aligner::_is_number(colored('123', 'red'))); my $ali = Text::Aligner->new; is( ref $ali, 'Text::Aligner'); # full sample # undef, '', ' ', qw( Z xxZ xxxxxxxxxZ 0 19 .1 9. 9.11 11119.1 1119.11111); # reduced sample for distribution use constant STRINGS => undef, qw( Z xxxxZ 0 9.11 1119.111111); use constant SPECS => qw( left center right num auto); BEGIN { my $nstr = @{ [ STRINGS ]}; my $nspec = @{ [ SPECS ]}; $n_tests += $nspec*( $nstr + 2*$nstr*$nstr); # according to program below } for my $spec ( SPECS ) { my $ali = Text::Aligner->new( $spec); for my $str ( STRINGS ) { my $res = $ali->_justify( $str); my $diag = 'ok'; my $strout = defined $str ? $str : ''; $diag = "new $spec-aligner justifies '$strout' to '$res'" unless $strout eq $res; is( $diag, 'ok'); } for my $init ( STRINGS ) { $ali->_alloc( $init); for my $str ( STRINGS ) { my $res = $ali->_justify( $str); my $diag = ''; defined $init or $init = ''; if ( length( $res) != length( $init) ) { $diag = "$spec-aligner with '$init' justifies '$str' to '$res' (length)"; } is( $diag, ''); $diag = ''; defined $str or $str = ''; if ( $spec =~ /num/ and $str =~ /[9Z]/ and $init =~ /[9Z]/ ) { my $initloc = index( $init, '9'); $initloc = index( $init, 'Z') if $init =~ /Z/; my $resloc = index( $res, '9'); $resloc = index( $res, 'Z') if $res =~ /Z/; $diag = ( $initloc != $resloc); } $diag = "$spec-aligner with '$init' justifies '$str' to '$res' (pos)" if $diag; is( $diag, ''); } $ali->_forget( $init); } } # align() function BEGIN { $n_tests += 21 } use Text::Aligner qw( align); ok( defined &align); # Basic functionality my @col = qw( just a test!); my @save_col = @col; # copy for later my @res = align( '', @col); is( $res[ 0], 'just '); is( $res[ 1], 'a '); is( $res[ 2], 'test!'); # scalar context my $res = align( 'right', @col); is( $res, " just\n a\ntest!\n"); # original unchanged? is( join( '|', @col), join( '|', @save_col)); # in-place alignment align( '', @col); is( $col[ 0], 'just '); is( $col[ 1], 'a '); is( $col[ 2], 'test!'); # scalar deref (not sure i like this feature) @col = @save_col; my $scalar = 'now'; align( '', $col[ 0], \ $col[ 1], $col[ 2], \ $scalar); is( $col[ 0], 'just '); is( $col[ 1], 'a '); is( $col[ 2], 'test!'); is( $scalar, 'now '); # color support SKIP: { my $ver = $Term::ANSIColor::VERSION; skip( "Term::ANSIColor $ver doesn't support colorstrip", 6, ) unless HAVE_COLORSTRIP; *colorstrip = \ &Term::ANSIColor::colorstrip; my @col = ( 'Just', colored('a', 'green'), colored('test!', 'bold'), colored(123.456, 'red'), colored( 12, 'red'), ); my @res = align( 'auto', @col); my @ref = align( 'auto', map colorstrip($_), @col); my @check = map colorstrip($_), @res; is($check[$_], $ref[$_], "color support $_") for 0 .. $#col; ok(Text::Aligner::_is_number(colored('123', 'red'))); } # fail as expected? eval { align( '', 'wirdnix') }; like( $@, qr/^Modification of a read-only value/ ); BEGIN { plan tests => $n_tests } 00-compile.t100644000764000764 263513652312404 16624 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/tuse 5.006; use strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::Compile 2.058 use Test::More; plan tests => 1 + ($ENV{AUTHOR_TESTING} ? 1 : 0); my @module_files = ( 'Text/Aligner.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}; author000755000764000764 013652312404 16116 5ustar00shlomifshlomif000000000000Text-Aligner-0.16/xteol.t100644000764000764 47213652312404 17205 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/authoruse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::EOL 0.19 use Test::More 0.88; use Test::EOL; my @files = ( 'lib/Text/Aligner.pm', 't/00-compile.t', 't/01_ini.t', 't/10_Aligner.t' ); eol_unix_ok($_, { trailing_whitespace => 1 }) foreach @files; done_testing; Text000755000764000764 013652312404 15653 5ustar00shlomifshlomif000000000000Text-Aligner-0.16/libAligner.pm100644000764000764 3450613652312404 17762 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/lib/Text# Text::Aligner - Align text in columns package Text::Aligner; $Text::Aligner::VERSION = '0.16'; use strict; use warnings; use 5.008; BEGIN { use Exporter (); use vars qw (@ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); @ISA = qw (Exporter); @EXPORT = qw (); @EXPORT_OK = qw ( align); %EXPORT_TAGS = (); } # this is a non-method, and currently the only user interface sub align ($@) { my $ali = Text::Aligner->new( shift); $ali->_alloc( map ref eq 'SCALAR' ? $$_ : $_, @_); if ( defined wantarray ) { my @just = map $ali->_justify( ref eq 'SCALAR' ? $$_ : $_), @_; return @just if wantarray; return join "\n", @just, ''; } else { for ( @_ ) { $_ = $ali->_justify( $_) for ref eq 'SCALAR' ? $$_ : $_; # one-shot } } } ### class Text::Aligner sub _new { # internal constructor my $class = shift; my ( $width, $pos) = @_; # both method-or-coderef (this is very general) bless { width => $width, pos => $pos, left => Text::Aligner::MaxKeeper->new, right => Text::Aligner::MaxKeeper->new, }, $class; } # Construct an aligner sub new { my ( $class, $spec) = @_; $spec ||= 0; # left alignment is default my $al; if ( !ref( $spec) and $spec =~ s/^auto/num/ ) { $al = Text::Aligner::Auto->_new( $spec); } else { $al = $class->_new( _compile_alispec( $spec)); } $al; } # return left and right field widths for an object sub _measure0 { my $al = shift; my $obj = shift; $obj = '' unless defined $obj; my ( $w, $p); if ( ref $obj ) { ( $w, $p) = ( $obj->$al->{ width}->(), $obj->$al->{ pos}->() ); } else { ( $w, $p) = ( $al->{ width}->( $obj), $al->{ pos}->( $obj) ); } $_ ||= 0 for $w, $p; ( $p, $w - $p); } use Term::ANSIColor 2.02; # return left and right field widths for an object sub _measure { my $al = shift; my $obj = shift; $obj = '' unless defined $obj; my ( $wmeth, $pmeth) = @{ $al}{ qw( width pos)}; # support colorized strings $obj = Term::ANSIColor::colorstrip($obj) unless ref $obj; my $w = ref $wmeth ? $wmeth->( $obj) : $obj->$wmeth; my $p = ref $pmeth ? $pmeth->( $obj) : $obj->$pmeth; $_ ||= 0 for $w, $p; ( $p, $w - $p); } # Return left and right maxima, or nothing if the aligner is empty sub _status { my @lr = ( $_[ 0]->{ left}->max, $_[ 0]->{ right}->max); # $l and $r should be both defined or undefined, unless the # MaxKeeper memory is corrupted by forgetting unremembered things. return unless defined( $lr[ 0]) and defined( $lr[ 1]); @lr; } # remember alignment requirements sub _alloc { my $al = shift; for ( @_ ) { # $_ ||= ''; print "allocing '$_'\n"; my ( $l, $r) = $al->_measure( $_); $al->{ left}->remember( $l); # space needed left of pos $al->{ right}->remember( $r); # ...and right of pos } $al; } # release alignment requirement. it disturbs an aligner deeply to forget # things it hasn't remembered. the effects may be delayed. sub _forget { my $al = shift; for ( map defined() ? $_ : '', @_ ) { # print "forgetting '$_'\n"; my ( $l, $r) = $al->_measure( $_); $al->{ left}->forget( $l); $al->{ right}->forget( $r); } $al; } sub _spaces { my ($repeat_count) = @_; return (($repeat_count > 0) ? (' ' x $repeat_count) : ''); } # justify a string. a string is aligned within the aligner's field, and # filled with blanks or cut to size, as appropriate. a string that has # been allocated will never be trimmed (that is the point of allocation). # if the aligner is empty it returns the string unaltered. sub _justify { my $al = shift; my $str = shift; # print "justifying '$str'\n"; $str .= ''; # stringify (objects, numbers, undef) my ( $l_pad, $r_pad) = $al->_padding( $str); substr( $str, 0, -$l_pad) = '' if $l_pad < 0; # trim if negative substr( $str, $r_pad) = '' if $r_pad < 0; # ... both ends return _spaces($l_pad) . $str . _spaces($r_pad); # pad if positive } # return two numbers that indicate how many blanks are needed on each side # of a string to justify it. Negative values mean trim that many characters. # an empty aligner returns ( 0, 0), so doesn't change anything. sub _padding { my $al = shift; my $str = shift; my ( $this_l, $this_r) = $al->_measure( $str); my ( $l_pad, $r_pad) = ( 0, 0); if ( $al->_status ) { ( $l_pad, $r_pad) = $al->_status; $l_pad -= $this_l; $r_pad -= $this_r; } ( $l_pad, $r_pad); } # _compile_alispec() returns positioners according to specification. In # effect, it is the interpreter for alignment specifications. sub _compile_alispec { # it's a dirty job... my $width = sub { length shift }; # this is always so for string aligners my $pos; # the positioner we actually compile local $_ = shift || ''; # alignment specification if ( ref() eq 'Regexp' ) { my $regex = $_; # lexical copy! $pos = sub { local $_ = shift; return m/$regex/ ? $-[ 0] : length; # assume match after string }; } else { s/^left/0/; s/^center/0.5/; s/^right/1/; if ( _is_number( $_) ) { my $proportion = $_; # use lexical copy $pos = sub { int( $proportion*length shift) }; } elsif ( $_ =~ /^(?:num|point)(?:\((.*))?/ ) { my $point = defined $1 ? $1 : ''; $point =~ s/\)$//; # ignore trailing paren, if present length $point or $point = '.'; $pos = sub { index( shift() . $point, $point) } } else { $pos = sub { 0 }; } } ( $width, $pos); } # decide if a string is a number. (see perlfaq4). sub _is_number { my ($x) = @_; return 0 unless defined $x; return 0 if $x !~ /\d/; return 1 if $x =~ /^-?\d+\.?\d*$/; $x = Term::ANSIColor::colorstrip($x); $x =~ /^-?\d+\.?\d*$/ } package Text::Aligner::Auto; # Combined numeric and left alignment. Numbers are aligned numerically, # other strings are left-aligned. The resulting columns are interleaved # flush left and filled on the right if necessary. $Text::Aligner::Auto::VERSION = '0.16'; sub _new { # only called by Text::Aligner->new() my $class = shift; my $numspec = shift; # currently ignored bless { num => Text::Aligner->new( 'num'), # align numbers among themselves other => Text::Aligner->new, # left-align anything else }, $class; } sub _alloc { my $aa = shift; my @num = grep _is_number( $_), @_; my @other = grep !_is_number( $_), @_; $aa->{ num}->_alloc( @num); $aa->{ other}->_alloc( @other); $aa; } sub _forget { my $aa = shift; $aa->{ num}->_forget( grep _is_number( $_), @_); $aa->{ other}->_forget( grep !_is_number( $_), @_); $aa; } # Justify as required sub _justify { my ( $aa, $str) = @_; # align according to type $str = $aa->{ _is_number( $str) ? 'num' : 'other'}->_justify( $str); my $combi = Text::Aligner->new; # left-justify pre-aligned string # initialise to size of partial aligners. (don't initialise from # empty aligner) $combi->_alloc( $aa->{ num}->_justify( '')) if $aa->{ num}->_status; $combi->_alloc( $aa->{ other}->_justify( '')) if $aa->{ other}->_status; $combi->_justify( $str); } # for convenience BEGIN { # import _is_number() *_is_number = \ &Text::Aligner::_is_number; } package Text::Aligner::MaxKeeper; # Keep the maximum of a dynamic set of numbers. Optimized for the case of # a relatively small range of numbers that may occur repeatedly. $Text::Aligner::MaxKeeper::VERSION = '0.16'; sub new { bless { max => undef, seen => {}, }, shift; } sub max { $_[ 0]->{ max} } sub remember { my ( $mk, $val) = @_; _to_max( $mk->{ max}, $val); $mk->{ seen}->{ $val}++; $mk; } sub forget { my ( $mk, $val) = @_; if ( exists $mk->{ seen}->{ $val} ) { my $seen = $mk->{ seen}; unless ( --$seen->{ $val} ) { delete $seen->{ $val}; if ( $mk->{ max} == $val ) { # lost the maximum, recalculate undef $mk->{ max}; _to_max( $mk->{ max}, keys %$seen); } } } $mk; } sub _to_max { my $var = \ shift; defined $_ and ( not defined $$var or $$var < $_) and $$var = $_ for @_; $$var; } 1; #this line is important and will help the module return a true value __END__ =pod =encoding UTF-8 =head1 NAME Text::Aligner =head1 VERSION version 0.16 =head1 SYNOPSIS use Text::Aligner qw( align ); # Print the words "just a test!" right-justified each on a line: my @lines = align( 'right', qw( just a test!); print "$_\n" for @lines; =head1 DESCRIPTION Text::Aligner exports a single function, align(), which is used to justify strings to various alignment styles. The alignment specification is the first argument, followed by any number of scalars which are subject to alignment. The operation depends on context. In list context, a list of the justified scalars is returned. In scalar context, the justified arguments are joined into a single string with newlines appended. The original arguments remain unchanged. In void context, in-place justification is attempted. In this case, all arguments must be lvalues. Align() also does one level of scalar dereferencing. That is, whenever one of the arguments is a scalar reference, the scalar pointed to is aligned instead. Other references are simply stringified. An undefined argument is interpreted as an empty string without complaint. Alignment respects colorizing escape sequences a la L which means it knows that these sequences don't take up space on the screen. =head1 NAME Text::Aligner - module to align text. =head1 ALIGNMENT The first argument of the align() function is an alignment style, a single scalar. It can be one of the strings "left", "right", "center", "num", "point", or "auto", or a regular expression (qr/.../), or a coderef. A default style of "left" is assumed for every other value, including "" and undef. "left", "right" and "center" have the obvious meanings. These can also be given as numbers 0, 1, and 0.5 respectively. (Other numbers are also possible, but probably not very useful). "num", and its synonym "point", specify that the decimal points be aligned (assumed on the right, unless present). Arbitrary (non-numeric) strings are also aligned in this manner, so they end up one column left of the (possibly assumed) decimal point, flush right with any integers. For the occasional string like "inf", or "-" for missing values, this may be the right place. A string-only column ends up right-aligned (unless there are points present). The "auto" style separates numeric strings (that are composed of "-", ".", and digits in the usual manner) and aligns them numerically. Other strings are left aligned with the number that sticks out farthest to the left. This gives left alignment for string-only columns and numeric alignment for columns of numbers. In mixed columns, strings are reasonably placed to serve as column headings or intermediate titles. With "num" (and "point") it is possible to specify another character for the decimal point in the form "num(,)". In fact, you can specify any string after a leading "(", and the closing ")" is optional. "point(=>)" could be used to align certain pieces of Perl code. This option is currently not available with "auto" alignment (because recognition of numbers is Anglo-centric). If a regular expression is specified, the points are aligned where the first match of the regex starts. A match is assumed immediately after the string if it doesn't match. A regular expression is a powerful way of alignment specification. It can replace most others easily, except center alignment and, of course, the double action of "auto". =head1 POSITIONERS For entirely self-defined forms of alignment, a coderef, also known as a positioner, can be given instead of an alignment style. This code will be called once or more times with the string to be aligned as its argument. It must return two numbers, a width and a position, that describe how to align a string with other strings. The width should normally be the length of the string. The position defines a point relative to the beginning of the string, which is aligned with the positions given for other strings. A zero position for all strings results in left alignment, positioning to the end of the string results in right alignment, and returning half the length gives center alignment. "num" alignment is realized by marking the position of the decimal point. Note that the position you return is a relative measure. Adding a constant value to all positions results in no change in alignment. It doesn't have to point inside the string (as in right alignment, where it points one character past the end of the string). The first return value of a positioner should almost always be the length of the given string. However, it may be useful to lie about the string length if the string contains escape sequences that occupy no place on screen. =head1 SUBROUTINES =head2 align($style, $str) See above. =head2 new(...) For internal use. =head1 USAGE use Text::Aligner qw( align ); align( $style, $str, ...); $style must be given and must be an alignment specification. Any number of scalars can follow. An argument that contains a scalar reference is dereferenced before it is used. In scalar and list context, the aligned strings are returned. In void context, the values are aligned in place and must be lvalues. =head1 BUGS None known as of release, but... =head1 AUTHOR Anno Siegel CPAN ID: ANNO =head1 COPYRIGHT Copyright (c) 2002 Anno Siegel. All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the ISC license. (This program had been licensed under the same terms as Perl itself up to version 1.118 released on 2011, and was relicensed by permission of its originator). The full text of the license can be found in the LICENSE file included with this module. =head1 SEE ALSO perl(1) L . =head1 AUTHOR Shlomi Fish =head1 COPYRIGHT AND LICENSE This software is Copyright (c) 2002 by Anno Siegel. This is free software, licensed under: The ISC License =cut no-tabs.t100644000764000764 44013652312404 17764 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/authoruse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::NoTabs 0.15 use Test::More 0.88; use Test::NoTabs; my @files = ( 'lib/Text/Aligner.pm', 't/00-compile.t', 't/01_ini.t', 't/10_Aligner.t' ); notabs_ok($_) foreach @files; done_testing; scripts000755000764000764 013652312404 15650 5ustar00shlomifshlomif000000000000Text-Aligner-0.16tag-release.pl100644000764000764 70413652312404 20517 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/scripts#!/usr/bin/perl use strict; use warnings; use Path::Tiny qw/ path /; my ($version) = ( map { m{\Aversion * = *(\S+)} ? ($1) : () } path("./dist.ini")->lines_utf8() ); if ( !defined($version) ) { die "Version is undefined!"; } my $PROJECT = "perl-Text-Aligner"; my @cmd = ( "git", "tag", "-m", "Tagging the $PROJECT release as $version", $version, ); print join( " ", map { /\s/ ? qq{"$_"} : $_ } @cmd ), "\n"; exec(@cmd); pod-syntax.t100644000764000764 25213652312404 20530 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/author#!perl # 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(); Run000755000764000764 013652312404 16415 5ustar00shlomifshlomif000000000000Text-Aligner-0.16/inc/TestBuilder.pm100644000764000764 340213652312404 20500 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/inc/Test/Runpackage Test::Run::Builder; use strict; use warnings; use Module::Build; use vars qw(@ISA); @ISA = (qw(Module::Build)); sub ACTION_runtest { my ($self) = @_; my $p = $self->{properties}; $self->depends_on('code'); local @INC = @INC; # Make sure we test the module in blib/ unshift @INC, (File::Spec->catdir($p->{base_dir}, $self->blib, 'lib'), File::Spec->catdir($p->{base_dir}, $self->blib, 'arch')); $self->do_test_run_tests; } sub ACTION_distruntest { my ($self) = @_; $self->depends_on('distdir'); my $start_dir = $self->cwd; my $dist_dir = $self->dist_dir; chdir $dist_dir or die "Cannot chdir to $dist_dir: $!"; # XXX could be different names for scripts $self->run_perl_script('Build.PL') # XXX Should this be run w/ --nouse-rcfile or die "Error executing 'Build.PL' in dist directory: $!"; $self->run_perl_script('Build') or die "Error executing 'Build' in dist directory: $!"; $self->run_perl_script('Build', [], ['runtest']) or die "Error executing 'Build test' in dist directory"; chdir $start_dir; } sub do_test_run_tests { my $self = shift; require Test::Run::CmdLine::Iface; my $test_run = Test::Run::CmdLine::Iface->new( { 'test_files' => [glob("t/*.t")], } # 'backend_params' => $self->_get_backend_params(), ); return $test_run->run(); } sub ACTION_tags { my $self = shift; return $self->do_system( "ctags", qw(-f tags --recurse --totals --exclude=blib/** --exclude=t/lib/** --exclude=**/.svn/** --exclude='*~'), "--exclude=".$self->dist_name()."-*/**", qw(--languages=Perl --langmap=Perl:+.t) ); } 1; pod-coverage.t100644000764000764 33413652312404 20776 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/author#!perl # 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' }); release000755000764000764 013652312404 16234 5ustar00shlomifshlomif000000000000Text-Aligner-0.16/xtcpan-changes.t100644000764000764 34413652312404 21071 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/releaseuse strict; use warnings; # this test was generated with Dist::Zilla::Plugin::Test::CPAN::Changes 0.012 use Test::More 0.96 tests => 1; use Test::CPAN::Changes; subtest 'changes_ok' => sub { changes_file_ok('Changes'); }; trailing-space.t100644000764000764 103413652312404 21461 0ustar00shlomifshlomif000000000000Text-Aligner-0.16/xt/release#!perl use strict; use warnings; use Test::More; eval "use Test::TrailingSpace"; if ($@) { plan skip_all => "Test::TrailingSpace required for trailing space test."; } else { plan tests => 1; } # TODO: add .pod, .PL, the README/Changes/TODO/etc. documents and possibly # some other stuff. my $finder = Test::TrailingSpace->new( { root => '.', filename_regex => qr#(?:\.(?:t|pm|pl|xs|c|h|txt|pod|PL)|README|Changes|TODO|LICENSE)\z#, }, ); # TEST $finder->no_trailing_space( "No trailing space was found." );