summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2015-10-26 20:22:02 +0100
committerChris Schlaeger <chris@linux.com>2015-10-26 20:22:02 +0100
commit75b1f25cb1e9d1360aa894e1bfca4df3548f4278 (patch)
tree6ca6661ad3830ebfa3b0cf9a6f796d3da830721f
parent5590faccc2c96f5038463685407ea4e468c056c8 (diff)
downloadpostrunner-75b1f25cb1e9d1360aa894e1bfca4df3548f4278.zip
Fixing track point generation. Bumping version.v0.0.11
-rw-r--r--lib/postrunner/TrackView.rb12
-rw-r--r--lib/postrunner/version.rb2
-rw-r--r--postrunner.gemspec2
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'