Acme-Terror-AU
view release on metacpan or search on metacpan
Revision history for Perl extension Acme::Terror::AU
0.01 Tue 8 August 2006
- Take that you terrorists!
Changes
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/Acme/Terror/AU.pm
LICENSE
Makefile.PL
MANIFEST This list of files
META.yml
README
t/01_compile.t
t/99_pod.t
abstract: Fetch the current AU terror alert level
author: 'Adam Kennedy <adamk@cpan.org>'
build_requires:
File::Spec: 0.80
Test::More: 0.47
distribution_type: module
generated_by: Module::Install version 0.63
license: perl
name: Acme-Terror-AU
no_index:
directory:
- inc
- t
requires:
perl: 5.005
version: 0.01
Makefile.PL view on Meta::CPAN
use inc::Module::Install;
name 'Acme-Terror-AU';
perl_version '5.005';
all_from 'lib/Acme/Terror/AU.pm';
build_requires 'File::Spec' => '0.80';
build_requires 'Test::More' => '0.47';
WriteAll;
NAME
Acme::Terror::AU - Fetch the current AU terror alert level
SYNOPSIS
use Acme::Terror::AU;
my $t = Acme::Terror::AU->new(); # create new Acme::Terror::AU object
my $level = $t->fetch;
print "Current terror alert level is: $level\n";
DESCRIPTION
Gets the currrent terrorist threat level in Australia.
The levels are either...
CRITICAL - an attack is expected imminently
SEVERE - an attack is likely
SUBSTANTIAL - an attack is a strong possibility
MODERATE - an attack is possible but not likely
LOW - an attack is unlikely
UNKNOWN - cannot determine threat level
HOWEVER, as the government has repeatedly stated that they think
triggering various security events off a single level system would be
damage flexibiliy by oversimplifying the situation, and in any case, why
on earth should they let the terrorists see what their alert status is.
And so this module never returns any of the above status, and instead
always returns UNKNOWN. :)
This module aims to be compatible with the US version Acme::Terror and
the UK version Acme::Terror::UK.
METHODS
new()
use Acme::Terror::AU
my $t = Acme::Terror::AU->new();
Create a new instance of the Acme::Terror::AU class.
fetch()
my $threat_level_string = $t->fetch();
print $threat_level_string;
Return the current threat level as a string.
level()
my $level = $t->level();
if ($level == Acme::Terror::AU::CRITICAL) {
print "Help, we're all going to die!\n";
}
Return the level of the current terrorist threat as a comparable value.
The values to compare against are,
Acme::Terror::AU::CRITICAL
Acme::Terror::AU::SEVERE
Acme::Terror::AU::SUBSTANTIAL
Acme::Terror::AU::MODERATE
Acme::Terror::AU::LOW
If it can't retrieve the current level, it will return
Acme::Terror::AU::UNKNOWN
BUGS
This module may become buggy if Australia develops a simple public and
level-based terror alert system, like the ones the US and UK have.
SEE ALSO
Acme::Terror, Acme::Terror::UK
AUTHOR
Adam Kennedy <adamk@cpan.org>
COPYRIGHT AND LICENSE
Copyright (C) 2006 Adam Kennedy.
This library is free software; you can redistribute it and/or modify it
under the same terms as Perl itself, either Perl version 5.8.7 or, at
your option, any later version of Perl 5 you may have available.
inc/Module/Install.pm view on Meta::CPAN
# releases once we can make sure it won't clash with custom
# Module::Install extensions.
$VERSION = '0.63';
}
# Whether or not inc::Module::Install is actually loaded, the
# $INC{inc/Module/Install.pm} is what will still get set as long as
# the caller loaded module this in the documented manner.
# If not set, the caller may NOT have loaded the bundled version, and thus
# they may not have a MI version that works with the Makefile.PL. This would
# result in false errors or unexpected behaviour. And we don't want that.
my $file = join( '/', 'inc', split /::/, __PACKAGE__ ) . '.pm';
unless ( $INC{$file} ) {
die <<"END_DIE";
Please invoke ${\__PACKAGE__} with:
use inc::${\__PACKAGE__};
not:
use ${\__PACKAGE__};
lib/Acme/Terror/AU.pm view on Meta::CPAN
package Acme::Terror::AU;
## Get and return the current AU terrorist threat status.
use 5.00503;
use strict;
use vars qw($VERSION);
$VERSION = '0.01';
use constant UNKNOWN => 0;
use constant CRITICAL => 1;
use constant SEVERE => 2;
lib/Acme/Terror/AU.pm view on Meta::CPAN
1;
__END__
=pod
=head1 NAME
Acme::Terror::AU - Fetch the current AU terror alert level
=head1 SYNOPSIS
use Acme::Terror::AU;
my $t = Acme::Terror::AU->new(); # create new Acme::Terror::AU object
my $level = $t->fetch;
print "Current terror alert level is: $level\n";
=head1 DESCRIPTION
Gets the currrent terrorist threat level in Australia.
The levels are either...
CRITICAL - an attack is expected imminently
SEVERE - an attack is likely
SUBSTANTIAL - an attack is a strong possibility
MODERATE - an attack is possible but not likely
LOW - an attack is unlikely
UNKNOWN - cannot determine threat level
HOWEVER, as the government has repeatedly stated that they think
triggering various security events off a single level system would be
damage flexibiliy by oversimplifying the situation, and in any case,
why on earth should they let the terrorists see what their alert status
is.
And so this module never returns any of the above status, and instead
always returns UNKNOWN. :)
This module aims to be compatible with the US version L<Acme::Terror>
and the UK version L<Acme::Terror::UK>.
=head1 METHODS
=head2 new()
use Acme::Terror::AU
my $t = Acme::Terror::AU->new();
Create a new instance of the Acme::Terror::AU class.
=head2 fetch()
my $threat_level_string = $t->fetch();
print $threat_level_string;
Return the current threat level as a string.
=head2 level()
my $level = $t->level();
if ($level == Acme::Terror::AU::CRITICAL) {
print "Help, we're all going to die!\n";
}
Return the level of the current terrorist threat as a comparable value.
The values to compare against are,
Acme::Terror::AU::CRITICAL
Acme::Terror::AU::SEVERE
Acme::Terror::AU::SUBSTANTIAL
Acme::Terror::AU::MODERATE
Acme::Terror::AU::LOW
If it can't retrieve the current level, it will return
Acme::Terror::AU::UNKNOWN
=head1 BUGS
This module may become buggy if Australia develops a simple public and
level-based terror alert system, like the ones the US and UK have.
=head1 SEE ALSO
L<Acme::Terror>, L<Acme::Terror::UK>
=head1 AUTHOR
Adam Kennedy E<lt>adamk@cpan.orgE<gt>
=head1 COPYRIGHT AND LICENSE
Copyright (C) 2006 Adam Kennedy.
t/01_compile.t view on Meta::CPAN
#!/usr/bin/perl -w
# Compile testing for Acme::Terror::AU
use strict;
use File::Spec::Functions ':ALL';
BEGIN {
$| = 1;
}
use Test::More tests => 2;
# Check their perl version
ok( $] >= 5.005, "Your perl is new enough" );
# Does the module load
require_ok('Acme::Terror::AU');
exit(0);
use Test::More;
eval "use Test::Pod 1.00";
plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
#####################################################################
# WARNING: INSANE BLACK MAGIC
#####################################################################
# Hack Pod::Simple::BlackBox to ignore the Test::Inline "=begin has more than one word errors"
my $begin = \&Pod::Simple::BlackBox::_ponder_begin;
sub mybegin {
my $para = $_[1];
my $content = join ' ', splice @$para, 2;
$content =~ s/^\s+//s;
$content =~ s/\s+$//s;
my @words = split /\s+/, $content;
if ( $words[0] =~ /^test(?:ing)?\z/s ) {
foreach ( 2 .. $#$para ) {
$para->[$_] = '';
( run in 0.765 second using v1.01-cache-2.11-cpan-65fba6d93b7 )