open_gpx_2_kml 1.0.3 → 1.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/tf1_converter/gpx/waypoint.rb +19 -17
- data/lib/tf1_converter/version.rb +1 -1
- data/spec/lib/tf1_converter/gpx/waypoint_spec.rb +8 -0
- metadata +4 -4
data/Gemfile.lock
CHANGED
@@ -12,27 +12,12 @@ module TF1Converter
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def icon_name
|
15
|
-
if
|
16
|
-
map_entry = @icon_map[symbol_name]
|
17
|
-
return map_entry['icon'] if map_entry
|
18
|
-
end
|
19
|
-
|
20
|
-
if name
|
21
|
-
@icon_map.values.each do |icon_data|
|
22
|
-
if icon_data['name']
|
23
|
-
return icon_data['icon'] if icon_data['name'].upcase == name.slice(0,3).upcase
|
24
|
-
end
|
25
|
-
end
|
26
|
-
end
|
27
|
-
|
15
|
+
return icon_map_entry['icon'] if icon_map_entry
|
28
16
|
'default.png'
|
29
17
|
end
|
30
18
|
|
31
19
|
def icon_meaning
|
32
|
-
if
|
33
|
-
map_entry = @icon_map[symbol_name]
|
34
|
-
return map_entry['meaning'] if map_entry
|
35
|
-
end
|
20
|
+
return icon_map_entry['meaning'] if icon_map_entry
|
36
21
|
'Default'
|
37
22
|
end
|
38
23
|
|
@@ -78,6 +63,23 @@ module TF1Converter
|
|
78
63
|
end
|
79
64
|
end
|
80
65
|
|
66
|
+
def icon_map_entry
|
67
|
+
if symbol_name
|
68
|
+
map_entry = @icon_map[symbol_name]
|
69
|
+
return map_entry if map_entry
|
70
|
+
end
|
71
|
+
|
72
|
+
if name
|
73
|
+
@icon_map.values.each do |icon_data|
|
74
|
+
if icon_data['name']
|
75
|
+
return icon_data if icon_data['name'].upcase == name.slice(0,3).upcase
|
76
|
+
end
|
77
|
+
end
|
78
|
+
end
|
79
|
+
|
80
|
+
false
|
81
|
+
end
|
82
|
+
|
81
83
|
end
|
82
84
|
end
|
83
85
|
end
|
@@ -67,6 +67,8 @@ module TF1Converter::Gpx
|
|
67
67
|
end
|
68
68
|
|
69
69
|
describe '#icon_meaning' do
|
70
|
+
before { node.stub_chain(:xpath, :first) { nil } }
|
71
|
+
|
70
72
|
it 'returns a matching meaning from the map' do
|
71
73
|
node.stub_chain(:children, :select, :first, :text){ 'meaningoflife' }
|
72
74
|
icon_map['meaningoflife'] = {'meaning' => 'life'}
|
@@ -82,6 +84,12 @@ module TF1Converter::Gpx
|
|
82
84
|
node.stub_chain(:children, :select, :first, :text){ '' }
|
83
85
|
waypoint.icon_meaning.should == 'Default'
|
84
86
|
end
|
87
|
+
|
88
|
+
it 'matches by name if theres no sym' do
|
89
|
+
waypoint = waypoint_from(waypoint_by_name_fragment)
|
90
|
+
icon_map['meaningoflife'] = { 'icon' => '42.png', 'name' => 'C05', 'meaning' => 'life, universe, everything'}
|
91
|
+
waypoint.icon_meaning.should == 'life, universe, everything'
|
92
|
+
end
|
85
93
|
end
|
86
94
|
|
87
95
|
describe '#timestamp' do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_gpx_2_kml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.4
|
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: 2013-04-
|
12
|
+
date: 2013-04-08 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rake
|
@@ -255,7 +255,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
255
255
|
version: '0'
|
256
256
|
segments:
|
257
257
|
- 0
|
258
|
-
hash: -
|
258
|
+
hash: -2034610430434596952
|
259
259
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
260
260
|
none: false
|
261
261
|
requirements:
|
@@ -264,7 +264,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
264
264
|
version: '0'
|
265
265
|
segments:
|
266
266
|
- 0
|
267
|
-
hash: -
|
267
|
+
hash: -2034610430434596952
|
268
268
|
requirements: []
|
269
269
|
rubyforge_project:
|
270
270
|
rubygems_version: 1.8.23
|