From: Steve Hay Date: Wed, 11 Sep 2013 08:39:17 +0000 (+0100) Subject: Upgrade Perl-OSType from version 1.004 to 1.005 X-Git-Tag: upstream/5.20.0~1921 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ba58de910524e90d3927b06d55027610bf1c607b;p=platform%2Fupstream%2Fperl.git Upgrade Perl-OSType from version 1.004 to 1.005 --- diff --git a/Porting/Maintainers.pl b/Porting/Maintainers.pl index bbc404f..d11fb83 100755 --- a/Porting/Maintainers.pl +++ b/Porting/Maintainers.pl @@ -1405,9 +1405,9 @@ use File::Glob qw(:case); 'Perl::OSType' => { 'MAINTAINER' => 'dagolden', - 'DISTRIBUTION' => 'DAGOLDEN/Perl-OSType-1.004.tar.gz', + 'DISTRIBUTION' => 'DAGOLDEN/Perl-OSType-1.005.tar.gz', 'FILES' => q[cpan/Perl-OSType], - 'EXCLUDED' => [qr/^xt/, qr{^t/00-}], + 'EXCLUDED' => [qw(cpanfile), qr/^xt/, qr{^t/00-}], 'UPSTREAM' => 'cpan', }, diff --git a/cpan/Perl-OSType/lib/Perl/OSType.pm b/cpan/Perl-OSType/lib/Perl/OSType.pm index df0908a..2a99b2b 100644 --- a/cpan/Perl-OSType/lib/Perl/OSType.pm +++ b/cpan/Perl-OSType/lib/Perl/OSType.pm @@ -1,15 +1,14 @@ use strict; use warnings; + package Perl::OSType; # ABSTRACT: Map Perl operating system names to generic types -our $VERSION = '1.004'; # VERSION +our $VERSION = '1.005'; # VERSION require Exporter; our @ISA = qw(Exporter); -our %EXPORT_TAGS = ( - all => [ qw( os_type is_os_type ) ] -); +our %EXPORT_TAGS = ( all => [qw( os_type is_os_type )] ); our @EXPORT_OK = @{ $EXPORT_TAGS{all} }; @@ -69,22 +68,20 @@ my %OSTYPES = qw( ); sub os_type { - my ($os) = @_; - $os = $^O unless defined $os; - return $OSTYPES{ $os } || q{}; + my ($os) = @_; + $os = $^O unless defined $os; + return $OSTYPES{$os} || q{}; } sub is_os_type { - my ($type, $os) = @_; - return unless $type; - $os = $^O unless defined $os; - return os_type($os) eq $type; + my ( $type, $os ) = @_; + return unless $type; + $os = $^O unless defined $os; + return os_type($os) eq $type; } 1; -__END__ - =pod =encoding utf-8 @@ -95,7 +92,7 @@ Perl::OSType - Map Perl operating system names to generic types =head1 VERSION -version 1.004 +version 1.005 =head1 SYNOPSIS @@ -156,7 +153,7 @@ L =head2 Bugs / Feature Requests Please report any bugs or feature requests through the issue tracker -at L. +at L. You will be notified automatically of any progress on your issue. =head2 Source Code @@ -164,9 +161,9 @@ You will be notified automatically of any progress on your issue. This is open source software. The code repository is available for public review and contribution under the terms of the license. -L +L - git clone git://github.com/dagolden/perl-ostype.git + git clone https://github.com/dagolden/Perl-OSType.git =head1 AUTHOR @@ -198,3 +195,8 @@ 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 + +__END__ + + +# vim: ts=4 sts=4 sw=4 et: diff --git a/cpan/Perl-OSType/t/OSType.t b/cpan/Perl-OSType/t/OSType.t index 46cca76..c6c9250 100644 --- a/cpan/Perl-OSType/t/OSType.t +++ b/cpan/Perl-OSType/t/OSType.t @@ -9,43 +9,41 @@ use constant NON_EXISTENT_OS => 'titanix'; #the system they said could not go do # API tests #--------------------------------------------------------------------------# -require_ok( 'Perl::OSType' ); +require_ok('Perl::OSType'); can_ok( 'Perl::OSType', 'os_type' ); -my @functions = qw/os_type is_os_type/ ; -for my $sub ( @functions ) { - ok( eval { Perl::OSType->import($sub); 1 }, "importing $sub()" ); - can_ok( 'main', $sub ); +my @functions = qw/os_type is_os_type/; +for my $sub (@functions) { + ok( eval { Perl::OSType->import($sub); 1 }, "importing $sub()" ); + can_ok( 'main', $sub ); } my $test_pkg = "testpackage$$"; ok( eval "package $test_pkg; use Perl::OSType ':all'; 1", - "Testing 'use Perl::OSType qw/:all/'" -); + "Testing 'use Perl::OSType qw/:all/'" ); can_ok( $test_pkg, @functions ); - #--------------------------------------------------------------------------# # os_type #--------------------------------------------------------------------------# { - my $fcn = 'os_type()'; + my $fcn = 'os_type()'; - ok( my $current_type = os_type(), "$fcn: without arguments" ); + ok( my $current_type = os_type(), "$fcn: without arguments" ); - is( $current_type, os_type( $^O ), "... matches os_type($^O)" ); + is( $current_type, os_type($^O), "... matches os_type($^O)" ); - is(os_type( NON_EXISTENT_OS ), '', "$fcn: unknown OS returns empty string"); + is( os_type(NON_EXISTENT_OS), '', "$fcn: unknown OS returns empty string" ); - is(os_type( '' ), '', "$fcn: empty string returns empty string"); + is( os_type(''), '', "$fcn: empty string returns empty string" ); - local $^O = 'linux'; + local $^O = 'linux'; - is(os_type( undef ), 'Unix', "$fcn: explicit undef uses $^O"); + is( os_type(undef), 'Unix', "$fcn: explicit undef uses $^O" ); } #--------------------------------------------------------------------------# @@ -53,18 +51,18 @@ can_ok( $test_pkg, @functions ); #--------------------------------------------------------------------------# { - my $fcn = 'is_os_type()'; + my $fcn = 'is_os_type()'; - is(is_os_type(NON_EXISTENT_OS), '', "$fcn: non-existent type is false"); + is( is_os_type(NON_EXISTENT_OS), '', "$fcn: non-existent type is false" ); - is(is_os_type(''), undef, "$fcn: empty string type is false"); + is( is_os_type(''), undef, "$fcn: empty string type is false" ); - is(is_os_type('Unix', NON_EXISTENT_OS), '', "$fcn: non-existent OS is false"); + is( is_os_type( 'Unix', NON_EXISTENT_OS ), '', "$fcn: non-existent OS is false" ); - local $^O = 'vos'; - ok( ! is_os_type( 'Unix' ), "$fcn: false" ); - ok( is_os_type( 'VOS' ), "$fcn: true" ); - ok( ! is_os_type(), "$fcn: false if no type provided" ); + local $^O = 'vos'; + ok( !is_os_type('Unix'), "$fcn: false" ); + ok( is_os_type('VOS'), "$fcn: true" ); + ok( !is_os_type(), "$fcn: false if no type provided" ); } done_testing; diff --git a/pod/perldelta.pod b/pod/perldelta.pod index 9cc7fe0..23ed7d5 100644 --- a/pod/perldelta.pod +++ b/pod/perldelta.pod @@ -354,7 +354,7 @@ keep in sync with the latest CPAN release. =item * -L has been upgraded from version 1.003 to 1.004. +L has been upgraded from version 1.003 to 1.005. The Unix OSType 'bitrig' has been added.