aipp 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- checksums.yaml.gz.sig +0 -0
- data.tar.gz.sig +0 -0
- data/CHANGELOG.md +8 -0
- data/README.md +40 -14
- data/exe/aip2aixm +1 -1
- data/exe/aip2ofmx +1 -1
- data/lib/aipp.rb +2 -0
- data/lib/aipp/aip.rb +17 -12
- data/lib/aipp/downloader.rb +1 -1
- data/lib/aipp/executable.rb +15 -12
- data/lib/aipp/parser.rb +58 -43
- data/lib/aipp/pdf.rb +1 -1
- data/lib/aipp/regions/LF/AD-1.3.rb +7 -6
- data/lib/aipp/regions/LF/AD-1.6.rb +7 -5
- data/lib/aipp/regions/LF/AD-2.rb +16 -9
- data/lib/aipp/regions/LF/AD-3.1.rb +6 -6
- data/lib/aipp/regions/LF/ENR-2.1.rb +81 -6
- data/lib/aipp/regions/LF/ENR-4.1.rb +3 -1
- data/lib/aipp/regions/LF/ENR-4.3.rb +2 -3
- data/lib/aipp/regions/LF/ENR-5.1.rb +15 -2
- data/lib/aipp/regions/LF/ENR-5.4.rb +90 -0
- data/lib/aipp/regions/LF/ENR-5.5.rb +12 -10
- data/lib/aipp/regions/LF/fixtures/AD-1.3.yml +2 -2
- data/lib/aipp/regions/LF/helpers/base.rb +17 -9
- data/lib/aipp/regions/LF/helpers/radio_AD.rb +21 -13
- data/lib/aipp/t_hash.rb +3 -3
- data/lib/aipp/version.rb +1 -1
- data/lib/core_ext/enumerable.rb +7 -7
- data/lib/core_ext/string.rb +9 -4
- metadata +156 -168
- metadata.gz.sig +1 -0
- data/.github/workflows/test.yml +0 -26
- data/.gitignore +0 -8
- data/.ruby-version +0 -1
- data/.yardopts +0 -3
- data/Guardfile +0 -7
- data/TODO.md +0 -6
- data/aipp.gemspec +0 -45
- data/gems.rb +0 -3
- data/rakefile.rb +0 -12
- 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/fixtures/source.zip +0 -0
- 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 -29
@@ -1,27 +0,0 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe Hash do
|
4
|
-
|
5
|
-
describe :metch do
|
6
|
-
subject do
|
7
|
-
{ /aa/ => :aa, /a/ => :a, 'b' => :b }
|
8
|
-
end
|
9
|
-
|
10
|
-
it "must return value of matching regexp key" do
|
11
|
-
_(subject.metch('abc')).must_equal :a
|
12
|
-
end
|
13
|
-
|
14
|
-
it "must return value of equal non-regexp key" do
|
15
|
-
_(subject.metch('b')).must_equal :b
|
16
|
-
end
|
17
|
-
|
18
|
-
it "fails with KeyError if nothing matches" do
|
19
|
-
_{ subject.metch('bcd') }.must_raise KeyError
|
20
|
-
end
|
21
|
-
|
22
|
-
it "returns fallback value if nothing matches" do
|
23
|
-
_(subject.metch('x', :foobar)).must_equal :foobar
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
end
|
@@ -1,15 +0,0 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe Integer do
|
4
|
-
|
5
|
-
describe :up_or_downto do
|
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
|
8
|
-
end
|
9
|
-
|
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
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
end
|
@@ -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,29 +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/focus'
|
16
|
-
require 'minitest/matchers'
|
17
|
-
require 'spy/integration'
|
18
|
-
|
19
|
-
module AIPP
|
20
|
-
def self.root
|
21
|
-
Pathname(__dir__).join('..')
|
22
|
-
end
|
23
|
-
end
|
24
|
-
|
25
|
-
class MiniTest::Spec
|
26
|
-
class << self
|
27
|
-
alias_method :context, :describe
|
28
|
-
end
|
29
|
-
end
|