From 72315629c1021400bef5c49c1ddbd268b1f359a7 Mon Sep 17 00:00:00 2001 From: Stanislaw Pusep Date: Tue, 12 Feb 2013 19:06:35 -0200 Subject: [PATCH] CPANification --- .gitignore | 3 +++ Build.PL | 49 +++++++++++++++++++++++++++++++++++++++ Changes | 25 ++++++++++++++++++++ LICENSE | 6 ++--- MANIFEST | 22 ++++++++++++++++++ lib/App/rainbarf.pm | 36 ++++++++++++++++++++++++++++ rainbarf | 2 +- t/00-compile.t | 8 +++++++ t/author-critic.t | 20 ++++++++++++++++ t/author-test-eol.t | 17 ++++++++++++++ t/release-cpan-changes.t | 15 ++++++++++++ t/release-distmeta.t | 15 ++++++++++++ t/release-kwalitee.t | 17 ++++++++++++++ t/release-mojibake.t | 20 ++++++++++++++++ t/release-no-tabs.t | 16 +++++++++++++ t/release-pod-coverage.t | 21 +++++++++++++++++ t/release-pod-linkcheck.t | 28 ++++++++++++++++++++++ t/release-pod-syntax.t | 15 ++++++++++++ t/release-portability.t | 16 +++++++++++++ t/release-test-version.t | 30 ++++++++++++++++++++++++ 20 files changed, 377 insertions(+), 4 deletions(-) create mode 100644 Build.PL create mode 100644 Changes create mode 100644 MANIFEST create mode 100644 lib/App/rainbarf.pm create mode 100644 t/00-compile.t create mode 100644 t/author-critic.t create mode 100644 t/author-test-eol.t create mode 100644 t/release-cpan-changes.t create mode 100644 t/release-distmeta.t create mode 100644 t/release-kwalitee.t create mode 100644 t/release-mojibake.t create mode 100644 t/release-no-tabs.t create mode 100644 t/release-pod-coverage.t create mode 100644 t/release-pod-linkcheck.t create mode 100644 t/release-pod-syntax.t create mode 100644 t/release-portability.t create mode 100644 t/release-test-version.t diff --git a/.gitignore b/.gitignore index c15b52a..72369db 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,9 @@ Makefile Makefile.old MANIFEST.bak META.yml +META.json +MYMETA.json MYMETA.yml nytprof.out pm_to_blib +App-rainbarf-*/* diff --git a/Build.PL b/Build.PL new file mode 100644 index 0000000..69ae604 --- /dev/null +++ b/Build.PL @@ -0,0 +1,49 @@ +#!/usr/bin/perl + +=head1 NAME + +Build.PL - Build script generator for App::rainbarf + +=head1 SYNOPSIS + + perl Build.PL + ./Build test + ./Build install + +=cut + +use 5.008; +use strict; +use warnings; +use Module::Build; + +my $build = Module::Build->new( + module_name => 'App::rainbarf', + dist_abstract => 'CPU/RAM/battery stats chart bar for tmux (and GNU screen)', + script_files => ['rainbarf'], + + license => 'perl', + create_license => 1, + + build_requires => { + 'English' => '1.00', + 'Test::More' => '0.45', + }, + configure_requires => { 'Module::Build' => '0.28' }, + requires => { + 'Getopt::Long' => '2.32', + 'List::Util' => '1.07_00', + 'Pod::Usage' => '1.14', + 'Storable' => '2.04', + 'Term::ANSIColor' => '1.04', + }, +); +$build->create_build_script; + +__END__ + +=head1 AUTHOR + +Stanislaw Pusep + +=cut diff --git a/Changes b/Changes new file mode 100644 index 0000000..8b3ec09 --- /dev/null +++ b/Changes @@ -0,0 +1,25 @@ +Changelog for App-rainbarf + +v0.3 2013-02-11T23:39:00 + [Stanislaw Pusep ] + - This release uses the "CPU utilization %" metric instead of the "load average" by default; + + - CPU/RAM stats are pulled from a single call to top(1) on Mac OS X (Linux still accesses /proc for everything); + + - Shebang has been changed to use Perl from PATH instead of the hardcoded /usr/bin/perl + +v0.2 2013-02-04T23:33:00 + [Stanislaw Pusep ] + - Bugfixes; + + - Screen(1) compatibility; + + - Fewer dependencies; + + - A smaller runtime footprint; + + - Memory allocation bar reordering. + +v0.1 2013-02-02T11:16:00 + [Stanislaw Pusep ] + - First public release. diff --git a/LICENSE b/LICENSE index aab364d..a5419a9 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -This software is copyright (c) 2013 by Stanislaw Pusep. +This software is copyright (c) 2013 by Stanislaw Pusep . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. @@ -12,7 +12,7 @@ b) the "Artistic License" --- The GNU General Public License, Version 1, February 1989 --- -This software is Copyright (c) 2013 by Stanislaw Pusep. +This software is Copyright (c) 2013 by Stanislaw Pusep . This is free software, licensed under: @@ -272,7 +272,7 @@ That's all there is to it! --- The Artistic License 1.0 --- -This software is Copyright (c) 2013 by Stanislaw Pusep. +This software is Copyright (c) 2013 by Stanislaw Pusep . This is free software, licensed under: diff --git a/MANIFEST b/MANIFEST new file mode 100644 index 0000000..14e666d --- /dev/null +++ b/MANIFEST @@ -0,0 +1,22 @@ +Build.PL +Changes +lib/App/rainbarf.pm +LICENSE +MANIFEST This list of files +META.json +META.yml +rainbarf +README.md +t/00-compile.t +t/author-critic.t +t/author-test-eol.t +t/release-cpan-changes.t +t/release-distmeta.t +t/release-kwalitee.t +t/release-mojibake.t +t/release-no-tabs.t +t/release-pod-coverage.t +t/release-pod-linkcheck.t +t/release-pod-syntax.t +t/release-portability.t +t/release-test-version.t diff --git a/lib/App/rainbarf.pm b/lib/App/rainbarf.pm new file mode 100644 index 0000000..855dad7 --- /dev/null +++ b/lib/App/rainbarf.pm @@ -0,0 +1,36 @@ +package App::rainbarf; + +use strict; +use warnings; + +our $VERSION = 0.3; + +1; + +__DATA__ +=pod + +=head1 NAME + +rainbarf - CPU/RAM stats chart for tmux & screen + +=head1 VERSION + +version 0.3 + +=head1 DESCRIPTION + +Fancy resource usage charts to put into the L status line. + +=head1 AUTHOR + +Stanislaw Pusep + +=head1 COPYRIGHT AND LICENSE + +This software is copyright (c) 2013 by Stanislaw Pusep . + +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 diff --git a/rainbarf b/rainbarf index 6483325..61901a0 100755 --- a/rainbarf +++ b/rainbarf @@ -469,7 +469,7 @@ Stanislaw Pusep =head1 COPYRIGHT AND LICENSE -This software is copyright (c) 2013 by Stanislaw Pusep. +This software is copyright (c) 2013 by Stanislaw Pusep . This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. diff --git a/t/00-compile.t b/t/00-compile.t new file mode 100644 index 0000000..0660e7d --- /dev/null +++ b/t/00-compile.t @@ -0,0 +1,8 @@ +#!perl + +use strict; +use warnings; +use Test::More; + +like(qx{$^X -c rainbarf 2>&1}, qr{rainbarf syntax OK}ms, q{compiles}); +done_testing 1; diff --git a/t/author-critic.t b/t/author-critic.t new file mode 100644 index 0000000..af7f7ea --- /dev/null +++ b/t/author-critic.t @@ -0,0 +1,20 @@ +#!perl + +BEGIN { + unless ($ENV{AUTHOR_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for testing by the author'); + } +} + + +use strict; +use warnings; + +use Test::More; +use English qw(-no_match_vars); + +eval "use Test::Perl::Critic"; +plan skip_all => 'Test::Perl::Critic required to criticise code' if $@; +Test::Perl::Critic->import( -profile => "perlcritic.rc" ) if -e "perlcritic.rc"; +all_critic_ok(); diff --git a/t/author-test-eol.t b/t/author-test-eol.t new file mode 100644 index 0000000..37132ed --- /dev/null +++ b/t/author-test-eol.t @@ -0,0 +1,17 @@ + +BEGIN { + unless ($ENV{AUTHOR_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for testing by the author'); + } +} + +use strict; +use warnings; +use Test::More; + +# generated by Dist::Zilla::Plugin::Test::EOL 0.07 +eval "use Test::EOL; 1;" or die $@; +# ^^ hack to get around prereqscanner detection, remove someday + +all_perl_files_ok({ trailing_whitespace => 1 }); diff --git a/t/release-cpan-changes.t b/t/release-cpan-changes.t new file mode 100644 index 0000000..bb5bd1d --- /dev/null +++ b/t/release-cpan-changes.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; +eval 'use Test::CPAN::Changes'; +plan skip_all => 'Test::CPAN::Changes required for this test' if $@; +changes_ok(); +done_testing(); diff --git a/t/release-distmeta.t b/t/release-distmeta.t new file mode 100644 index 0000000..15368e8 --- /dev/null +++ b/t/release-distmeta.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::CPAN::Meta"; +plan skip_all => "Test::CPAN::Meta required for testing META.yml" if $@; +meta_yaml_ok(); diff --git a/t/release-kwalitee.t b/t/release-kwalitee.t new file mode 100644 index 0000000..572378a --- /dev/null +++ b/t/release-kwalitee.t @@ -0,0 +1,17 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +# This test is generated by Dist::Zilla::Plugin::Test::Kwalitee +use strict; +use warnings; +use Test::More; # needed to provide plan. +eval "use Test::Kwalitee"; + +plan skip_all => "Test::Kwalitee required for testing kwalitee" if $@; diff --git a/t/release-mojibake.t b/t/release-mojibake.t new file mode 100644 index 0000000..6e8e09a --- /dev/null +++ b/t/release-mojibake.t @@ -0,0 +1,20 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use strict; +use warnings qw(all); + +use Test::More; + +## no critic (ProhibitStringyEval, RequireCheckingReturnValueOfEval) +eval q(use Test::Mojibake); +plan skip_all => q(Test::Mojibake required for source encoding testing) if $@; + +all_files_encoding_ok(); diff --git a/t/release-no-tabs.t b/t/release-no-tabs.t new file mode 100644 index 0000000..1c7204e --- /dev/null +++ b/t/release-no-tabs.t @@ -0,0 +1,16 @@ + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + +use strict; +use warnings; +use Test::More; + +eval 'use Test::NoTabs'; +plan skip_all => 'Test::NoTabs required' if $@; + +all_perl_files_ok(); diff --git a/t/release-pod-coverage.t b/t/release-pod-coverage.t new file mode 100644 index 0000000..3a81849 --- /dev/null +++ b/t/release-pod-coverage.t @@ -0,0 +1,21 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval "use Test::Pod::Coverage 1.08"; +plan skip_all => "Test::Pod::Coverage 1.08 required for testing POD coverage" + if $@; + +eval "use Pod::Coverage::TrustPod"; +plan skip_all => "Pod::Coverage::TrustPod required for testing POD coverage" + if $@; + +all_pod_coverage_ok({ coverage_class => 'Pod::Coverage::TrustPod' }); diff --git a/t/release-pod-linkcheck.t b/t/release-pod-linkcheck.t new file mode 100644 index 0000000..654cf06 --- /dev/null +++ b/t/release-pod-linkcheck.t @@ -0,0 +1,28 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use strict; +use warnings; +use Test::More; + +foreach my $env_skip ( qw( + SKIP_POD_LINKCHECK +) ){ + plan skip_all => "\$ENV{$env_skip} is set, skipping" + if $ENV{$env_skip}; +} + +eval "use Test::Pod::LinkCheck"; +if ( $@ ) { + plan skip_all => 'Test::Pod::LinkCheck required for testing POD'; +} +else { + Test::Pod::LinkCheck->new->all_pod_ok; +} diff --git a/t/release-pod-syntax.t b/t/release-pod-syntax.t new file mode 100644 index 0000000..d46a955 --- /dev/null +++ b/t/release-pod-syntax.t @@ -0,0 +1,15 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + +use Test::More; + +eval "use Test::Pod 1.41"; +plan skip_all => "Test::Pod 1.41 required for testing POD" if $@; + +all_pod_files_ok(); diff --git a/t/release-portability.t b/t/release-portability.t new file mode 100644 index 0000000..3f82125 --- /dev/null +++ b/t/release-portability.t @@ -0,0 +1,16 @@ +#!perl + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + + +use Test::More; + +eval 'use Test::Portability::Files'; +plan skip_all => 'Test::Portability::Files required for testing portability' + if $@; +run_tests(); diff --git a/t/release-test-version.t b/t/release-test-version.t new file mode 100644 index 0000000..e2bb52f --- /dev/null +++ b/t/release-test-version.t @@ -0,0 +1,30 @@ + +BEGIN { + unless ($ENV{RELEASE_TESTING}) { + require Test::More; + Test::More::plan(skip_all => 'these tests are for release candidate testing'); + } +} + +use strict; +use warnings; +use Test::More; + +# generated by Dist::Zilla::Plugin::Test::Version 0.002004 +BEGIN { eval "use Test::Version; 1;" or die $@; } + +my @imports = ( 'version_all_ok' ); + +my $params = { + is_strict => 0, + has_version => 1, +}; + +push @imports, $params + if version->parse( $Test::Version::VERSION ) >= version->parse('1.002'); + + +Test::Version->import(@imports); + +version_all_ok; +done_testing;