vatsim_online 0.8.3 → 0.9
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +8 -4
- data/lib/vatsim_online/station.rb +3 -3
- data/lib/vatsim_online/station_parser.rb +19 -8
- data/lib/vatsim_online/version.rb +1 -1
- data/vatsim_online.gemspec +1 -2
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 035ddd6e7d2e1bee0abb99bf0d3b0667899b83fc
|
4
|
+
data.tar.gz: ad7525ca904f1943bc6125b45775987ca05d0c1c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c942853d19c893cec2418511796294a20afd803e717066e170cb174fbe21664639a7fc39572637d7b57d5f4248f7a452c739dc5b16efbfb8a3992807ff4779f6
|
7
|
+
data.tar.gz: 569aa9abcf055428dd36d8a7414886138eab6f7ed79d5e81835d231b950434ad88508ec1a0759762af1c8e29a43269ce3ab25eb39a5346ed1536d6aac3c76fcc
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -332,6 +332,10 @@ the same result.
|
|
332
332
|
|
333
333
|
## Changelog
|
334
334
|
|
335
|
+
### v. 0.9 - 20 June 2015
|
336
|
+
|
337
|
+
* Fixed nil String bug, can select "ALL" (thanks to Pierre Ferran and Florian Rimoli)
|
338
|
+
|
335
339
|
### v. 0.8.3 - 10 April 2014
|
336
340
|
|
337
341
|
* Fix stale data bug, change data fallback logic
|
@@ -452,12 +456,12 @@ original Vatsim data is re-encoded
|
|
452
456
|
|
453
457
|
## Credits
|
454
458
|
|
455
|
-
Copyright ©
|
459
|
+
Copyright © 2015 [Svilen Vassilev](http://svilen.rubystudio.net)
|
456
460
|
|
457
|
-
|
461
|
+
### Contributors
|
458
462
|
|
459
|
-
[
|
460
|
-
[
|
463
|
+
* [Florian Rimoli](https://github.com/Flox06)
|
464
|
+
* [Pierre Ferran](https://github.com/pierr3)
|
461
465
|
|
462
466
|
Released under the [MIT LICENSE](https://github.com/tarakanbg/vatsim_online/blob/master/LICENSE)
|
463
467
|
|
@@ -38,9 +38,9 @@ module VatsimTools
|
|
38
38
|
|
39
39
|
def construct_gcmap_url
|
40
40
|
if @origin && @latitude_humanized && @longitude_humanized && @destination
|
41
|
-
route = @origin + "-" + @latitude_humanized + "+" + @longitude_humanized + "-" + @destination
|
42
|
-
route += "%2C+\"" + @callsign + "%5Cn" + @altitude + "+ft%5Cn" + @groundspeed + "+kts"
|
43
|
-
route += "\"%2B%40" + @latitude_humanized + "+" + @longitude_humanized
|
41
|
+
route = @origin.to_s + "-" + @latitude_humanized.to_s + "+" + @longitude_humanized.to_s + "-" + @destination.to_s
|
42
|
+
route += "%2C+\"" + @callsign.to_s + "%5Cn" + @altitude.to_s + "+ft%5Cn" + @groundspeed.to_s + "+kts"
|
43
|
+
route += "\"%2B%40" + @latitude_humanized.to_s + "+" + @longitude_humanized.to_s
|
44
44
|
else
|
45
45
|
route = "Position undetermined"
|
46
46
|
end
|
@@ -14,7 +14,11 @@ module VatsimTools
|
|
14
14
|
def initialize(icao, args = nil)
|
15
15
|
VatsimTools::DataDownloader.new
|
16
16
|
args.class == Hash ? @role = determine_role(args) : @role = "all"
|
17
|
-
|
17
|
+
if icao == "ALL"
|
18
|
+
@icao = nil
|
19
|
+
else
|
20
|
+
@icao = icao.upcase.split(',').each {|s| s.strip!}
|
21
|
+
end
|
18
22
|
@excluded = args[:exclude].upcase if args && args[:exclude]
|
19
23
|
@gcmap_width = args[:gcmap_width] if args && args[:gcmap_width]
|
20
24
|
@gcmap_height = args[:gcmap_height] if args && args[:gcmap_height]
|
@@ -31,9 +35,14 @@ module VatsimTools
|
|
31
35
|
stations = []
|
32
36
|
CSV.foreach(LOCAL_DATA, :col_sep =>':') do |row|
|
33
37
|
callsign, origin, destination, client = row[0].to_s, row[11].to_s, row[13].to_s, row[3].to_s
|
34
|
-
|
35
|
-
stations << row if (
|
36
|
-
stations << row if (
|
38
|
+
unless @icao
|
39
|
+
stations << row if (client == "ATC") unless @role == "pilot"
|
40
|
+
stations << row if (client == "PILOT") unless @role == "atc"
|
41
|
+
else
|
42
|
+
for icao in @icao
|
43
|
+
stations << row if (callsign[0...icao.length] == icao && client == "ATC") unless @role == "pilot"
|
44
|
+
stations << row if (origin[0...icao.length] == icao || destination[0...icao.length] == icao) unless @role == "atc"
|
45
|
+
end
|
37
46
|
end
|
38
47
|
end
|
39
48
|
stations
|
@@ -51,10 +60,12 @@ module VatsimTools
|
|
51
60
|
def sorted_station_objects
|
52
61
|
atc = []; pilots = []; arrivals = []; departures = []
|
53
62
|
station_objects.each {|sobj| sobj.role == "ATC" ? atc << sobj : pilots << sobj}
|
54
|
-
|
55
|
-
for
|
56
|
-
|
57
|
-
|
63
|
+
if @icao
|
64
|
+
for icao in @icao
|
65
|
+
for pilot in pilots
|
66
|
+
departures << pilot if pilot.origin[0...icao.length] == icao
|
67
|
+
arrivals << pilot if pilot.destination[0...icao.length] == icao
|
68
|
+
end
|
58
69
|
end
|
59
70
|
end
|
60
71
|
atc.delete_if {|a| @excluded && a.callsign[0...@excluded.length] == @excluded }
|
data/vatsim_online.gemspec
CHANGED
@@ -22,8 +22,7 @@ Gem::Specification.new do |gem|
|
|
22
22
|
gem.add_development_dependency "libnotify"
|
23
23
|
gem.add_development_dependency "rb-inotify"
|
24
24
|
gem.add_development_dependency "guard-rspec"
|
25
|
-
gem.add_dependency "curb", "~> 0.8.
|
25
|
+
gem.add_dependency "curb", "~> 0.8.8"
|
26
26
|
gem.add_dependency "time_diff", "~> 0.3.0"
|
27
27
|
gem.add_dependency "gcmapper", "~> 0.4.0"
|
28
28
|
end
|
29
|
-
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: vatsim_online
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.9'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Svilen Vassilev
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-06-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|
@@ -100,14 +100,14 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - "~>"
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version: 0.8.
|
103
|
+
version: 0.8.8
|
104
104
|
type: :runtime
|
105
105
|
prerelease: false
|
106
106
|
version_requirements: !ruby/object:Gem::Requirement
|
107
107
|
requirements:
|
108
108
|
- - "~>"
|
109
109
|
- !ruby/object:Gem::Version
|
110
|
-
version: 0.8.
|
110
|
+
version: 0.8.8
|
111
111
|
- !ruby/object:Gem::Dependency
|
112
112
|
name: time_diff
|
113
113
|
requirement: !ruby/object:Gem::Requirement
|