aipp 0.2.4 → 0.2.5

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.
Files changed (41) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/test.yml +26 -0
  3. data/.ruby-version +1 -1
  4. data/CHANGELOG.md +9 -0
  5. data/README.md +59 -7
  6. data/aipp.gemspec +3 -2
  7. data/lib/aipp.rb +2 -0
  8. data/lib/aipp/aip.rb +4 -12
  9. data/lib/aipp/downloader.rb +21 -21
  10. data/lib/aipp/executable.rb +4 -1
  11. data/lib/aipp/parser.rb +58 -5
  12. data/lib/aipp/regions/LF/AD-1.3.rb +27 -13
  13. data/lib/aipp/regions/LF/AD-1.6.rb +2 -2
  14. data/lib/aipp/regions/LF/AD-2.rb +30 -6
  15. data/lib/aipp/regions/LF/AD-3.1.rb +2 -2
  16. data/lib/aipp/regions/LF/ENR-2.1.rb +1 -1
  17. data/lib/aipp/regions/LF/ENR-4.1.rb +20 -78
  18. data/lib/aipp/regions/LF/ENR-4.3.rb +1 -1
  19. data/lib/aipp/regions/LF/ENR-5.1.rb +44 -26
  20. data/lib/aipp/regions/LF/ENR-5.5.rb +1 -1
  21. data/lib/aipp/regions/LF/helpers/{common.rb → base.rb} +2 -2
  22. data/lib/aipp/regions/LF/helpers/navigational_aid.rb +104 -0
  23. data/lib/aipp/regions/LF/helpers/{AD_radio.rb → radio_AD.rb} +24 -12
  24. data/lib/aipp/version.rb +1 -1
  25. data/lib/core_ext/object.rb +1 -1
  26. data/spec/fixtures/{archive.zip → source.zip} +0 -0
  27. data/spec/lib/aipp/airac_spec.rb +18 -18
  28. data/spec/lib/aipp/border_spec.rb +19 -19
  29. data/spec/lib/aipp/downloader_spec.rb +25 -25
  30. data/spec/lib/aipp/patcher_spec.rb +4 -4
  31. data/spec/lib/aipp/pdf_spec.rb +23 -23
  32. data/spec/lib/aipp/t_hash_spec.rb +6 -6
  33. data/spec/lib/aipp/version_spec.rb +1 -1
  34. data/spec/lib/core_ext/enumberable_spec.rb +15 -15
  35. data/spec/lib/core_ext/hash_spec.rb +4 -4
  36. data/spec/lib/core_ext/integer_spec.rb +2 -2
  37. data/spec/lib/core_ext/nil_class_spec.rb +1 -1
  38. data/spec/lib/core_ext/string_spec.rb +28 -28
  39. data/spec/spec_helper.rb +1 -0
  40. metadata +27 -12
  41. data/.travis.yml +0 -8
@@ -13,13 +13,13 @@ describe AIPP::THash do
13
13
 
14
14
  describe :tsort do
15
15
  it "must compile the overall dependency list" do
16
- subject.tsort.must_equal %i(net dns logger webserver)
16
+ _(subject.tsort).must_equal %i(net dns logger webserver)
17
17
  end
18
18
 
19
19
  it "must compile partial dependency lists" do
20
- subject.tsort(:dns).must_equal %i(net dns)
21
- subject.tsort(:logger).must_equal %i(logger)
22
- subject.tsort(:webserver).must_equal %i(net dns logger webserver)
20
+ _(subject.tsort(:dns)).must_equal %i(net dns)
21
+ _(subject.tsort(:logger)).must_equal %i(logger)
22
+ _(subject.tsort(:webserver)).must_equal %i(net dns logger webserver)
23
23
  end
24
24
  end
25
25
  end
@@ -36,8 +36,8 @@ describe AIPP::THash do
36
36
 
37
37
  describe :tsort do
38
38
  it "must raise cyclic dependency error" do
39
- -> { subject.tsort }.must_raise TSort::Cyclic
40
- -> { subject.tsort(:dns) }.must_raise TSort::Cyclic
39
+ _{ subject.tsort }.must_raise TSort::Cyclic
40
+ _{ subject.tsort(:dns) }.must_raise TSort::Cyclic
41
41
  end
42
42
  end
43
43
  end
@@ -2,6 +2,6 @@ require_relative '../../spec_helper'
2
2
 
3
3
  describe AIPP do
4
4
  it "must be defined" do
5
- AIPP::VERSION.wont_be_nil
5
+ _(AIPP::VERSION).wont_be_nil
6
6
  end
7
7
  end
@@ -5,53 +5,53 @@ describe Enumerable do
5
5
  describe :split do
6
6
  context "by object" do
7
7
  it "must split at matching element" do
8
- [1, 2, 0, 3, 4].split(0).must_equal [[1, 2], [3, 4]]
8
+ _([1, 2, 0, 3, 4].split(0)).must_equal [[1, 2], [3, 4]]
9
9
  end
10
10
 
11
11
  it "won't split when no element matches" do
12
- [1, 2, 3].split(0).must_equal [[1, 2, 3]]
12
+ _([1, 2, 3].split(0)).must_equal [[1, 2, 3]]
13
13
  end
14
14
 
15
15
  it "won't split zero length enumerable" do
16
- [].split(0).must_equal []
16
+ _([].split(0)).must_equal []
17
17
  end
18
18
 
19
19
  it "must keep leading empty subarrays" do
20
- [0, 1, 2, 0, 3, 4].split(0).must_equal [[], [1, 2], [3, 4]]
20
+ _([0, 1, 2, 0, 3, 4].split(0)).must_equal [[], [1, 2], [3, 4]]
21
21
  end
22
22
 
23
23
  it "must keep empty subarrays in the middle" do
24
- [1, 2, 0, 0, 3, 4].split(0).must_equal [[1, 2], [], [3, 4]]
24
+ _([1, 2, 0, 0, 3, 4].split(0)).must_equal [[1, 2], [], [3, 4]]
25
25
  end
26
26
 
27
27
  it "must drop trailing empty subarrays" do
28
- [1, 2, 0, 3, 4, 0].split(0).must_equal [[1, 2], [3, 4]]
28
+ _([1, 2, 0, 3, 4, 0].split(0)).must_equal [[1, 2], [3, 4]]
29
29
  end
30
30
  end
31
31
 
32
32
  context "by block" do
33
33
  it "must split at matching element" do
34
- [1, 2, 0, 3, 4].split { |e| e.zero? }.must_equal [[1, 2], [3, 4]]
34
+ _([1, 2, 0, 3, 4].split { |e| e.zero? }).must_equal [[1, 2], [3, 4]]
35
35
  end
36
36
 
37
37
  it "won't split when no element matches" do
38
- [1, 2, 3].split { |e| e.zero? }.must_equal [[1, 2, 3]]
38
+ _([1, 2, 3].split { |e| e.zero? }).must_equal [[1, 2, 3]]
39
39
  end
40
40
 
41
41
  it "won't split zero length enumerable" do
42
- [].split { |e| e.zero? }.must_equal []
42
+ _([].split { |e| e.zero? }).must_equal []
43
43
  end
44
44
 
45
45
  it "must keep leading empty subarrays" do
46
- [0, 1, 2, 0, 3, 4].split { |e| e.zero? }.must_equal [[], [1, 2], [3, 4]]
46
+ _([0, 1, 2, 0, 3, 4].split { |e| e.zero? }).must_equal [[], [1, 2], [3, 4]]
47
47
  end
48
48
 
49
49
  it "must keep empty subarrays in the middle" do
50
- [1, 2, 0, 0, 3, 4].split { |e| e.zero? }.must_equal [[1, 2], [], [3, 4]]
50
+ _([1, 2, 0, 0, 3, 4].split { |e| e.zero? }).must_equal [[1, 2], [], [3, 4]]
51
51
  end
52
52
 
53
53
  it "must drop trailing empty subarrays" do
54
- [1, 2, 0, 3, 4, 0].split { |e| e.zero? }.must_equal [[1, 2], [3, 4]]
54
+ _([1, 2, 0, 3, 4, 0].split { |e| e.zero? }).must_equal [[1, 2], [3, 4]]
55
55
  end
56
56
  end
57
57
  end
@@ -59,17 +59,17 @@ describe Enumerable do
59
59
  describe :group_by_chunks do
60
60
  it "fails to group if the first element does not meet the chunk condition" do
61
61
  subject = [10, 11, 12, 2, 20, 21 ]
62
- -> { subject.group_by_chunks { |i| i < 10 } }.must_raise ArgumentError
62
+ _{ subject.group_by_chunks { |i| i < 10 } }.must_raise ArgumentError
63
63
  end
64
64
 
65
65
  it "must map matching elements to array of subsequent non-matching elements" do
66
66
  subject = [1, 10, 11, 12, 2, 20, 21, 3, 30, 31, 32]
67
- subject.group_by_chunks { |i| i < 10 }.must_equal(1 => [10, 11, 12], 2 => [20, 21], 3 => [30, 31, 32])
67
+ _(subject.group_by_chunks { |i| i < 10 }).must_equal(1 => [10, 11, 12], 2 => [20, 21], 3 => [30, 31, 32])
68
68
  end
69
69
 
70
70
  it "must map matching elements to empty array if no subsequent non-matching elements exist" do
71
71
  subject = [1, 10, 11, 12, 2, 3, 30]
72
- subject.group_by_chunks { |i| i < 10 }.must_equal(1 => [10, 11, 12], 2 => [], 3 => [30])
72
+ _(subject.group_by_chunks { |i| i < 10 }).must_equal(1 => [10, 11, 12], 2 => [], 3 => [30])
73
73
  end
74
74
  end
75
75
 
@@ -8,19 +8,19 @@ describe Hash do
8
8
  end
9
9
 
10
10
  it "must return value of matching regexp key" do
11
- subject.metch('abc').must_equal :a
11
+ _(subject.metch('abc')).must_equal :a
12
12
  end
13
13
 
14
14
  it "must return value of equal non-regexp key" do
15
- subject.metch('b').must_equal :b
15
+ _(subject.metch('b')).must_equal :b
16
16
  end
17
17
 
18
18
  it "fails with KeyError if nothing matches" do
19
- -> { subject.metch('bcd') }.must_raise KeyError
19
+ _{ subject.metch('bcd') }.must_raise KeyError
20
20
  end
21
21
 
22
22
  it "returns fallback value if nothing matches" do
23
- subject.metch('x', :foobar).must_equal :foobar
23
+ _(subject.metch('x', :foobar)).must_equal :foobar
24
24
  end
25
25
  end
26
26
 
@@ -4,11 +4,11 @@ describe Integer do
4
4
 
5
5
  describe :up_or_downto do
6
6
  it "behaves like Integer#upto for an increasing range" do
7
- 10.up_or_downto(12).to_a.must_equal 10.upto(12).to_a
7
+ _(10.up_or_downto(12).to_a).must_equal 10.upto(12).to_a
8
8
  end
9
9
 
10
10
  it "behaves like Integer#downto for a decreasing range" do
11
- 10.up_or_downto(8).to_a.must_equal 10.downto(8).to_a
11
+ _(10.up_or_downto(8).to_a).must_equal 10.downto(8).to_a
12
12
  end
13
13
  end
14
14
 
@@ -4,7 +4,7 @@ describe NilClass do
4
4
 
5
5
  describe :blank_to_nil do
6
6
  it "must return nil" do
7
- nil.blank_to_nil.must_be :nil?
7
+ _(nil.blank_to_nil).must_be :nil?
8
8
  end
9
9
  end
10
10
 
@@ -4,40 +4,40 @@ describe String do
4
4
 
5
5
  describe :blank_to_nil do
6
6
  it "must convert blank to nil" do
7
- "\n \n ".blank_to_nil.must_be :nil?
7
+ _("\n \n ".blank_to_nil).must_be :nil?
8
8
  end
9
9
 
10
10
  it "must leave non-blank untouched" do
11
- "foobar".blank_to_nil.must_equal "foobar"
11
+ _("foobar".blank_to_nil).must_equal "foobar"
12
12
  end
13
13
 
14
14
  it "must leave non-blank with whitespace untouched" do
15
- "\nfoo bar\n".blank_to_nil.must_equal "\nfoo bar\n"
15
+ _("\nfoo bar\n".blank_to_nil).must_equal "\nfoo bar\n"
16
16
  end
17
17
  end
18
18
 
19
19
  describe :cleanup do
20
20
  it "must replace double apostrophes" do
21
- "the ''Terror'' was a fine ship".cleanup.must_equal 'the "Terror" was a fine ship'
21
+ _("the ''Terror'' was a fine ship".cleanup).must_equal 'the "Terror" was a fine ship'
22
22
  end
23
23
 
24
24
  it "must replace funky apostrophes and quotes" do
25
- "from ’a‘ to “b”".cleanup.must_equal %q(from 'a' to "b")
25
+ _("from ’a‘ to “b”".cleanup).must_equal %q(from 'a' to "b")
26
26
  end
27
27
 
28
28
  it "must remove whitespace within quotes" do
29
- 'the " best " way to fly'.cleanup.must_equal 'the "best" way to fly'
30
- %Q(the " best\nway " to fly).cleanup.must_equal %Q(the "best\nway" to fly)
29
+ _('the " best " way to fly'.cleanup).must_equal 'the "best" way to fly'
30
+ _(%Q(the " best\nway " to fly).cleanup).must_equal %Q(the "best\nway" to fly)
31
31
  end
32
32
  end
33
33
 
34
34
  describe :compact do
35
35
  it "must remove unneccessary whitespace" do
36
- " foo\n\nbar \r".compact.must_equal "foo\nbar"
37
- "foo\n \nbar".compact.must_equal "foo\nbar"
38
- " ".compact.must_equal ""
39
- "\n \r \v ".compact.must_equal ""
40
- "okay".compact.must_equal "okay"
36
+ _(" foo\n\nbar \r".compact).must_equal "foo\nbar"
37
+ _("foo\n \nbar".compact).must_equal "foo\nbar"
38
+ _(" ".compact).must_equal ""
39
+ _("\n \r \v ".compact).must_equal ""
40
+ _("okay".compact).must_equal "okay"
41
41
  end
42
42
  end
43
43
 
@@ -47,65 +47,65 @@ describe String do
47
47
  end
48
48
 
49
49
  it "must recognize similar words with 5 or more characters" do
50
- subject.correlate("truck route").must_equal 2
50
+ _(subject.correlate("truck route")).must_equal 2
51
51
  end
52
52
 
53
53
  it "must recognize street denominators with 2 or more characters" do
54
- subject.correlate("truck N 3").must_equal 2
54
+ _(subject.correlate("truck N 3")).must_equal 2
55
55
  end
56
56
 
57
57
  it "must ignore whitespace in road identifiers" do
58
- subject.correlate("truck N3").must_equal 2
58
+ _(subject.correlate("truck N3")).must_equal 2
59
59
  end
60
60
 
61
61
  it "must get rid of accents and similar decorations" do
62
- subject.correlate("truck Montreal").must_equal 2
62
+ _(subject.correlate("truck Montreal")).must_equal 2
63
63
  end
64
64
 
65
65
  it "must downcase" do
66
- subject.correlate("truck montreal").must_equal 2
66
+ _(subject.correlate("truck montreal")).must_equal 2
67
67
  end
68
68
 
69
69
  it "must honor synonyms" do
70
- subject.correlate("truck south", ['south', 'sud']).must_equal 2
70
+ _(subject.correlate("truck south", ['south', 'sud'])).must_equal 2
71
71
  end
72
72
 
73
73
  it "must ignore words with less than 5 characters" do
74
- subject.correlate("en on for").must_equal 0
74
+ _(subject.correlate("en on for")).must_equal 0
75
75
  end
76
76
  end
77
77
 
78
78
  describe :to_ff do
79
79
  it "must convert normal float numbers as does to_f" do
80
- "5".to_ff.must_equal "5".to_f
81
- "5.1".to_ff.must_equal "5.1".to_f
82
- " 5.2 ".to_ff.must_equal " 5.2 ".to_f
80
+ _("5".to_ff).must_equal "5".to_f
81
+ _("5.1".to_ff).must_equal "5.1".to_f
82
+ _(" 5.2 ".to_ff).must_equal " 5.2 ".to_f
83
83
  end
84
84
 
85
85
  it "must convert comma float numbers as well" do
86
- "5,1".to_ff.must_equal "5.1".to_f
87
- " 5,2 ".to_ff.must_equal "5.2".to_f
86
+ _("5,1".to_ff).must_equal "5.1".to_f
87
+ _(" 5,2 ".to_ff).must_equal "5.2".to_f
88
88
  end
89
89
  end
90
90
 
91
91
  describe :full_strip do
92
92
  it "must behave like strip" do
93
93
  subject = " foobar\t\t"
94
- subject.full_strip.must_equal subject.strip
94
+ _(subject.full_strip).must_equal subject.strip
95
95
  end
96
96
 
97
97
  it "must remove non-letterlike characters as well" do
98
- " - foobar :.".full_strip.must_equal "foobar"
98
+ _(" - foobar :.".full_strip).must_equal "foobar"
99
99
  end
100
100
  end
101
101
 
102
102
  describe :unglue do
103
103
  it "must insert spaces between camel glued words" do
104
- "thisString has spaceProblems".unglue.must_equal "this String has space Problems"
104
+ _("thisString has spaceProblems".unglue).must_equal "this String has space Problems"
105
105
  end
106
106
 
107
107
  it "must insert spaces between three-or-more-letter and number-only words" do
108
- "the first123meters of D25".unglue.must_equal "the first 123 meters of D25"
108
+ _("the first123meters of D25".unglue).must_equal "the first 123 meters of D25"
109
109
  end
110
110
  end
111
111
 
@@ -12,6 +12,7 @@ Minitest::Sound.failure = Pathname(__dir__).join('sounds/failure.mp3').to_s
12
12
  require 'minitest/reporters'
13
13
  Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Sound::Reporter.new]
14
14
 
15
+ require 'minitest/focus'
15
16
  require 'minitest/matchers'
16
17
  require 'spy/integration'
17
18
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aipp
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.4
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-22 00:00:00.000000000 Z
11
+ date: 2019-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: minitest-focus
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - ">="
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: minitest-matchers
71
85
  requirement: !ruby/object:Gem::Requirement
@@ -128,14 +142,14 @@ dependencies:
128
142
  requirements:
129
143
  - - ">="
130
144
  - !ruby/object:Gem::Version
131
- version: 0.3.6
145
+ version: 0.3.8
132
146
  type: :runtime
133
147
  prerelease: false
134
148
  version_requirements: !ruby/object:Gem::Requirement
135
149
  requirements:
136
150
  - - ">="
137
151
  - !ruby/object:Gem::Version
138
- version: 0.3.6
152
+ version: 0.3.8
139
153
  - !ruby/object:Gem::Dependency
140
154
  name: activesupport
141
155
  requirement: !ruby/object:Gem::Requirement
@@ -212,14 +226,14 @@ dependencies:
212
226
  requirements:
213
227
  - - "~>"
214
228
  - !ruby/object:Gem::Version
215
- version: '1'
229
+ version: '2'
216
230
  type: :runtime
217
231
  prerelease: false
218
232
  version_requirements: !ruby/object:Gem::Requirement
219
233
  requirements:
220
234
  - - "~>"
221
235
  - !ruby/object:Gem::Version
222
- version: '1'
236
+ version: '2'
223
237
  - !ruby/object:Gem::Dependency
224
238
  name: colorize
225
239
  requirement: !ruby/object:Gem::Requirement
@@ -285,9 +299,9 @@ executables:
285
299
  extensions: []
286
300
  extra_rdoc_files: []
287
301
  files:
302
+ - ".github/workflows/test.yml"
288
303
  - ".gitignore"
289
304
  - ".ruby-version"
290
- - ".travis.yml"
291
305
  - ".yardopts"
292
306
  - CHANGELOG.md
293
307
  - Guardfile
@@ -323,9 +337,10 @@ files:
323
337
  - lib/aipp/regions/LF/fixtures/AD-1.3.yml
324
338
  - lib/aipp/regions/LF/fixtures/AD-2.yml
325
339
  - lib/aipp/regions/LF/fixtures/AD-3.1.yml
326
- - lib/aipp/regions/LF/helpers/AD_radio.rb
327
340
  - lib/aipp/regions/LF/helpers/URL.rb
328
- - lib/aipp/regions/LF/helpers/common.rb
341
+ - lib/aipp/regions/LF/helpers/base.rb
342
+ - lib/aipp/regions/LF/helpers/navigational_aid.rb
343
+ - lib/aipp/regions/LF/helpers/radio_AD.rb
329
344
  - lib/aipp/t_hash.rb
330
345
  - lib/aipp/version.rb
331
346
  - lib/core_ext/enumerable.rb
@@ -335,13 +350,13 @@ files:
335
350
  - lib/core_ext/object.rb
336
351
  - lib/core_ext/string.rb
337
352
  - rakefile.rb
338
- - spec/fixtures/archive.zip
339
353
  - spec/fixtures/border.geojson
340
354
  - spec/fixtures/document.pdf
341
355
  - spec/fixtures/document.pdf.json
342
356
  - spec/fixtures/new.html
343
357
  - spec/fixtures/new.pdf
344
358
  - spec/fixtures/new.txt
359
+ - spec/fixtures/source.zip
345
360
  - spec/lib/aipp/airac_spec.rb
346
361
  - spec/lib/aipp/border_spec.rb
347
362
  - spec/lib/aipp/downloader_spec.rb
@@ -376,18 +391,18 @@ required_rubygems_version: !ruby/object:Gem::Requirement
376
391
  - !ruby/object:Gem::Version
377
392
  version: '0'
378
393
  requirements: []
379
- rubygems_version: 3.0.3
394
+ rubygems_version: 3.0.6
380
395
  signing_key:
381
396
  specification_version: 4
382
397
  summary: Parser for Aeronautical Information Publications (AIP).
383
398
  test_files:
384
- - spec/fixtures/archive.zip
385
399
  - spec/fixtures/border.geojson
386
400
  - spec/fixtures/document.pdf
387
401
  - spec/fixtures/document.pdf.json
388
402
  - spec/fixtures/new.html
389
403
  - spec/fixtures/new.pdf
390
404
  - spec/fixtures/new.txt
405
+ - spec/fixtures/source.zip
391
406
  - spec/lib/aipp/airac_spec.rb
392
407
  - spec/lib/aipp/border_spec.rb
393
408
  - spec/lib/aipp/downloader_spec.rb
@@ -1,8 +0,0 @@
1
- ---
2
- language: ruby
3
- rvm:
4
- - 2.6.3
5
- before_install:
6
- - gem update --system
7
- - gem install bundler
8
- - bundle install