1
Index: libgeo-metar-perl/METAR.pm
2
===================================================================
3
--- libgeo-metar-perl.orig/METAR.pm
4
+++ libgeo-metar-perl/METAR.pm
5
@@ -364,8 +364,7 @@ sub new
7
$self->{site} = undef; # the site code (4 chars)
8
$self->{date_time} = undef; # date/time
9
- $self->{modifier} = "AUTO"; # the AUTO/COR modifier (if
11
+ $self->{modifier} = undef; # the AUTO/COR modifier
12
$self->{wind} = undef; # the wind information
13
$self->{windtype} = undef; # the wind speed type (knots/meterpersecond/kilometersperhour)
14
$self->{windvar} = undef; # the wind variation
15
@@ -1431,8 +1430,11 @@ applications.
16
Here is how you I<might> use the Geo::METAR module.
18
One use that I have had for this module is to query the NWS METAR page
19
-(using the LWP modules) at
20
-http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=EHSB to get an
21
+(using the LWP modules) at:
23
+I<http://weather.noaa.gov/cgi-bin/mgetmetar.pl?cccc=EHSB>
26
up-to-date METAR. Then, I scan thru the output, looking for what looks
27
like a METAR string (that's not hard in Perl). Oh, EHSB can be any site
28
location code where there is a reporting station.
29
Index: libgeo-metar-perl/t/metar.t
30
===================================================================
31
--- libgeo-metar-perl.orig/t/metar.t
32
+++ libgeo-metar-perl/t/metar.t
34
# Test script for METAR installation.
38
+use Test::More tests => 7;
40
-BEGIN { plan tests => 6 }
41
+my $modname = "Geo::METAR";
46
-my %tally = (passed => 0, failed => 0, skipped => 0);
48
-print "Testing METAR.\n";
50
-my $m = new Geo::METAR;
52
-# Create a new instance.
54
-if (ref $m eq 'Geo::METAR') {
61
-## Try out one hard-coded example. We need many more of these.
64
-if ($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014")) {
70
-if ($m->SITE eq "KFDY") {
76
-if ($m->DATE eq "25") {
82
-if ($m->MOD eq "AUTO") {
88
-if ($m->TEMP_F eq "39.2") {
94
+ok($m = $modname->new());
95
+ok(ref $m eq $modname);
97
+ok($m->metar("KFDY 251450Z 21012G21KT 8SM OVC065 04/M01 A3010 RMK 57014"));
98
+ok($m->SITE eq "KFDY");
99
+ok($m->DATE eq "25");
100
+ok($m->TEMP_F eq "39.2");