metar-parser 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +4 -0
- data/lib/metar/parser.rb +4 -0
- data/lib/metar/version.rb +1 -1
- data/spec/parser_spec.rb +40 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2e0388461861adfdb50306cdb0b8044056ba41f
|
4
|
+
data.tar.gz: 160ed08277376b4f977b1fc67a0bd97d6969ac76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df0e0d548d8365d4b637e6fc75287891f640f8df24534a4849fd4d7e805bd389460096eccfd5040a0cf16dc7df74b2936cd996b2ba41e7fd13fdbf3d73e00af7
|
7
|
+
data.tar.gz: aed5bba18e4875247db0f99762bf9babaf9ff3cc79ada5483ca4c601db6d15fb8360a2a43a5b7af99279ae914881b52a86559e9682a7d138dee282b8cd8cd77d
|
data/README.md
CHANGED
@@ -100,6 +100,10 @@ I18n.locale = :'en-US'
|
|
100
100
|
I18n.t('metar.station_code.title') # station code
|
101
101
|
```
|
102
102
|
|
103
|
+
# The METAR Format
|
104
|
+
|
105
|
+
See `doc/metar_format`.
|
106
|
+
|
103
107
|
# Compliance
|
104
108
|
|
105
109
|
By default, the parser runs in 'loose' compliance mode. That means that it tries to
|
data/lib/metar/parser.rb
CHANGED
data/lib/metar/version.rb
CHANGED
data/spec/parser_spec.rb
CHANGED
@@ -328,6 +328,46 @@ describe Metar::Parser do
|
|
328
328
|
end
|
329
329
|
end
|
330
330
|
end
|
331
|
+
|
332
|
+
context "final '='" do
|
333
|
+
let(:parser) {setup_parser('LPPT 070530Z 34003KT 310V010 CAVOK 14/12 Q1013=')}
|
334
|
+
|
335
|
+
it 'parses the final chunk' do
|
336
|
+
expect(parser.sea_level_pressure.value).to eq(1.013)
|
337
|
+
end
|
338
|
+
|
339
|
+
context 'in strict mode' do
|
340
|
+
before do
|
341
|
+
Metar::Parser.compliance = :strict
|
342
|
+
end
|
343
|
+
|
344
|
+
it 'causes and error' do
|
345
|
+
expect do
|
346
|
+
parser
|
347
|
+
end.to raise_error(Metar::ParseError, /Unparsable text found/)
|
348
|
+
end
|
349
|
+
end
|
350
|
+
end
|
351
|
+
|
352
|
+
context "final ' ='" do
|
353
|
+
let(:parser) {setup_parser('LPPT 070530Z 34003KT 310V010 CAVOK 14/12 Q1013 =')}
|
354
|
+
|
355
|
+
it 'parses the final chunk' do
|
356
|
+
expect(parser.sea_level_pressure.value).to eq(1.013)
|
357
|
+
end
|
358
|
+
|
359
|
+
context 'in strict mode' do
|
360
|
+
before do
|
361
|
+
Metar::Parser.compliance = :strict
|
362
|
+
end
|
363
|
+
|
364
|
+
it 'causes and error' do
|
365
|
+
expect do
|
366
|
+
parser
|
367
|
+
end.to raise_error(Metar::ParseError, /Unparsable text found/)
|
368
|
+
end
|
369
|
+
end
|
370
|
+
end
|
331
371
|
end
|
332
372
|
|
333
373
|
context "#raw_attributes" do
|