diff options
-rw-r--r-- | lib/postrunner/TrackView.rb | 12 | ||||
-rw-r--r-- | lib/postrunner/version.rb | 2 | ||||
-rw-r--r-- | postrunner.gemspec | 2 |
3 files changed, 10 insertions, 6 deletions
diff --git a/lib/postrunner/TrackView.rb b/lib/postrunner/TrackView.rb index 56f97c6..79018b5 100644 --- a/lib/postrunner/TrackView.rb +++ b/lib/postrunner/TrackView.rb @@ -86,15 +86,19 @@ EOT # in EPSG:4326. Generate a javascript variable with an Array of track # points. def track_points - "var pr_track_points = [\n" + + points = [] @activity.fit_activity.sessions.map do |session| session.records.map do |record| long = record.position_long lat = record.position_lat next unless long && lat - "[ #{long}, #{lat} ]" - end.join(', ') - end.join(', ') + + + points << "[ #{long}, #{lat} ]" + end + end + + "var pr_track_points = [\n" + + points.join(', ') + "\n];\n" end diff --git a/lib/postrunner/version.rb b/lib/postrunner/version.rb index 2179ea3..9ce33eb 100644 --- a/lib/postrunner/version.rb +++ b/lib/postrunner/version.rb @@ -11,5 +11,5 @@ # module PostRunner - VERSION = "0.0.10" + VERSION = "0.0.11" end diff --git a/postrunner.gemspec b/postrunner.gemspec index 4f12ac3..28f1b99 100644 --- a/postrunner.gemspec +++ b/postrunner.gemspec @@ -19,7 +19,7 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.required_ruby_version = '>=2.0' - spec.add_dependency 'fit4ruby', '~> 0.0.7' + spec.add_dependency 'fit4ruby', '~> 0.0.8' spec.add_dependency 'perobs', '~> 1.0.0' spec.add_dependency 'nokogiri', '~> 1.6' |