aipp 2.1.0 → 2.1.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d141c73e057eda545578568c2817d648c998e56154f1d68ecd40c59589a04738
4
- data.tar.gz: 70986dde2f1a7120f49061a65ee1b07c980469ff5f9ea6da4527f0160f613ed8
3
+ metadata.gz: 5a3f910ee20e31b9a2d0ee0644714c43898917cd9fda36bb5f721c17fcb758be
4
+ data.tar.gz: a996dd39757199cdadd5ceab2c7014b871785c857dc2054c4d9e5c264b16b5a9
5
5
  SHA512:
6
- metadata.gz: 1e97fc5731a4356836ce60703cddd076d33d99d94cfaa667a8f1cf203f28003710d3c27263efd8e638e902f6ee9a076c46fb36881575425bf994202842b2a3d3
7
- data.tar.gz: '08648422f96c2dd925873ec4153b3420754323704df5ec037042bed1f5a4611929d01ae2ee6ab02b718e6e28f9ea57ef76481eaf7ab4abe0a6dd0d89a547fa90'
6
+ metadata.gz: d8cea4595823cf29656e25e252e205007de55a74240c1bca96f47ccd4e69194a112cb4665da0c784c24289f2d117d9b04e1a43625f86820763553a04bde03ab0
7
+ data.tar.gz: 7b3ae6c428f88231456a94a882c51ec8c5436bd2ff1398e61a0465b48939ccc3a443ff20ab98039a9ee9fc1ac2a5b70cbbc54ebdf29f9712a84a35460250b312
checksums.yaml.gz.sig CHANGED
@@ -1,2 +1,3 @@
1
- 1�ǵm��Gy
2
- Z��ѳ�y@�'�i��:��x��� 琇�� �����%�\
1
+ �(��F���S�> *���
2
+ ͻ��\��� k��1�<��>%���#cu�Q�L��Y+<��`%e��#�{k 2�'� ��M�����&a����*�ɝ7W��T��L��fX�O ki<i�����{�� i�+�ޔ
3
+ r�}��Q==J����ÑeF��0*L2��!���?���r�L�������
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  Nothing so far
4
4
 
5
+ ## 2.1.1
6
+
7
+ #### Additions
8
+ * Improve help when no scope is given
9
+ * Add `-0` to write empty OFMX in case of no upstream data
10
+
5
11
  ## 2.1.0
6
12
 
7
13
  #### Breaking Changes
@@ -5,30 +5,35 @@ module AIPP
5
5
  include AIPP::Debugger
6
6
 
7
7
  def initialize(exe_file)
8
+ @exe_file = exe_file
9
+ help if ARGV.none? || ARGV.first == '--help'
8
10
  require_scope
9
11
  AIPP.options.replace(
10
12
  scope: scope,
11
- schema: exe_file.split('2').last.to_sym,
13
+ schema: schema,
12
14
  storage: Pathname(Dir.home).join('.aipp'),
15
+ check_links: false,
13
16
  clean: false,
14
17
  force: false,
15
18
  mid: false,
19
+ write_empty: false,
16
20
  quiet: false,
17
21
  verbose: false,
18
22
  debug_on_warning: false,
19
23
  debug_on_error: false
20
24
  )
21
- options
25
+ options if respond_to? :options
22
26
  OptionParser.new do |o|
23
27
  o.on('-r', '--region STRING', String, 'region (e.g. "LF")') { AIPP.options.region = _1.upcase }
24
28
  o.on('-s', '--section STRING', String, 'process this section only') { AIPP.options.section = _1.classify }
25
29
  o.on('-d', '--storage DIR', String, 'storage directory (default: "~/.aipp")') { AIPP.options.storage = Pathname(_1) }
26
30
  o.on('-o', '--output FILE', String, 'output file') { AIPP.options.output_file = _1 }
27
31
  option_parser(o)
28
- if AIPP.options.schema == :ofmx
32
+ if schema == :ofmx
29
33
  o.on('-m', '--[no-]mid', 'insert mid attributes into all Uid elements (default: false)') { AIPP.options.mid = _1 }
34
+ o.on('-0', '--[no-]empty', 'write empty OFMX files in case of no upstream data (default: false)') { AIPP.options.write_empty = _1 }
30
35
  end
31
- o.on('-h', '--[no-]check-links', 'check all links with HEAD requests') { AIPP.options.check_links = _1 }
36
+ o.on('-h', '--[no-]check-links', 'check all links with HEAD requests (default: false)') { AIPP.options.check_links = _1 }
32
37
  o.on('-c', '--[no-]clean', 'clean cache and download from sources anew (default: false)') { AIPP.options.clean = _1 }
33
38
  o.on('-f', '--[no-]force', 'continue on non-fatal errors (default: false)') { AIPP.options.force = _1 }
34
39
  o.on('-q', '--[no-]quiet', 'suppress all informational output (default: false)') { AIPP.options.quiet = _1 }
@@ -55,6 +60,14 @@ module AIPP
55
60
 
56
61
  private
57
62
 
63
+ def help
64
+ puts <<~END
65
+ Download online aeronautical data and convert it to #{schema.upcase}.
66
+ Usage: #{File.basename($0)} [aip|notam|shoot] --help
67
+ END
68
+ exit
69
+ end
70
+
58
71
  def about
59
72
  puts 'Written by Sven Schwyn (bitcetera.com) and distributed under MIT license.'
60
73
  exit
@@ -90,6 +103,10 @@ module AIPP
90
103
  Pathname(__FILE__).dirname
91
104
  end
92
105
 
106
+ def schema
107
+ @schema ||= @exe_file.split('2').last.to_sym
108
+ end
109
+
93
110
  def scope
94
111
  @scope ||= ARGV.first.match?(/^-/) ? 'AIP' : ARGV.shift.upcase
95
112
  end
data/lib/aipp/runner.rb CHANGED
@@ -128,9 +128,13 @@ module AIPP
128
128
 
129
129
  # Write the AIXM document.
130
130
  def write_aixm(file)
131
- info("writing #{file}")
132
- AIXM.config.mid = AIPP.options.mid
133
- File.write(file, aixm.to_xml)
131
+ if aixm.features.any? || AIPP.options.write_empty
132
+ info("writing #{file}")
133
+ AIXM.config.mid = AIPP.options.mid
134
+ File.write(file, aixm.to_xml)
135
+ else
136
+ info("no features to write")
137
+ end
134
138
  end
135
139
 
136
140
  # Write build information.
@@ -14,7 +14,7 @@ module AIPP
14
14
  def option_parser(o)
15
15
  o.banner = <<~END
16
16
  Download online AIP and convert it to #{AIPP.options.schema.upcase}.
17
- Usage: #{File.basename($0)} [options]
17
+ Usage: #{File.basename($0)} [aip] [options]
18
18
  END
19
19
  o.on('-a', '--airac (DATE|INTEGER)', String, %Q[AIRAC date or delta e.g. "+1" (default: "#{AIPP.options.airac.date.xmlschema}")]) { AIPP.options.airac = airac_for(_1) }
20
20
  if AIPP.options.schema == :ofmx
@@ -20,10 +20,8 @@ module AIPP
20
20
  if aixm.features.any?
21
21
  validate_aixm
22
22
  write_build
23
- write_aixm(AIPP.options.output_file || output_file)
24
- else
25
- warn("no features to write")
26
23
  end
24
+ write_aixm(AIPP.options.output_file || output_file)
27
25
  write_config
28
26
  end
29
27
 
@@ -19,10 +19,8 @@ module AIPP
19
19
  parse_sections
20
20
  if aixm.features.any?
21
21
  validate_aixm
22
- write_aixm(AIPP.options.output_file || output_file)
23
- else
24
- warn("no features to write")
25
22
  end
23
+ write_aixm(AIPP.options.output_file || output_file)
26
24
  write_config
27
25
  end
28
26
 
@@ -19,10 +19,8 @@ module AIPP
19
19
  parse_sections
20
20
  if aixm.features.any?
21
21
  validate_aixm
22
- write_aixm(AIPP.options.output_file || output_file)
23
- else
24
- warn("no features to write")
25
22
  end
23
+ write_aixm(AIPP.options.output_file || output_file)
26
24
  write_config
27
25
  end
28
26
 
data/lib/aipp/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module AIPP
2
- VERSION = "2.1.0".freeze
2
+ VERSION = "2.1.1".freeze
3
3
  end
data.tar.gz.sig CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aipp
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
@@ -60,7 +60,7 @@ dependencies:
60
60
  version: '1'
61
61
  - - ">="
62
62
  - !ruby/object:Gem::Version
63
- version: 1.4.0
63
+ version: 1.4.1
64
64
  type: :runtime
65
65
  prerelease: false
66
66
  version_requirements: !ruby/object:Gem::Requirement
@@ -70,7 +70,7 @@ dependencies:
70
70
  version: '1'
71
71
  - - ">="
72
72
  - !ruby/object:Gem::Version
73
- version: 1.4.0
73
+ version: 1.4.1
74
74
  - !ruby/object:Gem::Dependency
75
75
  name: notam
76
76
  requirement: !ruby/object:Gem::Requirement
metadata.gz.sig CHANGED
Binary file