vatsim_online 0.8.3 → 0.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2d6ff206e783e76208736015dd0192e0e7a24b44
4
- data.tar.gz: 8c4cf4a435d97a09f469318d5270f98366d03468
3
+ metadata.gz: 035ddd6e7d2e1bee0abb99bf0d3b0667899b83fc
4
+ data.tar.gz: ad7525ca904f1943bc6125b45775987ca05d0c1c
5
5
  SHA512:
6
- metadata.gz: 183387efe4206e8e54deb92efbe38e7a9605067269e7eea960b5f024be39d416cac6795b7dae669f57957a1b9cbad04b0fcf05a9800cb4ead9e0569f5d146891
7
- data.tar.gz: 47db87f81ad25fc410e237c7342c3b4fd21ab5841a106559529f5f927a27abe9e89302e6244dbd061c456e151ff85ed27c1aa9f5e4ff20ac0f3509db1bdd13fc
6
+ metadata.gz: c942853d19c893cec2418511796294a20afd803e717066e170cb174fbe21664639a7fc39572637d7b57d5f4248f7a452c739dc5b16efbfb8a3992807ff4779f6
7
+ data.tar.gz: 569aa9abcf055428dd36d8a7414886138eab6f7ed79d5e81835d231b950434ad88508ec1a0759762af1c8e29a43269ce3ab25eb39a5346ed1536d6aac3c76fcc
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### v. 0.9 - 20 June 2015
6
+
7
+ * Fixed nil String bug, can select "ALL" (thanks to Pierre Ferran and Florian Rimoli)
8
+
5
9
  ### v. 0.8.3 - 10 April 2014
6
10
 
7
11
  * Fix stale data bug, change data fallback logic
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 © 2013 [Svilen Vassilev](http://svilen.rubystudio.net)
459
+ Copyright © 2015 [Svilen Vassilev](http://svilen.rubystudio.net)
456
460
 
457
- *If you find my work useful or time-saving, you can endorse it or buy me a cup of coffee:*
461
+ ### Contributors
458
462
 
459
- [![endorse](http://api.coderwall.com/svilenv/endorsecount.png)](http://coderwall.com/svilenv)
460
- [![Donate](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=5FR7AQA4PLD8A)
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
- @icao = icao.upcase.split(',').each {|s| s.strip!}
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
- for icao in @icao
35
- stations << row if (callsign[0...icao.length] == icao && client == "ATC") unless @role == "pilot"
36
- stations << row if (origin[0...icao.length] == icao || destination[0...icao.length] == icao) unless @role == "atc"
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
- for icao in @icao
55
- for pilot in pilots
56
- departures << pilot if pilot.origin[0...icao.length] == icao
57
- arrivals << pilot if pilot.destination[0...icao.length] == icao
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 }
@@ -1,3 +1,3 @@
1
1
  module VatsimOnline
2
- VERSION = "0.8.3"
2
+ VERSION = "0.9"
3
3
  end
@@ -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.5"
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.8.3
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: 2014-04-10 00:00:00.000000000 Z
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.5
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.5
110
+ version: 0.8.8
111
111
  - !ruby/object:Gem::Dependency
112
112
  name: time_diff
113
113
  requirement: !ruby/object:Gem::Requirement