Revision history for Linux-SysInfo
+0.09 2008-03-09 13:00 UTC
+ + Add : ':funcs' and ':consts' export tags.
+ + Doc : Copyright update.
+ + Fix : Correct dependencies listing in META.yml.
+ + Tst : Author tests overhaul.
+ + Tst : t/95-portability-files.t.
+
0.08 2007-11-19 09:25 UTC
+ Fix : 5.10.0_RC1 compatibility fix.
t/00-load.t
t/10-standard.t
t/20-extended.t
-t/boilerplate.t
-t/kwalitee.t
-t/pod-coverage.t
-t/pod.t
+t/90-boilerplate.t
+t/91-pod.t
+t/92-pod-coverage.t
+t/95-portability-files.t
+t/99-kwalitee.t
--- #YAML:1.0
name: Linux-SysInfo
-version: 0.08
+version: 0.09
abstract: Perl interface to the sysinfo(2) Linux system call.
license: perl
-generated_by: ExtUtils::MakeMaker version 6.36_01
+author:
+ - Vincent Pit <perl@profvince.com>
+generated_by: ExtUtils::MakeMaker version 6.42
distribution_type: module
requires:
Exporter: 0
- Test::More: 0
XSLoader: 0
meta-spec:
- url: http://module-build.sourceforge.net/META-spec-v1.2.html
- version: 1.2
-author:
- - Vincent Pit <perl@profvince.com>
+ url: http://module-build.sourceforge.net/META-spec-v1.3.html
+ version: 1.3
+build_requires:
+ ExtUtils::MakeMaker: 0
+ Test::More: 0
use warnings;
use ExtUtils::MakeMaker;
+my $BUILD_REQUIRES = {
+ 'ExtUtils::MakeMaker' => 0,
+ 'Test::More' => 0,
+};
+
+sub build_req {
+ my $tometa = ' >> $(DISTVNAME)/META.yml;';
+ my $build_req = 'echo "build_requires:" ' . $tometa;
+ foreach my $mod ( sort { lc $a cmp lc $b } keys %$BUILD_REQUIRES ) {
+ my $ver = $BUILD_REQUIRES->{$mod};
+ $build_req .= sprintf 'echo " %-30s %s" %s', "$mod:", $ver, $tometa;
+ }
+ return $build_req;
+}
+
WriteMakefile(
NAME => 'Linux::SysInfo',
AUTHOR => 'Vincent Pit <perl@profvince.com>',
PL_FILES => {},
PREREQ_PM => {
'Exporter' => 0,
- 'Test::More' => 0,
'XSLoader' => 0,
},
dist => {
- PREOP => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README',
+ PREOP => 'pod2text lib/Linux/SysInfo.pm > $(DISTVNAME)/README; '
+ . build_req,
COMPRESS => 'gzip -9f', SUFFIX => 'gz',
},
clean => { FILES => 'Linux-SysInfo-*' },
Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
VERSION
- Version 0.08
+ Version 0.09
SYNOPSIS
use Linux::SysInfo qw/sysinfo/;
and processes running. Other systems have also this system call (e.g.
Solaris), but in most cases the returned information is different.
-EXPORT
- The only function of this module, "sysinfo", and the constant
- "LS_HAS_EXTENDED" are only exported on request.
+CONSTANTS
+ "LS_HAS_EXTENDED"
+ This constant is set to 1 if your kernel supports the three extended
+ fields "totalhigh", "freehigh" and "mem_unit" ; and to 0 otherwise.
FUNCTIONS
"sysinfo"
"mem_unit"
Memory unit size in bytes.
-CONSTANTS
- LS_HAS_EXTENDED
- This constant is set to 1 if your kernel supports the three extended
- fields "totalhigh", "freehigh" and "mem_unit" ; and to 0 otherwise.
+EXPORT
+ The only function of this module, "sysinfo", and the constant
+ "LS_HAS_EXTENDED" are only exported on request. Functions are also
+ exported by the ":funcs" tag, and constants by ":consts".
BINARY COMPATIBILITY
If you upgrade your kernel to a greater version than 2.3.23 on i386 or
BSD::getloadavg : Wrapper to the getloadavg(3) BSD system call.
AUTHOR
- Vincent Pit, "<perl at profvince.com>"
+ Vincent Pit, "<perl at profvince.com>", <http://www.profvince.com>.
- You can contact me by mail or on #perl @ FreeNode (Prof_Vince).
+ You can contact me by mail or on #perl @ FreeNode (vincent or
+ Prof_Vince).
BUGS
Please report any bugs or feature requests to "bug-linux-sysinfo at
perldoc Linux::SysInfo
COPYRIGHT & LICENSE
- Copyright 2007 Vincent Pit, all rights reserved.
+ Copyright 2007-2008 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
package Linux::SysInfo;
-use warnings;
use strict;
+use warnings;
=head1 NAME
=head1 VERSION
-Version 0.08
+Version 0.09
=cut
-our $VERSION = '0.08';
+our $VERSION;
+BEGIN {
+ $VERSION = '0.09';
+}
=head1 SYNOPSIS
This module is a wrapper around the sysinfo(2) Linux system call. It gives information about the current uptime, load average, memory usage and processes running. Other systems have also this system call (e.g. Solaris), but in most cases the returned information is different.
-=head1 EXPORT
-
-The only function of this module, C<sysinfo>, and the constant C<LS_HAS_EXTENDED> are only exported on request.
-
-=cut
-
-use base qw/Exporter/;
+=head1 CONSTANTS
-our @EXPORT_OK = qw/sysinfo LS_HAS_EXTENDED/;
+=head2 C<LS_HAS_EXTENDED>
-our %EXPORT_TAGS = ( 'all' => [ @EXPORT_OK ] );
+This constant is set to 1 if your kernel supports the three extended fields C<totalhigh>, C<freehigh> and C<mem_unit> ; and to 0 otherwise.
-use XSLoader;
+=head1 FUNCTIONS
-XSLoader::load 'Linux::SysInfo', $VERSION;
+=cut
-=head1 FUNCTIONS
+BEGIN {
+ require XSLoader;
+ XSLoader::load(__PACKAGE__, $VERSION);
+}
=head2 C<sysinfo>
=back
-=head1 CONSTANTS
+=head1 EXPORT
-=head2 LS_HAS_EXTENDED
+The only function of this module, C<sysinfo>, and the constant C<LS_HAS_EXTENDED> are only exported on request. Functions are also exported by the C<:funcs> tag, and constants by C<:consts>.
-This constant is set to 1 if your kernel supports the three extended fields C<totalhigh>, C<freehigh> and C<mem_unit> ; and to 0 otherwise.
+=cut
+
+use base qw/Exporter/;
+
+our @EXPORT = ();
+our %EXPORT_TAGS = (
+ 'funcs' => [ qw/sysinfo/ ],
+ 'consts' => [ qw/LS_HAS_EXTENDED/ ]
+);
+our @EXPORT_OK = map { @$_ } values %EXPORT_TAGS;
+$EXPORT_TAGS{'all'} = [ @EXPORT_OK ];
=head1 BINARY COMPATIBILITY
=head1 AUTHOR
-Vincent Pit, C<< <perl at profvince.com> >>
+Vincent Pit, C<< <perl at profvince.com> >>, L<http://www.profvince.com>.
-You can contact me by mail or on #perl @ FreeNode (Prof_Vince).
+You can contact me by mail or on #perl @ FreeNode (vincent or Prof_Vince).
=head1 BUGS
=head1 COPYRIGHT & LICENSE
-Copyright 2007 Vincent Pit, all rights reserved.
+Copyright 2007-2008 Vincent Pit, all rights reserved.
This program is free software; you can redistribute it and/or modify it
under the same terms as Perl itself.
#!perl -T
-use strict;
-use warnings;
-
use Test::More tests => 1;
BEGIN {
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More tests => 3;
+
+sub not_in_file_ok {
+ my ($filename, %regex) = @_;
+ open( my $fh, '<', $filename )
+ or die "couldn't open $filename for reading: $!";
+
+ my %violated;
+
+ while (my $line = <$fh>) {
+ while (my ($desc, $regex) = each %regex) {
+ if ($line =~ $regex) {
+ push @{$violated{$desc}||=[]}, $.;
+ }
+ }
+ }
+
+ if (%violated) {
+ fail("$filename contains boilerplate text");
+ diag "$_ appears on lines @{$violated{$_}}" for keys %violated;
+ } else {
+ pass("$filename contains no boilerplate text");
+ }
+}
+
+sub module_boilerplate_ok {
+ my ($module) = @_;
+ not_in_file_ok($module =>
+ 'the great new $MODULENAME' => qr/ - The great new /,
+ 'boilerplate description' => qr/Quick summary of what the module/,
+ 'stub function definition' => qr/function[12]/,
+ );
+}
+
+not_in_file_ok(README =>
+ "The README is used..." => qr/The README is used/,
+ "'version information here'" => qr/to provide version information/,
+);
+
+not_in_file_ok(Changes =>
+ "placeholder date/time" => qr(Date/time)
+);
+
+module_boilerplate_ok('lib/Linux/SysInfo.pm');
+
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod
+my $min_tp = 1.22;
+eval "use Test::Pod $min_tp";
+plan skip_all => "Test::Pod $min_tp required for testing POD" if $@;
+
+all_pod_files_ok();
--- /dev/null
+use strict;
+use warnings;
+use Test::More;
+
+# Ensure a recent version of Test::Pod::Coverage
+my $min_tpc = 1.08;
+eval "use Test::Pod::Coverage $min_tpc";
+plan skip_all => "Test::Pod::Coverage $min_tpc required for testing POD coverage"
+ if $@;
+
+# Test::Pod::Coverage doesn't require a minimum Pod::Coverage version,
+# but older versions don't recognize some common documentation styles
+my $min_pc = 0.18;
+eval "use Pod::Coverage $min_pc";
+plan skip_all => "Pod::Coverage $min_pc required for testing POD coverage"
+ if $@;
+
+all_pod_coverage_ok();
--- /dev/null
+#!perl -T
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval "use Test::Portability::Files";
+plan skip_all => "Test::Portability::Files required for testing filenames portability" if $@;
+run_tests();
--- /dev/null
+#!perl
+
+use strict;
+use warnings;
+
+use Test::More;
+
+eval { require Test::Kwalitee; Test::Kwalitee->import() };
+plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;