summaryrefslogtreecommitdiff
path: root/cpan/Perl-OSType
diff options
context:
space:
mode:
authorSteve Hay <steve.m.hay@googlemail.com>2013-09-11 09:39:17 +0100
committerSteve Hay <steve.m.hay@googlemail.com>2013-09-11 09:39:17 +0100
commitba58de910524e90d3927b06d55027610bf1c607b (patch)
tree5da1aeb64a7a6bca425458367f331dc01da696fe /cpan/Perl-OSType
parentbff978faaae3c8c03edc7cf579be6660fdc89fb3 (diff)
downloadperl-ba58de910524e90d3927b06d55027610bf1c607b.tar.gz
Upgrade Perl-OSType from version 1.004 to 1.005
Diffstat (limited to 'cpan/Perl-OSType')
-rw-r--r--cpan/Perl-OSType/lib/Perl/OSType.pm36
-rw-r--r--cpan/Perl-OSType/t/OSType.t44
2 files changed, 40 insertions, 40 deletions
diff --git a/cpan/Perl-OSType/lib/Perl/OSType.pm b/cpan/Perl-OSType/lib/Perl/OSType.pm
index df0908a117..2a99b2ba95 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<Devel::CheckOS>
=head2 Bugs / Feature Requests
Please report any bugs or feature requests through the issue tracker
-at L<https://github.com/dagolden/perl-ostype/issues>.
+at L<https://github.com/dagolden/Perl-OSType/issues>.
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<https://github.com/dagolden/perl-ostype>
+L<https://github.com/dagolden/Perl-OSType>
- 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 46cca76854..c6c92504ff 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;