open_gpx_2_kml 0.10.4 → 1.0.0

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/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- open_gpx_2_kml (0.10.4)
4
+ open_gpx_2_kml (1.0.0)
5
5
  builder (= 3.1.4)
6
6
  geo_swap (= 0.2.1)
7
7
  nokogiri (= 1.5.6)
@@ -11,13 +11,21 @@ module TF1Converter
11
11
  CSV.open(@path, 'wb') do |csv|
12
12
  csv << ['filename', 'name', 'meaning', 'time', 'lat', 'long', 'usng', 'elevation']
13
13
  @waypoints.each do |wp|
14
- csv << [@path.split('.').first, wp.name, wp.icon_meaning, wp.timestamp, wp.lat, wp.long, wp.usng, wp.elevation]
14
+ csv << [raw_path, wp.name, wp.icon_meaning, wp.timestamp, wp.lat, wp.long, wp.usng, wp.elevation]
15
15
  end
16
16
  end
17
17
  end
18
18
 
19
+ def raw_path
20
+ CsvFile.raw_path(@path)
21
+ end
22
+
19
23
  def self.translate_filename(file_path)
20
- file_path.split('.')[0...-1].join('.') + '.csv'
24
+ raw_path(file_path) + '.csv'
25
+ end
26
+
27
+ def self.raw_path(path)
28
+ path.split('.')[0...-1].join('.')
21
29
  end
22
30
  end
23
31
  end
@@ -19,7 +19,7 @@ module TF1Converter
19
19
  xml.Placemark(id: @track.name) do
20
20
  xml.name @track.name
21
21
  xml.description do
22
- xml.cdata @filename
22
+ xml.cdata "Filename: #{@filename}"
23
23
  end
24
24
  xml.styleUrl "##{@track.name}_Style"
25
25
  xml.LineString do
@@ -1,3 +1,3 @@
1
1
  module TF1Converter
2
- VERSION = "0.10.4"
2
+ VERSION = "1.0.0"
3
3
  end
@@ -247,7 +247,7 @@
247
247
  </Style>
248
248
  <Placemark id="18-OCT-09">
249
249
  <name>18-OCT-09</name>
250
- <description><![CDATA[test]]></description>
250
+ <description><![CDATA[Filename: test]]></description>
251
251
  <styleUrl>#18-OCT-09_Style</styleUrl>
252
252
  <LineString>
253
253
  <extrude>1</extrude>
@@ -264,7 +264,7 @@
264
264
  </Style>
265
265
  <Placemark id="ACTIVE LOG 001">
266
266
  <name>ACTIVE LOG 001</name>
267
- <description><![CDATA[test]]></description>
267
+ <description><![CDATA[Filename: test]]></description>
268
268
  <styleUrl>#ACTIVE LOG 001_Style</styleUrl>
269
269
  <LineString>
270
270
  <extrude>1</extrude>
@@ -281,7 +281,7 @@
281
281
  </Style>
282
282
  <Placemark id="ACTIVE LOG 002">
283
283
  <name>ACTIVE LOG 002</name>
284
- <description><![CDATA[test]]></description>
284
+ <description><![CDATA[Filename: test]]></description>
285
285
  <styleUrl>#ACTIVE LOG 002_Style</styleUrl>
286
286
  <LineString>
287
287
  <extrude>1</extrude>
@@ -298,7 +298,7 @@
298
298
  </Style>
299
299
  <Placemark id="ACTIVE LOG 003">
300
300
  <name>ACTIVE LOG 003</name>
301
- <description><![CDATA[test]]></description>
301
+ <description><![CDATA[Filename: test]]></description>
302
302
  <styleUrl>#ACTIVE LOG 003_Style</styleUrl>
303
303
  <LineString>
304
304
  <extrude>1</extrude>
@@ -315,7 +315,7 @@
315
315
  </Style>
316
316
  <Placemark id="ACTIVE LOG 004">
317
317
  <name>ACTIVE LOG 004</name>
318
- <description><![CDATA[test]]></description>
318
+ <description><![CDATA[Filename: test]]></description>
319
319
  <styleUrl>#ACTIVE LOG 004_Style</styleUrl>
320
320
  <LineString>
321
321
  <extrude>1</extrude>
@@ -2,6 +2,16 @@ require_relative '../../../lib/tf1_converter/csv_file'
2
2
 
3
3
  module TF1Converter
4
4
  describe CsvFile do
5
+
6
+ it 'writes waypoints to the csv file' do
7
+ waypoints = [double('waypoint').as_null_object]
8
+ base_path = '/some/long.path/with.file/test.gpx'
9
+ csv = []
10
+ CSV.stub(:open).and_yield(csv)
11
+ CsvFile.new(waypoints, base_path).to_csv!
12
+ csv[1].first.should == '/some/long.path/with.file/test'
13
+ end
14
+
5
15
  describe '.translate_filename' do
6
16
  it 'changes a filepath to be a csv filename' do
7
17
  base_path = '/some/long/path/with/file'
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: 0.10.4
4
+ version: 1.0.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -254,7 +254,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
254
254
  version: '0'
255
255
  segments:
256
256
  - 0
257
- hash: 788333395735345652
257
+ hash: 2587989148526281822
258
258
  required_rubygems_version: !ruby/object:Gem::Requirement
259
259
  none: false
260
260
  requirements:
@@ -263,7 +263,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
263
263
  version: '0'
264
264
  segments:
265
265
  - 0
266
- hash: 788333395735345652
266
+ hash: 2587989148526281822
267
267
  requirements: []
268
268
  rubyforge_project:
269
269
  rubygems_version: 1.8.23