vatsim_online 0.6.1 → 0.6.2

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.
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## Changelog
4
4
 
5
+ ### v. 0.6.2 - 4 January 2013
6
+
7
+ * updated gem dependencies
8
+ * refactored `Station` class for simplicity
9
+
5
10
  ### v. 0.6.1 - 08 October 2012
6
11
 
7
12
  * Fixed pilot station duplication issue when using multiple ICAOs
data/README.md CHANGED
@@ -305,6 +305,11 @@ the same result.
305
305
 
306
306
  ## Changelog
307
307
 
308
+ ### v. 0.6.2 - 4 January 2013
309
+
310
+ * updated gem dependencies
311
+ * refactored `Station` class for simplicity
312
+
308
313
  ### v. 0.6.1 - 08 October 2012
309
314
 
310
315
  * Fixed pilot station duplication issue when using multiple ICAOs
@@ -389,9 +394,9 @@ original Vatsim data is re-encoded
389
394
 
390
395
  Copyright © 2012 [Svilen Vassilev](http://about.me/svilen)
391
396
 
392
- *If you find my work useful or time-saving, you can endorse it or buy me a beer:*
397
+ *If you find my work useful or time-saving, you can endorse it or buy me a cup of coffee:*
393
398
 
394
- [![endorse](http://api.coderwall.com/svilenv/endorse.png)](http://coderwall.com/svilenv)
399
+ [![endorse](http://api.coderwall.com/svilenv/endorsecount.png)](http://coderwall.com/svilenv)
395
400
  [![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)
396
401
 
397
402
  Released under the [MIT LICENSE](https://github.com/tarakanbg/vatsim_online/blob/master/LICENSE)
@@ -12,32 +12,17 @@ module VatsimTools
12
12
 
13
13
 
14
14
  def initialize(station, args = nil)
15
- @callsign = station[0]
16
- @cid = station[1]
17
- @name = station[2]
18
- @role = station[3]
19
- @frequency = station[4]
20
- @altitude = station[7]
21
- @planned_altitude = station[12]
22
- @groundspeed = station[8]
23
- @aircraft = station[9]
24
- @origin = station[11]
25
- @destination = station[13]
26
- @rating = humanized_rating(station[16])
27
- @facility = station[18]
28
- @remarks = station[29]
29
- @route = station[30]
15
+
16
+ @callsign, @cid, @name, @role, @frequency, @latitude, @longitude, @altitude, @groundspeed, @aircraft, @origin,
17
+ @planned_altitude, @destination, @transponder, @facility, @flight_type, @remarks, @route, @logon, @heading,
18
+ @qnh_in, @qnh_mb = station[0], station[1], station[2], station[3], station[4], station[5], station[6], station[7],
19
+ station[8], station[9], station[11], station[12], station[13], station[17], station[18], station[21], station[29],
20
+ station[30], station[37], station[38], station[39], station[40]
21
+
30
22
  @atis = atis_cleaner(station[35]) if station[35]
31
- @logon = station[37]
32
- @latitude = station[5]
23
+ @rating = humanized_rating(station[16])
33
24
  @latitude_humanized = latitude_parser(station[5].to_f)
34
- @longitude = station[6]
35
25
  @longitude_humanized = longitude_parser(station[6].to_f)
36
- @transponder = station[17]
37
- @heading = station[38]
38
- @qnh_in = station[39]
39
- @qnh_mb = station[40]
40
- @flight_type = station[21]
41
26
  @online_since = utc_logon_time if @logon
42
27
  @gcmap_width = args[:gcmap_width].to_i if args && args[:gcmap_width]
43
28
  @gcmap_height = args[:gcmap_height].to_i if args && args[:gcmap_height]
@@ -49,12 +34,13 @@ module VatsimTools
49
34
 
50
35
  def gcmap_generator
51
36
  return "No map for ATC stations" if @role != "PILOT"
52
- route = @origin
53
- route += "-" + @latitude_humanized + "+" + @longitude_humanized
54
- route += "-" + @destination
37
+ construct_gcmap_url.gcmap(:width => @gcmap_width, :height => @gcmap_height)
38
+ end
39
+
40
+ def construct_gcmap_url
41
+ route = @origin + "-" + @latitude_humanized + "+" + @longitude_humanized + "-" + @destination
55
42
  route += "%2C+\"" + @callsign + "%5Cn" + @altitude + "+ft%5Cn" + @groundspeed + "+kts"
56
43
  route += "\"%2B%40" + @latitude_humanized + "+" + @longitude_humanized
57
- route.gcmap(:width => @gcmap_width, :height => @gcmap_height)
58
44
  end
59
45
 
60
46
  def latitude_parser(lat)
@@ -1,3 +1,3 @@
1
1
  module VatsimOnline
2
- VERSION = "0.6.1"
2
+ VERSION = "0.6.2"
3
3
  end
@@ -20,8 +20,8 @@ Gem::Specification.new do |gem|
20
20
  gem.add_development_dependency "guard"
21
21
  gem.add_development_dependency "libnotify"
22
22
  gem.add_development_dependency "guard-rspec"
23
- gem.add_dependency "curb", "~> 0.8.1"
24
- gem.add_dependency "time_diff", "~> 0.2.2"
23
+ gem.add_dependency "curb", "~> 0.8.3"
24
+ gem.add_dependency "time_diff", "~> 0.3.0"
25
25
  gem.add_dependency "gcmapper", "~> 0.3.1"
26
26
  end
27
27
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vatsim_online
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.6.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-08 00:00:00.000000000 Z
12
+ date: 2013-01-04 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
@@ -98,7 +98,7 @@ dependencies:
98
98
  requirements:
99
99
  - - ~>
100
100
  - !ruby/object:Gem::Version
101
- version: 0.8.1
101
+ version: 0.8.3
102
102
  type: :runtime
103
103
  prerelease: false
104
104
  version_requirements: !ruby/object:Gem::Requirement
@@ -106,7 +106,7 @@ dependencies:
106
106
  requirements:
107
107
  - - ~>
108
108
  - !ruby/object:Gem::Version
109
- version: 0.8.1
109
+ version: 0.8.3
110
110
  - !ruby/object:Gem::Dependency
111
111
  name: time_diff
112
112
  requirement: !ruby/object:Gem::Requirement
@@ -114,7 +114,7 @@ dependencies:
114
114
  requirements:
115
115
  - - ~>
116
116
  - !ruby/object:Gem::Version
117
- version: 0.2.2
117
+ version: 0.3.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
@@ -122,7 +122,7 @@ dependencies:
122
122
  requirements:
123
123
  - - ~>
124
124
  - !ruby/object:Gem::Version
125
- version: 0.2.2
125
+ version: 0.3.0
126
126
  - !ruby/object:Gem::Dependency
127
127
  name: gcmapper
128
128
  requirement: !ruby/object:Gem::Requirement