aixm 1.3.2 → 1.3.4
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 +10 -0
- data/README.md +3 -3
- data/lib/aixm/executables.rb +44 -36
- data/lib/aixm/version.rb +1 -1
- data.tar.gz.sig +0 -0
- metadata +3 -3
- metadata.gz.sig +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9fe9565888ad7ed4bcf509211380c7b7102551ebe9ae30a3aa18810e51eb6c30
|
4
|
+
data.tar.gz: 4b2d98978eeedb786c6df9ee15d1a58965da68661e8e8fe3e74706d5f2d403bc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0437a116319aaa8aef2bb8107b6d86481686a735734ba172ed451cc73924389fb4a160d518d87d817ef7a79f84c3388b9d39f3d925bab8329b93c84e3b92c1bb
|
7
|
+
data.tar.gz: c8fdeec76012ffe37a66096f6e57f620ea9a2c0b731ff569f8b325fec2a315cdab74080ddf53553880c5acfa7df17b24059047dd935802821c0d637955cc54ec
|
checksums.yaml.gz.sig
CHANGED
Binary file
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,16 @@
|
|
2
2
|
|
3
3
|
Nothing so far
|
4
4
|
|
5
|
+
## 1.3.4
|
6
|
+
|
7
|
+
#### Additions
|
8
|
+
* `ckmid` skips XML schema validation if `-s` argument is set.
|
9
|
+
|
10
|
+
## 1.3.3
|
11
|
+
|
12
|
+
#### Changes
|
13
|
+
* Extend `ckmid` and `mkmid` to accept multiple files and globbing.
|
14
|
+
|
5
15
|
## 1.3.2
|
6
16
|
|
7
17
|
#### Changes
|
data/README.md
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
[![Version](https://img.shields.io/gem/v/aixm.svg?style=flat)](https://rubygems.org/gems/aixm)
|
2
|
-
[![Tests](https://img.shields.io/github/workflow/status/svoop/aixm/
|
2
|
+
[![Tests](https://img.shields.io/github/actions/workflow/status/svoop/aixm/test.yml?style=flat&label=tests)](https://github.com/svoop/aixm/actions?workflow=Test)
|
3
3
|
[![Code Climate](https://img.shields.io/codeclimate/maintainability/svoop/aixm.svg?style=flat)](https://codeclimate.com/github/svoop/aixm/)
|
4
4
|
[![Donorbox](https://img.shields.io/badge/donate-on_donorbox-yellow.svg)](https://donorbox.org/bitcetera)
|
5
5
|
|
@@ -291,7 +291,7 @@ By `using AIXM::Refinements` you get a few handy [extensions to Ruby core classe
|
|
291
291
|
|
292
292
|
### mkmid
|
293
293
|
|
294
|
-
The `mkmid` executable reads
|
294
|
+
The `mkmid` executable reads OFMX files, adds [OFMX-compliant `mid` values](https://gitlab.com/openflightmaps/ofmx/wikis/Features#mid) into all `*Uid` elements and validates the result against the schema.
|
295
295
|
|
296
296
|
```
|
297
297
|
mkmid --help
|
@@ -299,7 +299,7 @@ mkmid --help
|
|
299
299
|
|
300
300
|
### ckmid
|
301
301
|
|
302
|
-
The `chmid` executable reads
|
302
|
+
The `chmid` executable reads OFMX files, validates them against the schema and checks all `mid` attributes for [OFMX-compliance](https://gitlab.com/openflightmaps/ofmx/wikis/Features#mid).
|
303
303
|
|
304
304
|
```
|
305
305
|
ckmid --help
|
data/lib/aixm/executables.rb
CHANGED
@@ -8,66 +8,74 @@ module AIXM
|
|
8
8
|
@options = options
|
9
9
|
OptionParser.new do |o|
|
10
10
|
o.banner = <<~END
|
11
|
-
Add mid attributes to
|
12
|
-
Usage: #{File.basename($0)}
|
11
|
+
Add mid attributes to OFMX files.
|
12
|
+
Usage: #{File.basename($0)} files
|
13
13
|
END
|
14
14
|
o.on('-i', '--[no-]in-place', 'overwrite file instead of dumping to STDOUT (default: false)') { @options[:in_place] = _1 }
|
15
15
|
o.on('-f', '--[no-]force', 'ignore XML schema validation errors (default: false)') { @options[:force] = _1 }
|
16
16
|
o.on('-A', '--about', 'show author/license information and exit') { AIXM::Executables.about }
|
17
17
|
o.on('-V', '--version', 'show version and exit') { AIXM::Executables.version }
|
18
18
|
end.parse!
|
19
|
-
@
|
19
|
+
@files = ARGV
|
20
20
|
end
|
21
21
|
|
22
22
|
def run
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
23
|
+
@files.each do |file|
|
24
|
+
fail "cannot read #{file}" unless file && File.readable?(file)
|
25
|
+
fail "#{file} is not OFMX" unless file.match?(/\.ofmx$/)
|
26
|
+
AIXM.ofmx!
|
27
|
+
document = File.open(file) { Nokogiri::XML(_1) }
|
28
|
+
AIXM::PayloadHash::Mid.new(document).insert_mid
|
29
|
+
errors = Nokogiri::XML::Schema(File.open(AIXM.schema(:xsd))).validate(document)
|
30
|
+
case
|
31
|
+
when errors.any? && !@options[:force]
|
32
|
+
fail (["#{file} is not valid..."] + errors).join("\n")
|
33
|
+
when @options[:in_place]
|
34
|
+
File.write(file, document.to_xml)
|
35
|
+
else
|
36
|
+
puts document.to_xml
|
37
|
+
end
|
38
|
+
rescue => error
|
39
|
+
puts "ERROR: #{error.message}"
|
40
|
+
exit 1
|
37
41
|
end
|
38
|
-
rescue => error
|
39
|
-
puts "ERROR: #{error.message}"
|
40
|
-
exit 1
|
41
42
|
end
|
42
43
|
end
|
43
44
|
|
44
45
|
class Ckmid
|
45
46
|
def initialize(**options)
|
47
|
+
@options = options
|
46
48
|
OptionParser.new do |o|
|
47
49
|
o.banner = <<~END
|
48
|
-
Check mid attributes of
|
49
|
-
Usage: #{File.basename($0)}
|
50
|
+
Check mid attributes of OFMX files.
|
51
|
+
Usage: #{File.basename($0)} files
|
50
52
|
END
|
53
|
+
o.on('-s', '--[no-]skip-validation', 'skip XML schema validation (default: false)') { @options[:skip_validation] = _1 }
|
51
54
|
o.on('-A', '--about', 'show author/license information and exit') { AIXM::Executables.about }
|
52
55
|
o.on('-V', '--version', 'show version and exit') { AIXM::Executables.version }
|
53
56
|
end.parse!
|
54
|
-
@
|
57
|
+
@files = ARGV
|
55
58
|
end
|
56
59
|
|
57
60
|
def run
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
61
|
+
exit(
|
62
|
+
@files.reduce(true) do |success, file|
|
63
|
+
fail "cannot read #{file}" unless file && File.readable?(file)
|
64
|
+
fail "#{file} is not OFMX" unless file.match?(/\.ofmx$/)
|
65
|
+
AIXM.ofmx!
|
66
|
+
document = File.open(file) { Nokogiri::XML(_1) }
|
67
|
+
errors = []
|
68
|
+
unless @options[:skip_validation]
|
69
|
+
errors += Nokogiri::XML::Schema(File.open(AIXM.schema(:xsd))).validate(document)
|
70
|
+
end
|
71
|
+
errors += AIXM::PayloadHash::Mid.new(document).check_mid
|
72
|
+
fail (["#{file} is not valid..."] + errors).join("\n") if errors.any?
|
73
|
+
success && true
|
74
|
+
rescue RuntimeError => error
|
75
|
+
puts "ERROR: #{error.message}"
|
76
|
+
false
|
77
|
+
end
|
78
|
+
)
|
71
79
|
end
|
72
80
|
end
|
73
81
|
|
data/lib/aixm/version.rb
CHANGED
data.tar.gz.sig
CHANGED
Binary file
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: aixm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Sven Schwyn
|
@@ -29,7 +29,7 @@ cert_chain:
|
|
29
29
|
kAyiRqgxF4dJviwtqI7mZIomWL63+kXLgjOjMe1SHxfIPo/0ji6+r1p4KYa7o41v
|
30
30
|
fwIwU1MKlFBdsjkd
|
31
31
|
-----END CERTIFICATE-----
|
32
|
-
date:
|
32
|
+
date: 2023-01-09 00:00:00.000000000 Z
|
33
33
|
dependencies:
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: nokogiri
|
@@ -312,7 +312,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
312
312
|
- !ruby/object:Gem::Version
|
313
313
|
version: '0'
|
314
314
|
requirements: []
|
315
|
-
rubygems_version: 3.3
|
315
|
+
rubygems_version: 3.4.3
|
316
316
|
signing_key:
|
317
317
|
specification_version: 4
|
318
318
|
summary: Builder for AIXM/OFMX aeronautical information
|
metadata.gz.sig
CHANGED
Binary file
|