open_gpx_2_kml 0.10.1 → 0.10.2
Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock
CHANGED
@@ -23,15 +23,14 @@ module TF1Converter
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def into(output_file)
|
26
|
-
|
27
|
-
|
28
|
-
CsvFile.new(@gpx.waypoints, csv_path).to_csv!
|
26
|
+
csv_file_name = CsvFile.translate_filename(output_file.path)
|
27
|
+
CsvFile.new(@gpx.waypoints, csv_file_name).to_csv!
|
29
28
|
|
30
29
|
kml = KmlFile.new(@gpx.waypoints, @gpx.tracks, @filename).to_xml
|
31
30
|
output_file.puts kml
|
32
31
|
output_file.close
|
33
32
|
|
34
|
-
kmz = KmzFile.assemble!(
|
33
|
+
kmz = KmzFile.assemble!(csv_file_name.gsub(/\.csv$/,''))
|
35
34
|
end
|
36
35
|
|
37
36
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require_relative '../../../lib/tf1_converter/csv_file'
|
2
|
+
|
3
|
+
module TF1Converter
|
4
|
+
describe CsvFile do
|
5
|
+
describe '.translate_filename' do
|
6
|
+
it 'changes a filepath to be a csv filename' do
|
7
|
+
base_path = '/some/long/path/with/file'
|
8
|
+
CsvFile.translate_filename("#{base_path}.kmz").should == "#{base_path}.csv"
|
9
|
+
end
|
10
|
+
|
11
|
+
it 'changes a filepath with dots to be a csv filename' do
|
12
|
+
base_path = '/some/long.path/with.file'
|
13
|
+
CsvFile.translate_filename("#{base_path}.kmz").should == "#{base_path}.csv"
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
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
|
+
version: 0.10.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -195,6 +195,7 @@ files:
|
|
195
195
|
- spec/fixtures/test.gpx
|
196
196
|
- spec/fixtures/waypoint-by-name.gpx
|
197
197
|
- spec/lib/tf1_converter/config_spec.rb
|
198
|
+
- spec/lib/tf1_converter/csv_file_spec.rb
|
198
199
|
- spec/lib/tf1_converter/gpx/track_spec.rb
|
199
200
|
- spec/lib/tf1_converter/gpx/waypoint_spec.rb
|
200
201
|
- spec/lib/tf1_converter/kml/track_color_spec.rb
|
@@ -214,7 +215,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
214
215
|
version: '0'
|
215
216
|
segments:
|
216
217
|
- 0
|
217
|
-
hash:
|
218
|
+
hash: 1443026133062831129
|
218
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
219
220
|
none: false
|
220
221
|
requirements:
|
@@ -223,7 +224,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
223
224
|
version: '0'
|
224
225
|
segments:
|
225
226
|
- 0
|
226
|
-
hash:
|
227
|
+
hash: 1443026133062831129
|
227
228
|
requirements: []
|
228
229
|
rubyforge_project:
|
229
230
|
rubygems_version: 1.8.23
|
@@ -237,6 +238,7 @@ test_files:
|
|
237
238
|
- spec/fixtures/test.gpx
|
238
239
|
- spec/fixtures/waypoint-by-name.gpx
|
239
240
|
- spec/lib/tf1_converter/config_spec.rb
|
241
|
+
- spec/lib/tf1_converter/csv_file_spec.rb
|
240
242
|
- spec/lib/tf1_converter/gpx/track_spec.rb
|
241
243
|
- spec/lib/tf1_converter/gpx/waypoint_spec.rb
|
242
244
|
- spec/lib/tf1_converter/kml/track_color_spec.rb
|