aipp 0.2.4 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. checksums.yaml.gz.sig +2 -0
  3. data/CHANGELOG.md +38 -0
  4. data/README.md +222 -88
  5. data/exe/aip2aixm +2 -2
  6. data/exe/aip2ofmx +2 -2
  7. data/lib/aipp/aip.rb +113 -31
  8. data/lib/aipp/border.rb +77 -46
  9. data/lib/aipp/debugger.rb +101 -0
  10. data/lib/aipp/downloader.rb +39 -26
  11. data/lib/aipp/executable.rb +41 -22
  12. data/lib/aipp/parser.rb +94 -21
  13. data/lib/aipp/patcher.rb +5 -2
  14. data/lib/aipp/pdf.rb +1 -1
  15. data/lib/aipp/regions/LF/README.md +49 -0
  16. data/lib/aipp/regions/LF/aerodromes.rb +223 -0
  17. data/lib/aipp/regions/LF/d_p_r_airspaces.rb +56 -0
  18. data/lib/aipp/regions/LF/dangerous_activities.rb +49 -0
  19. data/lib/aipp/regions/LF/designated_points.rb +47 -0
  20. data/lib/aipp/regions/LF/fixtures/aerodromes.yml +608 -0
  21. data/lib/aipp/regions/LF/helipads.rb +122 -0
  22. data/lib/aipp/regions/LF/helpers/base.rb +218 -0
  23. data/lib/aipp/regions/LF/helpers/surface.rb +49 -0
  24. data/lib/aipp/regions/LF/helpers/usage_limitation.rb +20 -0
  25. data/lib/aipp/regions/LF/navigational_aids.rb +85 -0
  26. data/lib/aipp/regions/LF/obstacles.rb +153 -0
  27. data/lib/aipp/regions/LF/serviced_airspaces.rb +70 -0
  28. data/lib/aipp/regions/LF/services.rb +172 -0
  29. data/lib/aipp/t_hash.rb +4 -5
  30. data/lib/aipp/version.rb +1 -1
  31. data/lib/aipp.rb +11 -5
  32. data/lib/core_ext/enumerable.rb +9 -9
  33. data/lib/core_ext/hash.rb +21 -5
  34. data/lib/core_ext/nokogiri.rb +54 -0
  35. data/lib/core_ext/string.rb +38 -66
  36. data.tar.gz.sig +2 -0
  37. metadata +180 -188
  38. metadata.gz.sig +0 -0
  39. data/.gitignore +0 -8
  40. data/.ruby-version +0 -1
  41. data/.travis.yml +0 -8
  42. data/.yardopts +0 -3
  43. data/Guardfile +0 -7
  44. data/TODO.md +0 -6
  45. data/aipp.gemspec +0 -44
  46. data/gems.rb +0 -3
  47. data/lib/aipp/airac.rb +0 -55
  48. data/lib/aipp/regions/LF/AD-1.3.rb +0 -162
  49. data/lib/aipp/regions/LF/AD-1.6.rb +0 -31
  50. data/lib/aipp/regions/LF/AD-2.rb +0 -313
  51. data/lib/aipp/regions/LF/AD-3.1.rb +0 -185
  52. data/lib/aipp/regions/LF/ENR-2.1.rb +0 -92
  53. data/lib/aipp/regions/LF/ENR-4.1.rb +0 -97
  54. data/lib/aipp/regions/LF/ENR-4.3.rb +0 -28
  55. data/lib/aipp/regions/LF/ENR-5.1.rb +0 -75
  56. data/lib/aipp/regions/LF/ENR-5.5.rb +0 -53
  57. data/lib/aipp/regions/LF/fixtures/AD-1.3.yml +0 -511
  58. data/lib/aipp/regions/LF/fixtures/AD-2.yml +0 -185
  59. data/lib/aipp/regions/LF/fixtures/AD-3.1.yml +0 -10
  60. data/lib/aipp/regions/LF/helpers/AD_radio.rb +0 -90
  61. data/lib/aipp/regions/LF/helpers/URL.rb +0 -26
  62. data/lib/aipp/regions/LF/helpers/common.rb +0 -217
  63. data/lib/core_ext/object.rb +0 -43
  64. data/rakefile.rb +0 -12
  65. data/spec/fixtures/archive.zip +0 -0
  66. data/spec/fixtures/border.geojson +0 -201
  67. data/spec/fixtures/document.pdf +0 -0
  68. data/spec/fixtures/document.pdf.json +0 -1
  69. data/spec/fixtures/new.html +0 -6
  70. data/spec/fixtures/new.pdf +0 -0
  71. data/spec/fixtures/new.txt +0 -1
  72. data/spec/lib/aipp/airac_spec.rb +0 -98
  73. data/spec/lib/aipp/border_spec.rb +0 -135
  74. data/spec/lib/aipp/downloader_spec.rb +0 -81
  75. data/spec/lib/aipp/patcher_spec.rb +0 -46
  76. data/spec/lib/aipp/pdf_spec.rb +0 -124
  77. data/spec/lib/aipp/t_hash_spec.rb +0 -44
  78. data/spec/lib/aipp/version_spec.rb +0 -7
  79. data/spec/lib/core_ext/enumberable_spec.rb +0 -76
  80. data/spec/lib/core_ext/hash_spec.rb +0 -27
  81. data/spec/lib/core_ext/integer_spec.rb +0 -15
  82. data/spec/lib/core_ext/nil_class_spec.rb +0 -11
  83. data/spec/lib/core_ext/string_spec.rb +0 -112
  84. data/spec/sounds/failure.mp3 +0 -0
  85. data/spec/sounds/success.mp3 +0 -0
  86. data/spec/spec_helper.rb +0 -28
@@ -1,112 +0,0 @@
1
- require_relative '../../spec_helper'
2
-
3
- describe String do
4
-
5
- describe :blank_to_nil do
6
- it "must convert blank to nil" do
7
- "\n \n ".blank_to_nil.must_be :nil?
8
- end
9
-
10
- it "must leave non-blank untouched" do
11
- "foobar".blank_to_nil.must_equal "foobar"
12
- end
13
-
14
- it "must leave non-blank with whitespace untouched" do
15
- "\nfoo bar\n".blank_to_nil.must_equal "\nfoo bar\n"
16
- end
17
- end
18
-
19
- describe :cleanup do
20
- it "must replace double apostrophes" do
21
- "the ''Terror'' was a fine ship".cleanup.must_equal 'the "Terror" was a fine ship'
22
- end
23
-
24
- it "must replace funky apostrophes and quotes" do
25
- "from ’a‘ to “b”".cleanup.must_equal %q(from 'a' to "b")
26
- end
27
-
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)
31
- end
32
- end
33
-
34
- describe :compact do
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"
41
- end
42
- end
43
-
44
- describe :correlate do
45
- subject do
46
- %q(Truck "Montréal" en route on N 3 sud)
47
- end
48
-
49
- it "must recognize similar words with 5 or more characters" do
50
- subject.correlate("truck route").must_equal 2
51
- end
52
-
53
- it "must recognize street denominators with 2 or more characters" do
54
- subject.correlate("truck N 3").must_equal 2
55
- end
56
-
57
- it "must ignore whitespace in road identifiers" do
58
- subject.correlate("truck N3").must_equal 2
59
- end
60
-
61
- it "must get rid of accents and similar decorations" do
62
- subject.correlate("truck Montreal").must_equal 2
63
- end
64
-
65
- it "must downcase" do
66
- subject.correlate("truck montreal").must_equal 2
67
- end
68
-
69
- it "must honor synonyms" do
70
- subject.correlate("truck south", ['south', 'sud']).must_equal 2
71
- end
72
-
73
- it "must ignore words with less than 5 characters" do
74
- subject.correlate("en on for").must_equal 0
75
- end
76
- end
77
-
78
- describe :to_ff do
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
83
- end
84
-
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
88
- end
89
- end
90
-
91
- describe :full_strip do
92
- it "must behave like strip" do
93
- subject = " foobar\t\t"
94
- subject.full_strip.must_equal subject.strip
95
- end
96
-
97
- it "must remove non-letterlike characters as well" do
98
- " - foobar :.".full_strip.must_equal "foobar"
99
- end
100
- end
101
-
102
- describe :unglue do
103
- it "must insert spaces between camel glued words" do
104
- "thisString has spaceProblems".unglue.must_equal "this String has space Problems"
105
- end
106
-
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"
109
- end
110
- end
111
-
112
- end
Binary file
Binary file
data/spec/spec_helper.rb DELETED
@@ -1,28 +0,0 @@
1
- gem 'minitest'
2
-
3
- require 'pathname'
4
-
5
- require 'minitest/autorun'
6
- require Pathname(__dir__).join('..', 'lib', 'aipp')
7
-
8
- require 'minitest/sound'
9
- require 'minitest/sound/reporter'
10
- Minitest::Sound.success = Pathname(__dir__).join('sounds/success.mp3').to_s
11
- Minitest::Sound.failure = Pathname(__dir__).join('sounds/failure.mp3').to_s
12
- require 'minitest/reporters'
13
- Minitest::Reporters.use! [Minitest::Reporters::SpecReporter.new, Minitest::Sound::Reporter.new]
14
-
15
- require 'minitest/matchers'
16
- require 'spy/integration'
17
-
18
- module AIPP
19
- def self.root
20
- Pathname(__dir__).join('..')
21
- end
22
- end
23
-
24
- class MiniTest::Spec
25
- class << self
26
- alias_method :context, :describe
27
- end
28
- end