diff options
author | Chris Schlaeger <chris@linux.com> | 2016-01-26 21:30:15 +0100 |
---|---|---|
committer | Chris Schlaeger <chris@linux.com> | 2016-01-26 21:30:15 +0100 |
commit | ad10d7bc12eb171ebbb4b8acb8f06288df6bd877 (patch) | |
tree | 061a791f46092f3c71ad3bacca4292732d9fd796 | |
parent | fcb1cdaeb1c08d0e531ed8763780276bd2700b92 (diff) | |
download | postrunner-ad10d7bc12eb171ebbb4b8acb8f06288df6bd877.zip |
Showing METmax derived VO2max instead of the event log based VO2max value.
-rw-r--r-- | Rakefile | 20 | ||||
-rw-r--r-- | lib/postrunner/ActivitySummary.rb | 3 | ||||
-rw-r--r-- | lib/postrunner/UserProfileView.rb | 4 | ||||
-rw-r--r-- | postrunner.gemspec | 4 |
4 files changed, 24 insertions, 7 deletions
@@ -1,8 +1,24 @@ +$:.unshift File.join(File.dirname(__FILE__)) + +# Add the lib directory to the search path if it isn't included already +lib = File.expand_path('../lib', __FILE__) +$:.unshift lib unless $:.include?(lib) + require "bundler/gem_tasks" require "rspec/core/rake_task" +require 'rake/clean' +require 'yard' +YARD::Rake::YardocTask.new -RSpec::Core::RakeTask.new +Dir.glob( 'tasks/*.rake').each do |fn| + begin + load fn; + rescue LoadError + puts "#{fn.split('/')[1]} tasks unavailable: #{$!}" + end +end -task :default => :spec +task :default => :spec task :test => :spec +desc 'Run all unit and spec tests' diff --git a/lib/postrunner/ActivitySummary.rb b/lib/postrunner/ActivitySummary.rb index 12802ed..89778ea 100644 --- a/lib/postrunner/ActivitySummary.rb +++ b/lib/postrunner/ActivitySummary.rb @@ -125,9 +125,6 @@ module PostRunner t.row([ 'Suggested Recovery Time:', rec_time ? secsToDHMS(rec_time * 60) : '-' ]) - vo2max = @fit_activity.vo2max - t.row([ 'VO2max:', vo2max ? vo2max : '-' ]) - hrv = HRV_Analyzer.new(@fit_activity) if hrv.has_hrv_data? t.row([ 'HRV Score:', "%.1f" % hrv.lnrmssdx20_1sigma ]) diff --git a/lib/postrunner/UserProfileView.rb b/lib/postrunner/UserProfileView.rb index c89216b..6f009d0 100644 --- a/lib/postrunner/UserProfileView.rb +++ b/lib/postrunner/UserProfileView.rb @@ -57,6 +57,10 @@ module PostRunner if profile.activity_class t.row([ 'Activity Class:', profile.activity_class ]) end + if profile.metmax + t.row([ 'METmax:', "#{profile.metmax} MET" ]) + t.row([ 'VO2max:', "#{'%.1f' % (profile.metmax * 3.5)} ml/kg/min" ]) + end t end diff --git a/postrunner.gemspec b/postrunner.gemspec index 555852f..f85c851 100644 --- a/postrunner.gemspec +++ b/postrunner.gemspec @@ -19,8 +19,8 @@ Gem::Specification.new do |spec| spec.require_paths = ["lib"] spec.required_ruby_version = '>=2.0' - spec.add_dependency 'fit4ruby', '~> 0.0.8' - spec.add_dependency 'perobs', '~> 2.0.1' + spec.add_dependency 'fit4ruby', '~> 0.0.9' + spec.add_dependency 'perobs', '~> 2.2' spec.add_dependency 'nokogiri', '~> 1.6' spec.add_development_dependency 'bundler', '~> 1.6' |