From: Vincent Pit Date: Sun, 29 Jun 2008 16:41:32 +0000 (+0200) Subject: Importing Linux-SysInfo-0.09.tar.gz X-Git-Tag: v0.09^0 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLinux-SysInfo.git;a=commitdiff_plain;h=04dc9ca1cac5cc5c30ad0f20013915d98352debc Importing Linux-SysInfo-0.09.tar.gz --- diff --git a/Changes b/Changes index b67e711..64567c9 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,12 @@ 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. diff --git a/MANIFEST b/MANIFEST index 418a084..275cab8 100644 --- a/MANIFEST +++ b/MANIFEST @@ -9,7 +9,8 @@ samples/sysinfo.pl 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 diff --git a/META.yml b/META.yml index 78776cd..b043869 100644 --- a/META.yml +++ b/META.yml @@ -1,16 +1,18 @@ --- #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 +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 + url: http://module-build.sourceforge.net/META-spec-v1.3.html + version: 1.3 +build_requires: + ExtUtils::MakeMaker: 0 + Test::More: 0 diff --git a/Makefile.PL b/Makefile.PL index cf1da63..a300844 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -2,6 +2,21 @@ use strict; 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 ', @@ -11,11 +26,11 @@ WriteMakefile( 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-*' }, diff --git a/README b/README index 9e6ffd6..d7b75e1 100644 --- a/README +++ b/README @@ -2,7 +2,7 @@ NAME Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call. VERSION - Version 0.08 + Version 0.09 SYNOPSIS use Linux::SysInfo qw/sysinfo/; @@ -16,9 +16,10 @@ DESCRIPTION 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" @@ -67,10 +68,10 @@ FUNCTIONS "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 @@ -92,9 +93,10 @@ SEE ALSO BSD::getloadavg : Wrapper to the getloadavg(3) BSD system call. AUTHOR - Vincent Pit, "" + Vincent Pit, "", . - 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 @@ -109,7 +111,7 @@ SUPPORT 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. diff --git a/lib/Linux/SysInfo.pm b/lib/Linux/SysInfo.pm index dcbe1a9..fcd299e 100644 --- a/lib/Linux/SysInfo.pm +++ b/lib/Linux/SysInfo.pm @@ -1,7 +1,7 @@ package Linux::SysInfo; -use warnings; use strict; +use warnings; =head1 NAME @@ -9,11 +9,14 @@ Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call. =head1 VERSION -Version 0.08 +Version 0.09 =cut -our $VERSION = '0.08'; +our $VERSION; +BEGIN { + $VERSION = '0.09'; +} =head1 SYNOPSIS @@ -26,23 +29,20 @@ our $VERSION = '0.08'; 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, and the constant C are only exported on request. - -=cut - -use base qw/Exporter/; +=head1 CONSTANTS -our @EXPORT_OK = qw/sysinfo LS_HAS_EXTENDED/; +=head2 C -our %EXPORT_TAGS = ( 'all' => [ @EXPORT_OK ] ); +This constant is set to 1 if your kernel supports the three extended fields C, C and C ; 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 @@ -106,11 +106,21 @@ Memory unit size in bytes. =back -=head1 CONSTANTS +=head1 EXPORT -=head2 LS_HAS_EXTENDED +The only function of this module, C, and the constant C 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, C and C ; 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 @@ -130,9 +140,9 @@ L : Wrapper to the C BSD system call. =head1 AUTHOR -Vincent Pit, C<< >> +Vincent Pit, C<< >>, L. -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 @@ -150,7 +160,7 @@ You can find documentation for this module with the perldoc command. =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. diff --git a/t/00-load.t b/t/00-load.t index 6c48691..3ba29b7 100644 --- a/t/00-load.t +++ b/t/00-load.t @@ -1,8 +1,5 @@ #!perl -T -use strict; -use warnings; - use Test::More tests => 1; BEGIN { diff --git a/t/90-boilerplate.t b/t/90-boilerplate.t new file mode 100644 index 0000000..ef6ea9e --- /dev/null +++ b/t/90-boilerplate.t @@ -0,0 +1,49 @@ +#!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'); + diff --git a/t/91-pod.t b/t/91-pod.t new file mode 100644 index 0000000..ee8b18a --- /dev/null +++ b/t/91-pod.t @@ -0,0 +1,12 @@ +#!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(); diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t new file mode 100644 index 0000000..fc40a57 --- /dev/null +++ b/t/92-pod-coverage.t @@ -0,0 +1,18 @@ +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(); diff --git a/t/95-portability-files.t b/t/95-portability-files.t new file mode 100644 index 0000000..ab541f3 --- /dev/null +++ b/t/95-portability-files.t @@ -0,0 +1,10 @@ +#!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(); diff --git a/t/99-kwalitee.t b/t/99-kwalitee.t new file mode 100644 index 0000000..7775e60 --- /dev/null +++ b/t/99-kwalitee.t @@ -0,0 +1,9 @@ +#!perl + +use strict; +use warnings; + +use Test::More; + +eval { require Test::Kwalitee; Test::Kwalitee->import() }; +plan( skip_all => 'Test::Kwalitee not installed; skipping' ) if $@;