Skip to content

Commit

Permalink
CPANification
Browse files Browse the repository at this point in the history
  • Loading branch information
creaktive committed Feb 12, 2013
1 parent c834b88 commit 7231562
Show file tree
Hide file tree
Showing 20 changed files with 377 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@ Makefile
Makefile.old
MANIFEST.bak
META.yml
META.json
MYMETA.json
MYMETA.yml
nytprof.out
pm_to_blib
App-rainbarf-*/*
49 changes: 49 additions & 0 deletions Build.PL
Original file line number Diff line number Diff line change
@@ -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 <[email protected]>
=cut
25 changes: 25 additions & 0 deletions Changes
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Changelog for App-rainbarf

v0.3 2013-02-11T23:39:00
[Stanislaw Pusep <[email protected]>]
- 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 <[email protected]>]
- Bugfixes;

- Screen(1) compatibility;

- Fewer dependencies;

- A smaller runtime footprint;

- Memory allocation bar reordering.

v0.1 2013-02-02T11:16:00
[Stanislaw Pusep <[email protected]>]
- First public release.
6 changes: 3 additions & 3 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
This software is copyright (c) 2013 by Stanislaw Pusep.
This software is copyright (c) 2013 by Stanislaw Pusep <[email protected]>.

This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Expand All @@ -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 <[email protected]>.

This is free software, licensed under:

Expand Down Expand Up @@ -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 <[email protected]>.

This is free software, licensed under:

Expand Down
22 changes: 22 additions & 0 deletions MANIFEST
Original file line number Diff line number Diff line change
@@ -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
36 changes: 36 additions & 0 deletions lib/App/rainbarf.pm
Original file line number Diff line number Diff line change
@@ -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<tmux|http://tmux.sourceforge.net/> status line.
=head1 AUTHOR
Stanislaw Pusep <[email protected]>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Stanislaw Pusep <[email protected]>.
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
2 changes: 1 addition & 1 deletion rainbarf
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ Stanislaw Pusep <[email protected]>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2013 by Stanislaw Pusep.
This software is copyright (c) 2013 by Stanislaw Pusep <[email protected]>.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
Expand Down
8 changes: 8 additions & 0 deletions t/00-compile.t
Original file line number Diff line number Diff line change
@@ -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;
20 changes: 20 additions & 0 deletions t/author-critic.t
Original file line number Diff line number Diff line change
@@ -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();
17 changes: 17 additions & 0 deletions t/author-test-eol.t
Original file line number Diff line number Diff line change
@@ -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 });
15 changes: 15 additions & 0 deletions t/release-cpan-changes.t
Original file line number Diff line number Diff line change
@@ -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();
15 changes: 15 additions & 0 deletions t/release-distmeta.t
Original file line number Diff line number Diff line change
@@ -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();
17 changes: 17 additions & 0 deletions t/release-kwalitee.t
Original file line number Diff line number Diff line change
@@ -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 $@;
20 changes: 20 additions & 0 deletions t/release-mojibake.t
Original file line number Diff line number Diff line change
@@ -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();
16 changes: 16 additions & 0 deletions t/release-no-tabs.t
Original file line number Diff line number Diff line change
@@ -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();
21 changes: 21 additions & 0 deletions t/release-pod-coverage.t
Original file line number Diff line number Diff line change
@@ -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' });
28 changes: 28 additions & 0 deletions t/release-pod-linkcheck.t
Original file line number Diff line number Diff line change
@@ -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;
}
15 changes: 15 additions & 0 deletions t/release-pod-syntax.t
Original file line number Diff line number Diff line change
@@ -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();
16 changes: 16 additions & 0 deletions t/release-portability.t
Original file line number Diff line number Diff line change
@@ -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();
Loading

0 comments on commit 7231562

Please sign in to comment.