]> git.vpit.fr Git - perl/modules/Linux-SysInfo.git/commitdiff
Importing Linux-SysInfo-0.09.tar.gz v0.09
authorVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 16:41:32 +0000 (18:41 +0200)
committerVincent Pit <vince@profvince.com>
Sun, 29 Jun 2008 16:41:32 +0000 (18:41 +0200)
12 files changed:
Changes
MANIFEST
META.yml
Makefile.PL
README
lib/Linux/SysInfo.pm
t/00-load.t
t/90-boilerplate.t [new file with mode: 0644]
t/91-pod.t [new file with mode: 0644]
t/92-pod-coverage.t [new file with mode: 0644]
t/95-portability-files.t [new file with mode: 0644]
t/99-kwalitee.t [new file with mode: 0644]

diff --git a/Changes b/Changes
index b67e7116c671fc08f8506eb3ed9b99bbd080ec06..64567c9a274e435b7f5369d9300118a2f1b2c4e2 100644 (file)
--- a/Changes
+++ b/Changes
@@ -1,5 +1,12 @@
 Revision history for Linux-SysInfo
 
 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.
 
 0.08    2007-11-19 09:25 UTC
         + Fix : 5.10.0_RC1 compatibility fix.
 
index 418a084864c84fcb8509137c801de74856c824d3..275cab84c7db610865314bcff11a5add02f174d3 100644 (file)
--- a/MANIFEST
+++ b/MANIFEST
@@ -9,7 +9,8 @@ samples/sysinfo.pl
 t/00-load.t
 t/10-standard.t
 t/20-extended.t
 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
index 78776cd784be148ad9b1b34c5813b8b21df1c351..b043869271d7f9031fb542e3cbd0587239131aa2 100644 (file)
--- a/META.yml
+++ b/META.yml
@@ -1,16 +1,18 @@
 --- #YAML:1.0
 name:                Linux-SysInfo
 --- #YAML:1.0
 name:                Linux-SysInfo
-version:             0.08
+version:             0.09
 abstract:            Perl interface to the sysinfo(2) Linux system call.
 license:             perl
 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
 distribution_type:   module
 requires:     
     Exporter:                      0
-    Test::More:                    0
     XSLoader:                      0
 meta-spec:
     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
index cf1da637c0d444da9c86297b591f362ab2c435f4..a300844723fe9f40a8ed37415334aa1423089b8a 100644 (file)
@@ -2,6 +2,21 @@ use strict;
 use warnings;
 use ExtUtils::MakeMaker;
 
 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>',
 WriteMakefile(
     NAME                => 'Linux::SysInfo',
     AUTHOR              => 'Vincent Pit <perl@profvince.com>',
@@ -11,11 +26,11 @@ WriteMakefile(
     PL_FILES            => {},
     PREREQ_PM => {
         'Exporter'   => 0,
     PL_FILES            => {},
     PREREQ_PM => {
         'Exporter'   => 0,
-        'Test::More' => 0,
         'XSLoader'   => 0,
     },
     dist                => {
         '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-*' },
         COMPRESS => 'gzip -9f', SUFFIX => 'gz',
     },
     clean               => { FILES => 'Linux-SysInfo-*' },
diff --git a/README b/README
index 9e6ffd687273b277a4b683db47396e4f8048d74b..d7b75e15d7640dea5ee4e2430385072fef6258a3 100644 (file)
--- a/README
+++ b/README
@@ -2,7 +2,7 @@ NAME
     Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
 
 VERSION
     Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
 
 VERSION
-    Version 0.08
+    Version 0.09
 
 SYNOPSIS
         use Linux::SysInfo qw/sysinfo/;
 
 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.
 
     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"
 
 FUNCTIONS
   "sysinfo"
@@ -67,10 +68,10 @@ FUNCTIONS
     "mem_unit"
         Memory unit size in bytes.
 
     "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
 
 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
     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
 
 BUGS
     Please report any bugs or feature requests to "bug-linux-sysinfo at
@@ -109,7 +111,7 @@ SUPPORT
         perldoc Linux::SysInfo
 
 COPYRIGHT & LICENSE
         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.
 
     This program is free software; you can redistribute it and/or modify it
     under the same terms as Perl itself.
index dcbe1a9f349c5fe7e0906324e898bc420d6a4013..fcd299e5ccd951468dee98751e45704a958fe8e6 100644 (file)
@@ -1,7 +1,7 @@
 package Linux::SysInfo;
 
 package Linux::SysInfo;
 
-use warnings;
 use strict;
 use strict;
+use warnings;
 
 =head1 NAME
 
 
 =head1 NAME
 
@@ -9,11 +9,14 @@ Linux::SysInfo - Perl interface to the sysinfo(2) Linux system call.
 
 =head1 VERSION
 
 
 =head1 VERSION
 
-Version 0.08
+Version 0.09
 
 =cut
 
 
 =cut
 
-our $VERSION = '0.08';
+our $VERSION;
+BEGIN {
+ $VERSION = '0.09';
+}
 
 =head1 SYNOPSIS
 
 
 =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.
 
 
 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>
 
 
 =head2 C<sysinfo>
 
@@ -106,11 +106,21 @@ Memory unit size in bytes.
 
 =back
 
 
 =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 BINARY COMPATIBILITY
 
@@ -130,9 +140,9 @@ L<BSD::getloadavg> : Wrapper to the C<getloadavg(3)> BSD system call.
 
 =head1 AUTHOR
 
 
 =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 BUGS
 
@@ -150,7 +160,7 @@ You can find documentation for this module with the perldoc command.
 
 =head1 COPYRIGHT & LICENSE
 
 
 =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.
 
 This program is free software; you can redistribute it and/or modify it
 under the same terms as Perl itself.
index 6c4869138dc75ae7ffc00c464c5f9bb90cfd3333..3ba29b7aacb73531d02045b0c11eab71c212e438 100644 (file)
@@ -1,8 +1,5 @@
 #!perl -T
 
 #!perl -T
 
-use strict;
-use warnings;
-
 use Test::More tests => 1;
 
 BEGIN {
 use Test::More tests => 1;
 
 BEGIN {
diff --git a/t/90-boilerplate.t b/t/90-boilerplate.t
new file mode 100644 (file)
index 0000000..ef6ea9e
--- /dev/null
@@ -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 (file)
index 0000000..ee8b18a
--- /dev/null
@@ -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 (file)
index 0000000..fc40a57
--- /dev/null
@@ -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 (file)
index 0000000..ab541f3
--- /dev/null
@@ -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 (file)
index 0000000..7775e60
--- /dev/null
@@ -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 $@;