aipp 0.2.4 → 1.0.0
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
- checksums.yaml.gz.sig +2 -0
- data/CHANGELOG.md +38 -0
- data/README.md +222 -88
- data/exe/aip2aixm +2 -2
- data/exe/aip2ofmx +2 -2
- data/lib/aipp/aip.rb +113 -31
- data/lib/aipp/border.rb +77 -46
- data/lib/aipp/debugger.rb +101 -0
- data/lib/aipp/downloader.rb +39 -26
- data/lib/aipp/executable.rb +41 -22
- data/lib/aipp/parser.rb +94 -21
- data/lib/aipp/patcher.rb +5 -2
- data/lib/aipp/pdf.rb +1 -1
- data/lib/aipp/regions/LF/README.md +49 -0
- data/lib/aipp/regions/LF/aerodromes.rb +223 -0
- data/lib/aipp/regions/LF/d_p_r_airspaces.rb +56 -0
- data/lib/aipp/regions/LF/dangerous_activities.rb +49 -0
- data/lib/aipp/regions/LF/designated_points.rb +47 -0
- data/lib/aipp/regions/LF/fixtures/aerodromes.yml +608 -0
- data/lib/aipp/regions/LF/helipads.rb +122 -0
- data/lib/aipp/regions/LF/helpers/base.rb +218 -0
- data/lib/aipp/regions/LF/helpers/surface.rb +49 -0
- data/lib/aipp/regions/LF/helpers/usage_limitation.rb +20 -0
- data/lib/aipp/regions/LF/navigational_aids.rb +85 -0
- data/lib/aipp/regions/LF/obstacles.rb +153 -0
- data/lib/aipp/regions/LF/serviced_airspaces.rb +70 -0
- data/lib/aipp/regions/LF/services.rb +172 -0
- data/lib/aipp/t_hash.rb +4 -5
- data/lib/aipp/version.rb +1 -1
- data/lib/aipp.rb +11 -5
- data/lib/core_ext/enumerable.rb +9 -9
- data/lib/core_ext/hash.rb +21 -5
- data/lib/core_ext/nokogiri.rb +54 -0
- data/lib/core_ext/string.rb +38 -66
- data.tar.gz.sig +2 -0
- metadata +180 -188
- metadata.gz.sig +0 -0
- data/.gitignore +0 -8
- data/.ruby-version +0 -1
- data/.travis.yml +0 -8
- data/.yardopts +0 -3
- data/Guardfile +0 -7
- data/TODO.md +0 -6
- data/aipp.gemspec +0 -44
- data/gems.rb +0 -3
- data/lib/aipp/airac.rb +0 -55
- data/lib/aipp/regions/LF/AD-1.3.rb +0 -162
- data/lib/aipp/regions/LF/AD-1.6.rb +0 -31
- data/lib/aipp/regions/LF/AD-2.rb +0 -313
- data/lib/aipp/regions/LF/AD-3.1.rb +0 -185
- data/lib/aipp/regions/LF/ENR-2.1.rb +0 -92
- data/lib/aipp/regions/LF/ENR-4.1.rb +0 -97
- data/lib/aipp/regions/LF/ENR-4.3.rb +0 -28
- data/lib/aipp/regions/LF/ENR-5.1.rb +0 -75
- data/lib/aipp/regions/LF/ENR-5.5.rb +0 -53
- data/lib/aipp/regions/LF/fixtures/AD-1.3.yml +0 -511
- data/lib/aipp/regions/LF/fixtures/AD-2.yml +0 -185
- data/lib/aipp/regions/LF/fixtures/AD-3.1.yml +0 -10
- data/lib/aipp/regions/LF/helpers/AD_radio.rb +0 -90
- data/lib/aipp/regions/LF/helpers/URL.rb +0 -26
- data/lib/aipp/regions/LF/helpers/common.rb +0 -217
- data/lib/core_ext/object.rb +0 -43
- data/rakefile.rb +0 -12
- data/spec/fixtures/archive.zip +0 -0
- data/spec/fixtures/border.geojson +0 -201
- data/spec/fixtures/document.pdf +0 -0
- data/spec/fixtures/document.pdf.json +0 -1
- data/spec/fixtures/new.html +0 -6
- data/spec/fixtures/new.pdf +0 -0
- data/spec/fixtures/new.txt +0 -1
- data/spec/lib/aipp/airac_spec.rb +0 -98
- data/spec/lib/aipp/border_spec.rb +0 -135
- data/spec/lib/aipp/downloader_spec.rb +0 -81
- data/spec/lib/aipp/patcher_spec.rb +0 -46
- data/spec/lib/aipp/pdf_spec.rb +0 -124
- data/spec/lib/aipp/t_hash_spec.rb +0 -44
- data/spec/lib/aipp/version_spec.rb +0 -7
- data/spec/lib/core_ext/enumberable_spec.rb +0 -76
- data/spec/lib/core_ext/hash_spec.rb +0 -27
- data/spec/lib/core_ext/integer_spec.rb +0 -15
- data/spec/lib/core_ext/nil_class_spec.rb +0 -11
- data/spec/lib/core_ext/string_spec.rb +0 -112
- data/spec/sounds/failure.mp3 +0 -0
- data/spec/sounds/success.mp3 +0 -0
- 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
|
data/spec/sounds/failure.mp3
DELETED
Binary file
|
data/spec/sounds/success.mp3
DELETED
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
|