aixm 0.3.7 → 1.0.0
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/CHANGELOG.md +72 -6
- data/README.md +191 -53
- data/exe/ckmid +11 -0
- data/exe/mkmid +11 -0
- data/lib/aixm/association.rb +367 -0
- data/lib/aixm/classes.rb +44 -0
- data/lib/aixm/component/fato.rb +44 -52
- data/lib/aixm/component/frequency.rb +13 -14
- data/lib/aixm/component/geometry/arc.rb +2 -2
- data/lib/aixm/component/geometry/border.rb +14 -5
- data/lib/aixm/component/geometry/circle.rb +8 -2
- data/lib/aixm/component/geometry/point.rb +10 -3
- data/lib/aixm/component/geometry/rhumb_line.rb +54 -0
- data/lib/aixm/component/geometry.rb +38 -38
- data/lib/aixm/component/helipad.rb +29 -37
- data/lib/aixm/component/layer.rb +28 -19
- data/lib/aixm/component/lighting.rb +11 -12
- data/lib/aixm/component/runway.rb +46 -53
- data/lib/aixm/{feature → component}/service.rb +36 -35
- data/lib/aixm/component/surface.rb +3 -3
- data/lib/aixm/component/timetable.rb +5 -3
- data/lib/aixm/component/{vertical_limits.rb → vertical_limit.rb} +12 -6
- data/lib/aixm/config.rb +6 -3
- data/lib/aixm/document.rb +31 -49
- data/lib/aixm/executables.rb +85 -0
- data/lib/aixm/f.rb +28 -0
- data/lib/aixm/feature/address.rb +20 -15
- data/lib/aixm/feature/airport.rb +113 -129
- data/lib/aixm/feature/airspace.rb +54 -23
- data/lib/aixm/feature/navigational_aid/designated_point.rb +12 -14
- data/lib/aixm/feature/navigational_aid/dme.rb +10 -11
- data/lib/aixm/feature/navigational_aid/marker.rb +6 -2
- data/lib/aixm/feature/navigational_aid/ndb.rb +6 -2
- data/lib/aixm/feature/navigational_aid/tacan.rb +6 -2
- data/lib/aixm/feature/navigational_aid/vor.rb +22 -14
- data/lib/aixm/feature/navigational_aid.rb +7 -9
- data/lib/aixm/feature/obstacle.rb +22 -20
- data/lib/aixm/feature/obstacle_group.rb +30 -30
- data/lib/aixm/feature/organisation.rb +20 -4
- data/lib/aixm/feature/unit.rb +35 -45
- data/lib/aixm/feature.rb +13 -3
- data/lib/aixm/memoize.rb +89 -0
- data/lib/aixm/object.rb +9 -0
- data/lib/aixm/payload_hash.rb +114 -0
- data/lib/aixm/refinements.rb +34 -50
- data/lib/aixm/shortcuts.rb +6 -43
- data/lib/aixm/version.rb +1 -1
- data/lib/aixm/xy.rb +9 -1
- data/lib/aixm.rb +18 -7
- data/schemas/ofmx/{0 → 0.1}/OFMX-CSV-Obstacle.json +0 -0
- data/schemas/ofmx/{0 → 0.1}/OFMX-CSV.json +0 -0
- data/schemas/ofmx/{0 → 0.1}/OFMX-DataTypes.xsd +52 -2
- data/schemas/ofmx/{0 → 0.1}/OFMX-Features.xsd +225 -14
- data/schemas/ofmx/{0 → 0.1}/OFMX-Snapshot.xsd +0 -5
- data.tar.gz.sig +0 -0
- metadata +116 -164
- metadata.gz.sig +0 -0
- data/.gitignore +0 -6
- data/.ruby-version +0 -1
- data/.travis.yml +0 -8
- data/.yardopts +0 -3
- data/Guardfile +0 -8
- data/aixm.gemspec +0 -35
- data/gems.rb +0 -3
- data/lib/aixm/component.rb +0 -6
- data/rakefile.rb +0 -22
- data/spec/factory.rb +0 -559
- data/spec/lib/aixm/a_spec.rb +0 -203
- data/spec/lib/aixm/component/fato_spec.rb +0 -260
- data/spec/lib/aixm/component/frequency_spec.rb +0 -75
- data/spec/lib/aixm/component/geometry/arc_spec.rb +0 -75
- data/spec/lib/aixm/component/geometry/border_spec.rb +0 -33
- data/spec/lib/aixm/component/geometry/circle_spec.rb +0 -70
- data/spec/lib/aixm/component/geometry/point_spec.rb +0 -39
- data/spec/lib/aixm/component/geometry_spec.rb +0 -321
- data/spec/lib/aixm/component/helipad_spec.rb +0 -187
- data/spec/lib/aixm/component/layer_spec.rb +0 -137
- data/spec/lib/aixm/component/lighting_spec.rb +0 -88
- data/spec/lib/aixm/component/runway_spec.rb +0 -472
- data/spec/lib/aixm/component/surface_spec.rb +0 -124
- data/spec/lib/aixm/component/timetable_spec.rb +0 -49
- data/spec/lib/aixm/component/vertical_limits_spec.rb +0 -97
- data/spec/lib/aixm/config_spec.rb +0 -41
- data/spec/lib/aixm/d_spec.rb +0 -150
- data/spec/lib/aixm/document_spec.rb +0 -1875
- data/spec/lib/aixm/errors_spec.rb +0 -14
- data/spec/lib/aixm/f_spec.rb +0 -85
- data/spec/lib/aixm/feature/address_spec.rb +0 -55
- data/spec/lib/aixm/feature/airport_spec.rb +0 -770
- data/spec/lib/aixm/feature/airspace_spec.rb +0 -390
- data/spec/lib/aixm/feature/navigational_aid/designated_point_spec.rb +0 -98
- data/spec/lib/aixm/feature/navigational_aid/dme_spec.rb +0 -92
- data/spec/lib/aixm/feature/navigational_aid/marker_spec.rb +0 -79
- data/spec/lib/aixm/feature/navigational_aid/ndb_spec.rb +0 -89
- data/spec/lib/aixm/feature/navigational_aid/tacan_spec.rb +0 -88
- data/spec/lib/aixm/feature/navigational_aid/vor_spec.rb +0 -245
- data/spec/lib/aixm/feature/navigational_aid_spec.rb +0 -52
- data/spec/lib/aixm/feature/obstacle_group_spec.rb +0 -326
- data/spec/lib/aixm/feature/obstacle_spec.rb +0 -279
- data/spec/lib/aixm/feature/organisation_spec.rb +0 -77
- data/spec/lib/aixm/feature/service_spec.rb +0 -59
- data/spec/lib/aixm/feature/unit_spec.rb +0 -230
- data/spec/lib/aixm/feature_spec.rb +0 -38
- data/spec/lib/aixm/p_spec.rb +0 -189
- data/spec/lib/aixm/refinements_spec.rb +0 -381
- data/spec/lib/aixm/version_spec.rb +0 -7
- data/spec/lib/aixm/w_spec.rb +0 -150
- data/spec/lib/aixm/xy_spec.rb +0 -180
- data/spec/lib/aixm/z_spec.rb +0 -94
- data/spec/macros/marking.rb +0 -12
- data/spec/macros/organisation.rb +0 -11
- data/spec/macros/remarks.rb +0 -12
- data/spec/macros/timetable.rb +0 -11
- data/spec/macros/xy.rb +0 -11
- data/spec/macros/z_qnh.rb +0 -11
- data/spec/sounds/failure.mp3 +0 -0
- data/spec/sounds/success.mp3 +0 -0
- data/spec/spec_helper.rb +0 -55
@@ -1,14 +0,0 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::GeometryError do
|
4
|
-
it "must be defined" do
|
5
|
-
AIXM::GeometryError.wont_be_nil
|
6
|
-
end
|
7
|
-
end
|
8
|
-
|
9
|
-
|
10
|
-
describe AIXM::LayerError do
|
11
|
-
it "must be defined" do
|
12
|
-
AIXM::LayerError.wont_be_nil
|
13
|
-
end
|
14
|
-
end
|
data/spec/lib/aixm/f_spec.rb
DELETED
@@ -1,85 +0,0 @@
|
|
1
|
-
require_relative '../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::F do
|
4
|
-
subject do
|
5
|
-
AIXM::Factory.f
|
6
|
-
end
|
7
|
-
|
8
|
-
describe :freq= do
|
9
|
-
it "fails on invalid values" do
|
10
|
-
[:foobar].wont_be_written_to subject, :freq
|
11
|
-
end
|
12
|
-
|
13
|
-
it "converts Numeric to Float" do
|
14
|
-
subject.tap { |s| s.freq = 5 }.freq.must_equal 5.0
|
15
|
-
end
|
16
|
-
end
|
17
|
-
|
18
|
-
describe :unit= do
|
19
|
-
it "fails on invalid values" do
|
20
|
-
[:foobar, 123].wont_be_written_to subject, :unit
|
21
|
-
end
|
22
|
-
|
23
|
-
it "symbolizes and downcases values" do
|
24
|
-
subject.tap { |s| s.unit = "MHz" }.unit.must_equal :mhz
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
28
|
-
describe :between? do
|
29
|
-
subject do
|
30
|
-
AIXM.f(100, :mhz)
|
31
|
-
end
|
32
|
-
|
33
|
-
it "detect frequencies within a frequency band" do
|
34
|
-
subject.between?(90, 110, :mhz).must_equal true
|
35
|
-
subject.between?(90, 100, :mhz).must_equal true
|
36
|
-
subject.between?(100.0, 100.1, :mhz).must_equal true
|
37
|
-
end
|
38
|
-
|
39
|
-
it "detect frequencies outside of a frequency band" do
|
40
|
-
subject.between?(90, 110, :khz).must_equal false
|
41
|
-
subject.between?(90, 95, :mhz).must_equal false
|
42
|
-
end
|
43
|
-
end
|
44
|
-
|
45
|
-
describe :== do
|
46
|
-
it "recognizes objects with identical frequency and unit as equal" do
|
47
|
-
a = AIXM.f(123.0, :mhz)
|
48
|
-
b = AIXM.f(123, 'MHZ')
|
49
|
-
a.must_equal b
|
50
|
-
end
|
51
|
-
|
52
|
-
it "recognizes objects with different frequency or unit as unequal" do
|
53
|
-
a = AIXM.f(123.35, :mhz)
|
54
|
-
b = AIXM.f(123.35, :khz)
|
55
|
-
a.wont_equal b
|
56
|
-
end
|
57
|
-
|
58
|
-
it "recognizes objects of different class as unequal" do
|
59
|
-
a = AIXM.f(123.35, :mhz)
|
60
|
-
b = :oggy
|
61
|
-
a.wont_equal b
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
describe :hash do
|
66
|
-
it "returns an integer" do
|
67
|
-
subject.hash.must_be_instance_of Integer
|
68
|
-
end
|
69
|
-
|
70
|
-
it "allows for the use of instances as hash keys" do
|
71
|
-
dupe = subject.dup
|
72
|
-
{ subject => true }[dupe].must_equal true
|
73
|
-
end
|
74
|
-
end
|
75
|
-
|
76
|
-
describe :zero? do
|
77
|
-
it "returns true for zero frequency" do
|
78
|
-
subject.tap { |s| s.freq = 0 }.must_be :zero?
|
79
|
-
end
|
80
|
-
|
81
|
-
it "returns false for non-zero frequency" do
|
82
|
-
subject.tap { |s| s.freq = 1 }.wont_be :zero?
|
83
|
-
end
|
84
|
-
end
|
85
|
-
end
|
@@ -1,55 +0,0 @@
|
|
1
|
-
require_relative '../../../spec_helper'
|
2
|
-
|
3
|
-
describe AIXM::Feature::Address do
|
4
|
-
subject do
|
5
|
-
AIXM::Factory.address
|
6
|
-
end
|
7
|
-
|
8
|
-
describe :type= do
|
9
|
-
it "fails on invalid values" do
|
10
|
-
-> { subject.type = :foobar }.must_raise ArgumentError
|
11
|
-
-> { subject.type = nil }.must_raise ArgumentError
|
12
|
-
end
|
13
|
-
|
14
|
-
it "looks up valid values" do
|
15
|
-
subject.tap { |s| s.type = :phone }.type.must_equal :phone
|
16
|
-
subject.tap { |s| s.type = :RADIO }.type.must_equal :radio_frequency
|
17
|
-
end
|
18
|
-
end
|
19
|
-
|
20
|
-
describe :remarks= do
|
21
|
-
macro :remarks
|
22
|
-
end
|
23
|
-
|
24
|
-
describe :xml= do
|
25
|
-
it "builds correct OFMX" do
|
26
|
-
AIXM.ofmx!
|
27
|
-
subject.to_xml(as: :Xxx, sequence: 1).must_equal <<~END
|
28
|
-
<!-- Address: RADIO -->
|
29
|
-
<Xxx source="LF|GEN|0.0 FACTORY|0|0">
|
30
|
-
<XxxUid>
|
31
|
-
<codeType>RADIO</codeType>
|
32
|
-
<noSeq>1</noSeq>
|
33
|
-
</XxxUid>
|
34
|
-
<txtAddress>123.35</txtAddress>
|
35
|
-
<txtRmk>A/A (callsign PUJAUT)</txtRmk>
|
36
|
-
</Xxx>
|
37
|
-
END
|
38
|
-
end
|
39
|
-
|
40
|
-
it "builds correct AIXM" do
|
41
|
-
AIXM.aixm!
|
42
|
-
subject = AIXM.address(type: :weather_url, address: 'https://www.foo.bar')
|
43
|
-
subject.to_xml(as: :Xxx, sequence: 1).must_equal <<~END
|
44
|
-
<!-- Address: URL-MET -->
|
45
|
-
<Xxx>
|
46
|
-
<XxxUid>
|
47
|
-
<codeType>URL</codeType>
|
48
|
-
<noSeq>1</noSeq>
|
49
|
-
</XxxUid>
|
50
|
-
<txtAddress>https://www.foo.bar</txtAddress>
|
51
|
-
</Xxx>
|
52
|
-
END
|
53
|
-
end
|
54
|
-
end
|
55
|
-
end
|