ogn_client-ruby 0.2.3 → 0.2.4

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
- SHA1:
3
- metadata.gz: 457a6b32a8d8a124283e05e320f14b6d4d2a1310
4
- data.tar.gz: cca65cf62df04c2ae068ba0adeee9fe1805769d8
2
+ SHA256:
3
+ metadata.gz: c71a796b6402c225b74aaa7a65066b06667385ed6bb40144dd75ae15acd3b804
4
+ data.tar.gz: 719035ac056ac89494ae5d4ff4a5fe9d01ddf9695d97365913ae5a81b123d4a5
5
5
  SHA512:
6
- metadata.gz: 4b1dee00b45b66bdfe7a02070e6c8acb518a5df6f7d9c248aee836dab60ce01907bd84590e3b346c9c9defb9a39b6b8c19eda8cf814a1ee8278d6b64e11f4160
7
- data.tar.gz: d6f3e85e414a4d3533376295676019e0f9c78015bec1346743711f9c3859782a80f7578d2d18b42bfe2ae9c3b7f37e4c6e03a9e257fd01ebf44104f4503e6dc3
6
+ metadata.gz: 8a70ce58df1ec9376658643dd01a3fea2ab81868b9868019c43327cdcd8a3c80b49fd0817fda6fa8fe0f695abf5975431b1681e0e4f3225f495cf45cb1013526
7
+ data.tar.gz: 0de3c502dec0a989d2ec5516be66862eaa96e09fc23003c56f30811b8a5bff80ee85f77da6616c16098114b0af4912d0c7418934537d9da252491c51ff9703be
Binary file
@@ -0,0 +1 @@
1
+ ���O?ہ��u��c�4��v�w��sK��>�E|�0 l:����~�Y1��h>���������'���g*����G��/�J�t���̘n.��̵��a��m��*y���9:,��W�����-0���3��j3���`�i��l�hF?Hc�+�4X��̲Eih 97�JsD\���(>�U�,�3�;��~+��̈́qu� �)8p�D:fc�h���JY�}��!f�WtٱF��}a�s���o:Y5��|�B
@@ -1,3 +1,8 @@
1
+ ## 0.2.4
2
+
3
+ * add ogn2geojson
4
+ * sign gem and add checksums
5
+
1
6
  ## 0.2.3
2
7
 
3
8
  * add support for explicit message date
data/README.md CHANGED
@@ -1,33 +1,48 @@
1
1
  [![Version](https://img.shields.io/gem/v/ogn_client-ruby.svg?style=flat)](https://rubygems.org/gems/ogn_client-ruby)
2
- [![Continuous Integration](https://img.shields.io/travis/svoop/ogn_client-ruby/master.svg?style=flat)](https://travis-ci.org/svoop/ogn_client-ruby)
3
- [![Code Climate](https://img.shields.io/codeclimate/github/svoop/ogn_client-ruby.svg?style=flat)](https://codeclimate.com/github/svoop/ogn_client-ruby)
4
- [![Gitter](https://img.shields.io/gitter/room/svoop/ogn_client-ruby.svg?style=flat)](https://gitter.im/svoop/ogn_client-ruby)
5
- [![Donorbox](https://img.shields.io/badge/donate-on_donorbox-yellow.svg)](https://donorbox.org/bitcetera-ogn_client-ruby)
2
+ [![Tests](https://img.shields.io/github/workflow/status/svoop/ogn_client-ruby/Test.svg?style=flat&label=tests)](https://github.com/svoop/ogn_client-ruby/actions?workflow=Test)
3
+ [![Code Climate](https://img.shields.io/codeclimate/maintainability/svoop/ogn_client-ruby.svg?style=flat)](https://codeclimate.com/github/svoop/ogn_client-ruby)
4
+ [![Donorbox](https://img.shields.io/badge/donate-on_donorbox-yellow.svg)](https://donorbox.org/bitcetera)
6
5
 
7
6
  # ogn_client-ruby
8
7
 
9
8
  [OGN](http://glidernet.org) broadcasts aircraft positions as [APRS](http://www.aprs.org)/[APRS-IS](http://www.aprs-is.net) messages. This gem hooks into this stream of data and provides the necessary classes to parse the raw message strings into meaningful objects.
10
9
 
11
- * Author: [Sven Schwyn](http://bitcetera.com)
12
10
  * Homepage: https://github.com/svoop/ogn_client-ruby
11
+ * Author: [Sven Schwyn](http://bitcetera.com)
13
12
 
14
13
  :loudspeaker: A word from the shameless commerce division: Looking for a freelance Ruby developer? Surf to http://bitcetera.com and contact Sven. Or [show your support with a donation](https://donorbox.org/bitcetera-ogn_client-ruby). Yes, we do sponsored features, too.
15
14
 
16
15
  ## Installation
17
16
 
18
- Add this line to your application's Gemfile:
17
+ ### Security
18
+
19
+ This gem is [cryptographically signed](https://guides.rubygems.org/security/#using-gems) in order to assure it hasn't been tampered with. Unless already done, please add the author's public key as a trusted certificate now:
20
+
21
+ ```
22
+ gem cert --add <(curl -Ls https://raw.github.com/svoop/ogn_client-ruby/master/certs/svoop.pem)
23
+ ```
24
+
25
+ ### Bundler
26
+
27
+ Add the following to the <tt>Gemfile</tt> or <tt>gems.rb</tt> of your [Bundler](https://bundler.io) powered Ruby project:
19
28
 
20
29
  ```ruby
21
30
  gem 'ogn_client-ruby', require: 'ogn_client'
22
31
  ```
23
32
 
24
- And then execute:
33
+ And then install the bundle:
25
34
 
26
- $ bundle
35
+ ```
36
+ bundle install --trust-policy MediumSecurity
37
+ ```
27
38
 
28
- Or install it yourself with:
39
+ ### Standalone
29
40
 
30
- $ gem install ogn_client-ruby
41
+ If you're only going to use [the executables](#executables):
42
+
43
+ ```
44
+ gem install ogn_client-ruby --trust-policy MediumSecurity
45
+ ```
31
46
 
32
47
  ## Usage
33
48
 
@@ -195,11 +210,12 @@ A simple daemon to log raw APRS messages to daily files.
195
210
 
196
211
  ognlogd --help
197
212
 
198
- ### ogn2kml
213
+ ### ogn2kml and ogn2geojson
199
214
 
200
- Convert raw APRS messages (e.g. from `ognlogd`) to KML.
215
+ Convert raw APRS messages (e.g. from `ognlogd`) to KML or GeoJSON.
201
216
 
202
217
  ogn2kml --help
218
+ ogn2geojson --help
203
219
 
204
220
  ## Community Support
205
221
 
@@ -211,25 +227,20 @@ Convert raw APRS messages (e.g. from `ognlogd`) to KML.
211
227
 
212
228
  ## Development
213
229
 
214
- Check out the repository, install the dependencies and run the test suite:
215
-
216
- $ git clone git@github.com:svoop/ogn_client-ruby.git
217
- $ cd ogn_client-ruby
218
- $ gem install bundler
219
- $ bin/setup
220
- $ rake
221
-
222
- If you are on macOS, *guard*, *guard-minitest* and *minitest-osx* are also installed and therefore you get the test results as notifications by running a guard watchdog with:
230
+ To install the development dependencies and then run the test suite:
223
231
 
224
- $ guard
232
+ bundle install
233
+ bundle exec rake # run tests once
234
+ bundle exec guard # run tests whenever files are modified
225
235
 
226
- To play around with the gem:
236
+ Please submit issues on:
227
237
 
228
- $ bin/console
238
+ https://github.com/svoop/ogn_client-ruby/issues
229
239
 
230
- And to install this gem onto your local machine:
240
+ To contribute code, fork the project on Github, add your code and submit a
241
+ pull request:
231
242
 
232
- $ bundle exec rake install
243
+ https://help.github.com/articles/fork-a-repo
233
244
 
234
245
  ## Feature Brainstorming
235
246
 
@@ -0,0 +1,89 @@
1
+ #!/usr/bin/env ruby
2
+
3
+ require 'bundler/inline'
4
+ require 'optparse'
5
+ require 'json'
6
+
7
+ gemfile do
8
+ source 'https://rubygems.org'
9
+ ruby '>= 2.4'
10
+ gem 'ogn_client-ruby', '~> 0.2', require: 'ogn_client'
11
+ end
12
+
13
+ class Converter
14
+ RED = 140.freeze
15
+ GREEN = 112.freeze
16
+
17
+ def initialize
18
+ OptionParser.new do |o|
19
+ o.banner = <<~END
20
+ Convert raw OGN APRS to GeoJSON.
21
+ Usage: ogn2geojson [options] infile
22
+ END
23
+ o.on('-a', '--about', 'author and license information') { puts 'Written by Sven Schwyn (bitcetera.com) and distributed under MIT license.'; exit }
24
+ o.on('-c', '--callsign STRING', String, 'aircraft callsign (e.g. FLRAABBCC)') { |v| @callsign = v }
25
+ o.on('-d', '--date YYYY-MM-DD', String, 'date the APRS messages were recorded (default: today)') { |v| @date = v }
26
+ o.on('-o', '--outfile FILE', String, 'generated GeoJSON file (default: INFILE.geojson)') { |v| @outfile = v.sub(/\.geojson$/, '') + '.geojson' }
27
+ end.parse!
28
+ @infile = ARGV.pop
29
+ fail 'infile not found' unless @infile && File.exists?(@infile)
30
+ @outfile ||= @infile.sub(/\.\w+$/, '') + '.geojson'
31
+ end
32
+
33
+ def feature(from_point, to_point, properties={})
34
+ {
35
+ type: 'Feature',
36
+ geometry: {
37
+ type: 'LineString',
38
+ coordinates: [from_point, to_point]
39
+ },
40
+ properties: {
41
+ 'stroke-width': 2,
42
+ 'stroke-opacity': 1
43
+ }.merge(properties)
44
+ }
45
+ end
46
+
47
+ def stroke_for(climb_rate)
48
+ case
49
+ when climb_rate == 0
50
+ "rgb(0, 0, 0)"
51
+ when climb_rate < 0
52
+ color = RED + ([climb_rate.abs, 5].min * ((250 - RED) / 5)).round
53
+ "rgb(#{color}, 0, 0)"
54
+ when climb_rate > 0
55
+ color = GREEN + ([climb_rate, 5].min * ((250 - GREEN) / 5)).round
56
+ "rgb(0, #{color}, 0)"
57
+ end
58
+ end
59
+
60
+ def convert!
61
+ lines = File.readlines(@infile)
62
+ features = lines.each.with_object([]) do |line, features|
63
+ if (sender = OGNClient::Message.parse(line, date: @date)).is_a? OGNClient::SenderBeacon
64
+ if !@callsign || sender.callsign == @callsign
65
+ to_point = [sender.longitude, sender.latitude, sender.altitude]
66
+ if @from_point
67
+ features << feature(@from_point, to_point,
68
+ time: sender.time.getlocal.strftime('%H:%M:%S'),
69
+ heading: sender.heading,
70
+ 'ground-speed': sender.ground_speed,
71
+ 'climb-rate': sender.climb_rate,
72
+ 'turn-rate': sender.turn_rate,
73
+ stroke: stroke_for(sender.climb_rate)
74
+ )
75
+ end
76
+ @from_point = to_point
77
+ end
78
+ end
79
+ end
80
+ File.write(@outfile, JSON.pretty_generate(type: "FeatureCollection", features: features))
81
+ end
82
+ end
83
+
84
+ begin
85
+ Converter.new.convert!
86
+ rescue => exception
87
+ puts "#{File.basename($0)}: #{exception.message}"
88
+ exit 1
89
+ end
@@ -6,8 +6,7 @@ require 'optparse'
6
6
  gemfile do
7
7
  source 'https://rubygems.org'
8
8
  ruby '>= 2.4'
9
- gem 'progressbar', '~> 1.8'
10
- gem 'libxml-ruby', '~> 3.0', require: 'xml'
9
+ gem 'builder', '~> 3'
11
10
  gem 'ogn_client-ruby', '~> 0.2', require: 'ogn_client'
12
11
  end
13
12
 
@@ -28,104 +27,100 @@ class Converter
28
27
  @outfile ||= @infile.sub(/\.\w+$/, '') + '.kml'
29
28
  end
30
29
 
31
- def style_nodes
32
- fragment = <<~END
33
- <Fragment>
34
- <Style id="track_normal">
35
- <IconStyle>
36
- <Icon>
37
- <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
38
- </Icon>
39
- </IconStyle>
40
- <LineStyle>
41
- <color>99ffac59</color>
42
- <width>6</width>
43
- </LineStyle>
44
- </Style>
45
- <Style id="track_highlight">
46
- <IconStyle>
47
- <scale>1.2</scale>
48
- <Icon>
49
- <href>http://earth.google.com/images/kml-icons/track-directional/track-0.png</href>
50
- </Icon>
51
- </IconStyle>
52
- <LineStyle>
53
- <color>99ffac59</color>
54
- <width>8</width>
55
- </LineStyle>
56
- </Style>
57
- <StyleMap id="track">
58
- <Pair>
59
- <key>normal</key>
60
- <styleUrl>#track_normal</styleUrl>
61
- </Pair>
62
- <Pair>
63
- <key>highlight</key>
64
- <styleUrl>#track_highlight</styleUrl>
65
- </Pair>
66
- </StyleMap>
67
- </Fragment>
68
- END
69
- XML::Parser.string(fragment).parse.root.each_child { |c| yield c }
70
- end
71
-
72
30
  def convert!
73
31
  lines = File.readlines(@infile)
74
- progressbar = ProgressBar.create(format: '%e |%b>%i| %p%% %t', total: lines.count)
75
- xml = XML::Document.new
76
- root = xml.root = XML::Node.new(:kml)
77
- root['xmlns'] = 'http://www.opengis.net/kml/2.2'
78
- root['xmlns:gx'] = 'http://www.google.com/kml/ext/2.2'
79
- root << (document = XML::Node.new(:Document))
80
- document << XML::Node.new(:name, 'OGN')
81
- style_nodes { |n| document << xml.import(n) }
82
- document << (folder = XML::Node.new(:Folder))
83
- folder << XML::Node.new(:name, 'Tracks')
84
- folder << (placemark = XML::Node.new(:Placemark))
85
- placemark << XML::Node.new(:name, @callsign || 'all')
86
- placemark << XML::Node.new(:styleUrl, '#track')
87
- placemark << (track = XML::Node.new(:'gx:Track'))
88
- track << XML::Node.new(:altitudeMode, 'absolute')
89
- time = XML::Node.new(:'gx:SimpleArrayData')
90
- time['name'] = 'Time'
91
- ground_speed = XML::Node.new(:'gx:SimpleArrayData')
92
- ground_speed['name'] = 'Ground Speed'
93
- climb_rate = XML::Node.new(:'gx:SimpleArrayData')
94
- climb_rate['name'] = 'Climb Rate'
95
- turn_rate = XML::Node.new(:'gx:SimpleArrayData')
96
- turn_rate['name'] = 'Turn Rate'
97
- array_data = { when: [], coord: [], angles: [] }
98
- lines.each do |line|
99
- if (sender = OGNClient::Message.parse(line, date: @date)).is_a? OGNClient::SenderBeacon
100
- if !@callsign || sender.callsign == @callsign
101
- array_data[:when] << XML::Node.new(:when, sender.time.xmlschema)
102
- array_data[:coord] << XML::Node.new(:'gx:coord', "#{sender.longitude} #{sender.latitude} #{sender.altitude}")
103
- array_data[:angles] << XML::Node.new(:'gx:angles', "#{sender.heading} 0 0")
104
- time << XML::Node.new(:'gx:value', sender.time.getlocal.strftime('%H:%M:%S'))
105
- ground_speed << XML::Node.new(:'gx:value', sender.ground_speed.to_i.to_s)
106
- climb_rate << XML::Node.new(:'gx:value', sender.climb_rate.to_i.to_s)
107
- turn_rate << XML::Node.new(:'gx:value', sender.turn_rate.to_i.to_s)
32
+ points = lines.map do |line|
33
+ message = OGNClient::Message.parse(line, date: @date)
34
+ if message.is_a?(OGNClient::SenderBeacon) && (!@callsign || @callsign == message.callsign)
35
+ {
36
+ when: message.time.xmlschema,
37
+ coord: "#{message.longitude} #{message.latitude} #{message.altitude}",
38
+ angles: "#{message.heading} 0 0",
39
+ time: message.time.getlocal.strftime('%H:%M:%S'),
40
+ ground_speed: message.ground_speed.to_i.to_s,
41
+ climb_rate: message.climb_rate.to_i.to_s,
42
+ turn_rate: message.turn_rate.to_i.to_s
43
+ }
44
+ end
45
+ end.compact
46
+ xml = Builder::XmlMarkup.new indent: 2
47
+ xml.instruct!
48
+ xml.kml(
49
+ xmlns: 'http://www.opengis.net/kml/2.2',
50
+ 'xmlns:gx': 'http://www.google.com/kml/ext/2.2'
51
+ ) do
52
+ xml.Document do
53
+ xml.name 'OGN'
54
+ # Styles
55
+ xml.Style(id: 'track_normal') do
56
+ xml.IconStyle do
57
+ xml.Icon do
58
+ xml.href 'http://earth.google.com/images/kml-icons/track-directional/track-0.png'
59
+ end
60
+ end
61
+ xml.LineStyle do
62
+ xml.color '99ffac59'
63
+ xml.width '6'
64
+ end
65
+ end
66
+ xml.Style(id: 'track_highlight') do
67
+ xml.IconStyle do
68
+ xml.scale '1.2'
69
+ xml.Icon do
70
+ xml.href 'http://earth.google.com/images/kml-icons/track-directional/track-0.png'
71
+ end
72
+ end
73
+ xml.LineStyle do
74
+ xml.color '99ffac59'
75
+ xml.width '8'
76
+ end
77
+ end
78
+ xml.StyleMap(id: 'track') do
79
+ xml.Pair do
80
+ xml.key 'normal'
81
+ xml.styleUrl '#track_normal'
82
+ end
83
+ xml.Pair do
84
+ xml.key 'highlight'
85
+ xml.styleUrl '#track_highlight'
86
+ end
87
+ end
88
+ # Tracks
89
+ xml.Folder do
90
+ xml.name 'Tracks'
91
+ xml.Placemark do
92
+ xml.name @callsign || 'all'
93
+ xml.styleUrl '#track'
94
+ xml.tag!('gx:Track') do
95
+ xml.altitudeMode 'absolute'
96
+ points.each { |p| xml.when p[:when] }
97
+ points.each { |p| xml.tag!('gx:coord', p[:coord]) }
98
+ points.each { |p| xml.tag!('gx:angles', p[:angles]) }
99
+ xml.ExtendedData do
100
+ xml.SchemaData(schemaUrl: '#schema') do
101
+ xml.tag!('gx:SimpleArrayData', name: 'Time') do
102
+ points.each { |p| xml.tag!('gx:value', p[:time]) }
103
+ end
104
+ xml.tag!('gx:SimpleArrayData', name: 'Ground Speed') do
105
+ points.each { |p| xml.tag!('gx:value', p[:ground_speed]) }
106
+ end
107
+ xml.tag!('gx:SimpleArrayData', name: 'Turn Rate') do
108
+ points.each { |p| xml.tag!('gx:value', p[:turn_rate]) }
109
+ end
110
+ end
111
+ end
112
+ end
113
+ end
108
114
  end
109
115
  end
110
- progressbar.increment
111
- end
112
- array_data.keys.each do |key|
113
- array_data[key].each { |d| track << d }
114
116
  end
115
- track << (extended_data = XML::Node.new(:ExtendedData))
116
- extended_data << (schema_data = XML::Node.new(:SchemaData))
117
- schema_data['schemaUrl'] = '#schema'
118
- schema_data << time
119
- schema_data << ground_speed
120
- schema_data << climb_rate
121
- schema_data << turn_rate
122
- xml.save(@outfile, encoding: XML::Encoding::UTF_8)
117
+ File.write(@outfile, xml.target!)
123
118
  end
124
119
  end
125
120
 
126
121
  begin
127
122
  Converter.new.convert!
128
- rescue => exception
129
- puts "#{File.basename($0)}: #{exception.message}"
130
- exit 1
123
+ #rescue => exception
124
+ # puts "#{File.basename($0)}: #{exception.message}"
125
+ # exit 1
131
126
  end
@@ -1,3 +1,3 @@
1
1
  module OGNClient
2
- VERSION = "0.2.3".freeze
2
+ VERSION = "0.2.4".freeze
3
3
  end
metadata CHANGED
@@ -1,45 +1,67 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ogn_client-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sven Schwyn
8
8
  autorequire:
9
9
  bindir: exe
10
- cert_chain: []
11
- date: 2017-06-24 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIDcDCCAligAwIBAgIBATANBgkqhkiG9w0BAQUFADA/MQ0wCwYDVQQDDARydWJ5
14
+ MRkwFwYKCZImiZPyLGQBGRYJYml0Y2V0ZXJhMRMwEQYKCZImiZPyLGQBGRYDY29t
15
+ MB4XDTIwMDMxNDE5NDgwNVoXDTIxMDMxNDE5NDgwNVowPzENMAsGA1UEAwwEcnVi
16
+ eTEZMBcGCgmSJomT8ixkARkWCWJpdGNldGVyYTETMBEGCgmSJomT8ixkARkWA2Nv
17
+ bTCCASIwDQYJKoZIhvcNAQEBBQADggEPADCCAQoCggEBAL4k2DCa8/eAFiak4Kwe
18
+ 0Iu8dk0JfHWeywjVVSNv6PtnQ96B/1jLmw5Wb+xYJSyvG6KEOzEMWA/lqO+nIrdO
19
+ 2LDRxuWojH5GROp/dtQ+SxsWlvui4cs9iBmI5Mj0mc1UgST3UFf60ry8OnyR+E9N
20
+ RVVZZykAGmxwyAqD1aq5Yt0lZMdvrGnaLWcZdKC99e812pdTN948k8Iw2GJAaNtH
21
+ Tp17XDfDNBANHjYy9xCqrxvNTfT4Bs43rPA1A77+mkPgI2Vx51u2CWA+K3hP4gAZ
22
+ F50xqnagzgXSOzCme1mC/sUUmoAAB39g2CuNocWuhv0R3/HeqdwAsA/1XpDF2NfQ
23
+ zW8CAwEAAaN3MHUwCQYDVR0TBAIwADALBgNVHQ8EBAMCBLAwHQYDVR0OBBYEFDfY
24
+ gRWUI+J6nX7Po7Zq0zvDopfYMB0GA1UdEQQWMBSBEnJ1YnlAYml0Y2V0ZXJhLmNv
25
+ bTAdBgNVHRIEFjAUgRJydWJ5QGJpdGNldGVyYS5jb20wDQYJKoZIhvcNAQEFBQAD
26
+ ggEBAFsTSBbxIkTdppL8yFl0KglyUMq9DjkMwvz7ORJzHMfw1S2OmXMYnJ5fSXFu
27
+ C/9puwYMdD6V3THyqc1Rhj6RRZ/576MDwIXMgOETQfPTT6jNE+p4cRougDrQ32aV
28
+ 29WIAY21/o0FBuJZqxLDRTu6O7AHrjFnv7Kkpr1oYiR9G4MNEihyNt909nHnSixC
29
+ qn5dLDjawWVvAz5oeD1sE0Kyp6CDY8i3NfBu4aqz8uAbaEJh3jpY5NW2Lv++s7hf
30
+ EUqN8dad5Oosf9hYbfFXPzkJIIGiKMS4e1cbnAr/vadELoccfEN9tSlLuW/voNqA
31
+ 2635TmaVXxUEgIOzRhGlE1+frXI=
32
+ -----END CERTIFICATE-----
33
+ date: 2020-03-16 00:00:00.000000000 Z
12
34
  dependencies:
13
35
  - !ruby/object:Gem::Dependency
14
- name: bundler
36
+ name: rake
15
37
  requirement: !ruby/object:Gem::Requirement
16
38
  requirements:
17
- - - "~>"
39
+ - - ">="
18
40
  - !ruby/object:Gem::Version
19
- version: '1.10'
41
+ version: '0'
20
42
  type: :development
21
43
  prerelease: false
22
44
  version_requirements: !ruby/object:Gem::Requirement
23
45
  requirements:
24
- - - "~>"
46
+ - - ">="
25
47
  - !ruby/object:Gem::Version
26
- version: '1.10'
48
+ version: '0'
27
49
  - !ruby/object:Gem::Dependency
28
- name: rake
50
+ name: pry
29
51
  requirement: !ruby/object:Gem::Requirement
30
52
  requirements:
31
- - - "~>"
53
+ - - ">="
32
54
  - !ruby/object:Gem::Version
33
- version: '10.0'
55
+ version: '0'
34
56
  type: :development
35
57
  prerelease: false
36
58
  version_requirements: !ruby/object:Gem::Requirement
37
59
  requirements:
38
- - - "~>"
60
+ - - ">="
39
61
  - !ruby/object:Gem::Version
40
- version: '10.0'
62
+ version: '0'
41
63
  - !ruby/object:Gem::Dependency
42
- name: pry
64
+ name: minitest
43
65
  requirement: !ruby/object:Gem::Requirement
44
66
  requirements:
45
67
  - - ">="
@@ -53,7 +75,7 @@ dependencies:
53
75
  - !ruby/object:Gem::Version
54
76
  version: '0'
55
77
  - !ruby/object:Gem::Dependency
56
- name: minitest
78
+ name: minitest-reporters
57
79
  requirement: !ruby/object:Gem::Requirement
58
80
  requirements:
59
81
  - - ">="
@@ -67,7 +89,7 @@ dependencies:
67
89
  - !ruby/object:Gem::Version
68
90
  version: '0'
69
91
  - !ruby/object:Gem::Dependency
70
- name: minitest-reporters
92
+ name: minitest-sound
71
93
  requirement: !ruby/object:Gem::Requirement
72
94
  requirements:
73
95
  - - ">="
@@ -94,30 +116,54 @@ dependencies:
94
116
  - - ">="
95
117
  - !ruby/object:Gem::Version
96
118
  version: '0'
97
- description: OGN (glidernet.org) broadcasts aircraft positions as APRS/APRS-IS messages.
98
- This gem hooks into this stream of data and provides the necessary classes to parse
99
- the raw message strings into meaningful objects.
119
+ - !ruby/object:Gem::Dependency
120
+ name: guard
121
+ requirement: !ruby/object:Gem::Requirement
122
+ requirements:
123
+ - - ">="
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
126
+ type: :development
127
+ prerelease: false
128
+ version_requirements: !ruby/object:Gem::Requirement
129
+ requirements:
130
+ - - ">="
131
+ - !ruby/object:Gem::Version
132
+ version: '0'
133
+ - !ruby/object:Gem::Dependency
134
+ name: guard-minitest
135
+ requirement: !ruby/object:Gem::Requirement
136
+ requirements:
137
+ - - ">="
138
+ - !ruby/object:Gem::Version
139
+ version: '0'
140
+ type: :development
141
+ prerelease: false
142
+ version_requirements: !ruby/object:Gem::Requirement
143
+ requirements:
144
+ - - ">="
145
+ - !ruby/object:Gem::Version
146
+ version: '0'
147
+ description: |
148
+ OGN (glidernet.org) broadcasts aircraft positions as APRS/APRS-IS messages.
149
+ This gem hooks into this stream of data and provides the necessary classes
150
+ to parse the raw message strings into meaningful objects.
100
151
  email:
101
152
  - ruby@bitcetera.com
102
153
  executables:
154
+ - ogn2geojson
103
155
  - ogn2kml
104
156
  - ognlogd
105
157
  extensions: []
106
- extra_rdoc_files: []
158
+ extra_rdoc_files:
159
+ - README.md
160
+ - CHANGELOG.md
161
+ - LICENSE.txt
107
162
  files:
108
- - ".code_climate.yml"
109
- - ".editorconfig"
110
- - ".gitignore"
111
- - ".ruby-version"
112
- - ".travis.yml"
113
163
  - CHANGELOG.md
114
- - Gemfile
115
- - Guardfile
116
164
  - LICENSE.txt
117
165
  - README.md
118
- - Rakefile
119
- - bin/console
120
- - bin/setup
166
+ - exe/ogn2geojson
121
167
  - exe/ogn2kml
122
168
  - exe/ognlogd
123
169
  - lib/ogn_client.rb
@@ -129,29 +175,38 @@ files:
129
175
  - lib/ogn_client/messages/receiver_status.rb
130
176
  - lib/ogn_client/messages/sender_beacon.rb
131
177
  - lib/ogn_client/version.rb
132
- - ogn_client-ruby.gemspec
133
- - tasks/test.rake
134
178
  homepage: https://github.com/svoop/ogn_client-ruby
135
179
  licenses:
136
180
  - MIT
137
- metadata: {}
181
+ metadata:
182
+ homepage_uri: https://github.com/svoop/ogn_client-ruby
183
+ changelog_uri: https://github.com/svoop/ogn_client-ruby/blob/master/CHANGELOG.md
184
+ source_code_uri: https://github.com/svoop/ogn_client-ruby
185
+ documentation_uri: https://www.rubydoc.info/gems/ogn_client-ruby
186
+ bug_tracker_uri: https://github.com/svoop/ogn_client-ruby/issues
138
187
  post_install_message:
139
- rdoc_options: []
188
+ rdoc_options:
189
+ - "--title"
190
+ - OGN Subscriber and Parser
191
+ - "--main"
192
+ - README.md
193
+ - "--line-numbers"
194
+ - "--inline-source"
195
+ - "--quiet"
140
196
  require_paths:
141
197
  - lib
142
198
  required_ruby_version: !ruby/object:Gem::Requirement
143
199
  requirements:
144
200
  - - ">="
145
201
  - !ruby/object:Gem::Version
146
- version: '2.1'
202
+ version: 2.4.0
147
203
  required_rubygems_version: !ruby/object:Gem::Requirement
148
204
  requirements:
149
205
  - - ">="
150
206
  - !ruby/object:Gem::Version
151
207
  version: '0'
152
208
  requirements: []
153
- rubyforge_project:
154
- rubygems_version: 2.6.11
209
+ rubygems_version: 3.1.2
155
210
  signing_key:
156
211
  specification_version: 4
157
212
  summary: Subscriber and parser for APRS messages from OGN
Binary file
@@ -1,14 +0,0 @@
1
- ---
2
- languages:
3
- Ruby: true
4
- engines:
5
- fixme:
6
- enabled: true
7
- rubocop:
8
- enabled: true
9
- ratings:
10
- paths:
11
- - "lib/**"
12
- - "**.rb"
13
- exclude_paths:
14
- - "spec/**/*"
@@ -1,12 +0,0 @@
1
- root = true
2
-
3
- [*]
4
- indent_style = space
5
- indent_size = 2
6
- end_of_line = lf
7
- charset = utf-8
8
- trim_trailing_whitespace = true
9
- insert_final_newline = true
10
-
11
- [*.md]
12
- trim_trailing_whitespace = false
data/.gitignore DELETED
@@ -1,10 +0,0 @@
1
- /.bundle/
2
- /.yardoc
3
- /Gemfile.lock
4
- /_yardoc/
5
- /coverage/
6
- /doc/
7
- /pkg/
8
- /spec/reports/
9
- /tmp/
10
- .DS_Store
@@ -1 +0,0 @@
1
- ruby-2.4.1
@@ -1,7 +0,0 @@
1
- ---
2
- language: ruby
3
- rvm:
4
- - 2.4.1
5
- - 2.3.4
6
- - 2.2.7
7
- before_install: gem install bundler -v 1.14.6
data/Gemfile DELETED
@@ -1,9 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- gemspec
4
-
5
- if RUBY_PLATFORM.match /darwin/
6
- gem 'guard'
7
- gem 'guard-minitest'
8
- gem 'minitest-osx'
9
- end
data/Guardfile DELETED
@@ -1,7 +0,0 @@
1
- clearing :on
2
-
3
- guard :minitest do
4
- watch(%r{^spec/(.*)_spec\.rb})
5
- watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
6
- watch(%r{^spec/spec_helper\.rb}) { 'spec' }
7
- end
data/Rakefile DELETED
@@ -1,13 +0,0 @@
1
- require 'bundler/gem_tasks'
2
-
3
- require 'rake/testtask'
4
-
5
- Rake::TestTask.new do |t|
6
- t.libs << 'lib'
7
- t.test_files = FileList['spec/lib/**/*_spec.rb']
8
- t.verbose = true
9
- end
10
-
11
- task :default => :test
12
-
13
- Dir.glob('tasks/*.rake').each { |task| load task }
@@ -1,10 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- require "bundler/setup"
4
- require "ogn_client"
5
-
6
- # You can add fixtures and/or initialization code here to make experimenting
7
- # with your gem easier. You can also use a different console, if you like.
8
-
9
- require "pry"
10
- Pry.start
data/bin/setup DELETED
@@ -1,7 +0,0 @@
1
- #!/bin/bash
2
- set -euo pipefail
3
- IFS=$'\n\t'
4
-
5
- bundle install
6
-
7
- # Do any other automated setup that you need to do here.
@@ -1,29 +0,0 @@
1
- # coding: utf-8
2
- lib = File.expand_path('../lib', __FILE__)
3
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
- require 'ogn_client/version'
5
-
6
- Gem::Specification.new do |spec|
7
- spec.name = 'ogn_client-ruby'
8
- spec.version = OGNClient::VERSION
9
- spec.authors = ['Sven Schwyn']
10
- spec.email = ['ruby@bitcetera.com']
11
- spec.summary = %q{Subscriber and parser for APRS messages from OGN}
12
- spec.description = %q{OGN (glidernet.org) broadcasts aircraft positions as APRS/APRS-IS messages. This gem hooks into this stream of data and provides the necessary classes to parse the raw message strings into meaningful objects.}
13
- spec.homepage = 'https://github.com/svoop/ogn_client-ruby'
14
- spec.license = 'MIT'
15
-
16
- spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
- spec.bindir = 'exe'
18
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
19
- spec.require_paths = ['lib']
20
-
21
- spec.required_ruby_version = '>= 2.1'
22
-
23
- spec.add_development_dependency 'bundler', '~> 1.10'
24
- spec.add_development_dependency 'rake', '~> 10.0'
25
- spec.add_development_dependency 'pry'
26
- spec.add_development_dependency 'minitest'
27
- spec.add_development_dependency 'minitest-reporters'
28
- spec.add_development_dependency 'minitest-matchers'
29
- end
@@ -1,61 +0,0 @@
1
- require 'ogn_client'
2
- require 'tempfile'
3
- require 'fileutils'
4
-
5
- namespace :test do
6
-
7
- desc "Reset the test suite"
8
- task :reset do
9
- FileUtils.rm_f('spec/fixtures/messages.txt')
10
- end
11
-
12
- desc "Feed live APRS messages to the parser"
13
- task :live do
14
- callsign = "ROCT#{rand(1000)}"
15
- counter = 0
16
- loop do
17
- OGNClient::APRS.start(callsign: callsign) do |aprs|
18
- while raw = aprs.gets do
19
- begin
20
- OGNClient::Message.parse raw
21
- rescue OGNClient::Error => error
22
- puts "ERROR: #{error.message}"
23
- end
24
- counter += 1
25
- puts "INFO: captured #{counter} messages" if counter % 1000 == 0
26
- end
27
- end
28
- end
29
- end
30
-
31
- namespace :live do
32
- desc "Record live APRS messages"
33
- task :record do
34
- callsign = "ROCT#{rand(1000)}"
35
- counter = 0
36
- File.open("#{Dir.tmpdir}/ogn_messages.txt", "w") do |file|
37
- OGNClient::APRS.start(callsign: callsign) do |aprs|
38
- while raw = aprs.gets do
39
- file.print raw
40
- counter += 1
41
- puts "INFO: captured #{counter} messages" if counter % 1000 == 0
42
- end
43
- end
44
- end
45
- end
46
-
47
- desc "Feed recorded APRS messages to the parser"
48
- task :replay do
49
- File.open("#{Dir.tmpdir}/ogn_messages.txt") do |file|
50
- while raw = file.gets do
51
- begin
52
- OGNClient::Message.parse raw
53
- rescue OGNClient::Error => error
54
- puts "ERROR: #{error.message}"
55
- end
56
- end
57
- end
58
- end
59
- end
60
-
61
- end