Acme-Terror-NL
view release on metacpan or search on metacpan
Revision history for Perl module Acme::Terror::NL
0.04 Mar 13 2013
- source site changed HTML markup; patched module
0.03 Dec 14 2007
- source site changed HTML markup; patched module
0.02 Jun 04 2007
- source site changed HTML markup; patched module
MANIFEST
README
LICENSE
Changes
Makefile.PL
lib/Acme/Terror/NL.pm
t/001_load.t
META.yml Module meta-data (added by MakeMaker)
--- #YAML:1.0
name: Acme-Terror-NL
version: 0.04
abstract: Fetch the current NL terror alert level
author:
- M. Blom (blom@cpan.org)
license: unknown
distribution_type: module
configure_requires:
ExtUtils::MakeMaker: 0
build_requires:
ExtUtils::MakeMaker: 0
requires:
constant: 1.01
LWP::Simple: 0
Test::Simple: 0.44
resources:
repository: https://github.com/b10m/p5-Acme-Terror-NL
no_index:
directory:
- t
- inc
generated_by: ExtUtils::MakeMaker version 6.57_05
meta-spec:
url: http://module-build.sourceforge.net/META-spec-v1.4.html
version: 1.4
Makefile.PL view on Meta::CPAN
use ExtUtils::MakeMaker;
WriteMakefile(
NAME => 'Acme::Terror::NL',
VERSION_FROM => 'lib/Acme/Terror/NL.pm', # finds \$VERSION
AUTHOR => 'M. Blom (blom@cpan.org)',
ABSTRACT => 'Fetch the current NL terror alert level',
PREREQ_PM => {
'Test::Simple' => 0.44,
'constant' => 1.01,
'LWP::Simple' => 0
},
META_MERGE => {
resources => {
repository => 'https://github.com/b10m/p5-Acme-Terror-NL',
},
},
);
Acme::Terror::NL
================
INSTALLATION
To install this module type the following:
perl Makefile.PL
make
make test
make install
lib/Acme/Terror/NL.pm view on Meta::CPAN
package Acme::Terror::NL;
use strict;
use LWP::Simple;
use vars qw($VERSION);
$VERSION = '0.04';
use constant {
UNKNOWN => 0,
CRITICAL => 1,
SUBSTANTIAL => 2,
lib/Acme/Terror/NL.pm view on Meta::CPAN
sub level {
my $self = shift;
$self->fetch unless($self->{_level});
return $self->{_level};
}
#-------------------------------------------------------------------#
=head1 NAME
Acme::Terror::NL - Fetch the current NL terror alert level
=head1 SYNOPSIS
use Acme::Terror::NL;
my $t = Acme::Terror::NL->new(); # create new Acme::Terror::NL object
my $level = $t->fetch;
print "Current terror alert level is: $level\n";
=head1 DESCRIPTION
Gets the currrent terrorist threat level in the Netherlands.
The levels are either...
CRITICAL - there are strong indications that an attack will occur
SUBSTANTIAL - there is a realistic possibility that an attack will occur
LIMITED - it appears that attacks can be prevented.
MINIMAL - it is unlikely that attacks are being planned.
UNKNOWN - cannot determine threat level
There are "only" four levels present in the Netherlands, unlike, e.g. the
United Kingdom and the United States of America, where there are five.
Thats what you get for being a small country.
This module aims to be compatible with the US version, L<Acme::Terror>,
the UK version, L<Acme::Terror::UK> and the AU version, L<Acme::Terror::AU>.
=head1 METHODS
=head2 new()
use Acme::Terror::NL;
my $t = Acme::Terror::NL->new();
Create a new instance of the Acme:Terror::NL class.
=head2 fetch()
my $threat_level_string = $t->fetch();
print $threat_level_string;
Return the current threat level as a string.
=head2 text()
See C<fetch()>, it returns the same.
=head2 level()
my $level = $t->level();
if ($level == Acme::Terror::NL::CRITICAL) {
print "too many L<Acme::Code::FreedomFighter>s!";
}
Return the level of the current terrorist threat as a comparable value.
The values to compare against are,
Acme::Terror::NL::CRITICAL
Acme::Terror::NL::SUBSTANTIAL
Acme::Terror::NL::LIMITED
Acme::Terror::NL::MINIMAL
If it can't retrieve the current level, it will return
Acme::Terror::NL::UNKNOWN
=head1 BUGS
Blame the terrorists! ... or report it to L<http://rt.cpan.org/Public/Dist/Display.html?Name=Acme::Terror::NL>.
=head1 AUTHOR
M. Blom,
E<lt>blom@cpan.orgE<gt>
L<http://menno.b10m.net/perl/>
=head1 COPYRIGHT
This program is free software; you can redistribute
it and/or modify it under the same terms as Perl itself.
The full text of the license can be found in the
LICENSE file included with this module.
=head1 SEE ALSO
=over 4
=item * L<Acme::Terror>, L<Acme::Terror::UK>, L<Acme::Terror::AU>
=item * L<http://english.nctb.nl/>
=back
=cut
1;
t/001_load.t view on Meta::CPAN
# -*- perl -*-
# t/001_load.t - check module loading and create testing directory
use Test::More tests => 2;
BEGIN { use_ok( 'Acme::Terror::NL' ); }
my $object = Acme::Terror::NL->new ();
isa_ok ($object, 'Acme::Terror::NL');
( run in 0.467 second using v1.01-cache-2.11-cpan-65fba6d93b7 )