summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-07-31 23:02:28 +0200
committerChris Schlaeger <chris@linux.com>2014-07-31 23:02:28 +0200
commit70f54be360a7d0f55ceec1636e0fea9447c2b83c (patch)
tree155f4cca5739887ca1bca2bd0c070be411ec284a /lib
parent6418648bcae08129ad89b65601f7ac86f9d9e950 (diff)
downloadpostrunner-70f54be360a7d0f55ceec1636e0fea9447c2b83c.zip
Adapt to latest fit4ruby changes.
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/Activity.rb8
-rw-r--r--lib/postrunner/ActivityReport.rb2
-rw-r--r--lib/postrunner/Main.rb2
3 files changed, 6 insertions, 6 deletions
diff --git a/lib/postrunner/Activity.rb b/lib/postrunner/Activity.rb
index aa50789..a37c2de 100644
--- a/lib/postrunner/Activity.rb
+++ b/lib/postrunner/Activity.rb
@@ -31,8 +31,8 @@ module PostRunner
Log.info "FIT file #{@fit_file} is OK"
end
- def dump
- load_fit_file
+ def dump(filter)
+ load_fit_file(filter)
end
def yaml_initialize(tag, value)
@@ -69,10 +69,10 @@ module PostRunner
private
- def load_fit_file
+ def load_fit_file(filter = nil)
fit_file = File.join(@db.fit_dir, @fit_file)
begin
- return Fit4Ruby.read(fit_file)
+ return Fit4Ruby.read(fit_file, filter)
rescue Fit4Ruby::Error
Log.fatal $!
end
diff --git a/lib/postrunner/ActivityReport.rb b/lib/postrunner/ActivityReport.rb
index 84075d5..60ceef1 100644
--- a/lib/postrunner/ActivityReport.rb
+++ b/lib/postrunner/ActivityReport.rb
@@ -60,7 +60,7 @@ module PostRunner
'Avg. HR', 'Max. HR' ])
t.set_column_attributes(Array.new(7, { :halign => :right }))
t.body
- @activity.laps.each do |lap|
+ @activity.sessions[0].laps.each do |lap|
t.cell(secsToHMS(lap.total_timer_time))
t.cell('%.2f' % (lap.total_distance / 1000.0))
t.cell(speedToPace(lap.avg_speed))
diff --git a/lib/postrunner/Main.rb b/lib/postrunner/Main.rb
index 96d6265..3ec3c70 100644
--- a/lib/postrunner/Main.rb
+++ b/lib/postrunner/Main.rb
@@ -220,7 +220,7 @@ EOT
when :delete
@activities.delete(activity)
when :dump
- activity.dump
+ activity.dump(@filter)
when :rename
@activities.rename(activity, @name)
when :summary