summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Rakefile20
-rw-r--r--lib/postrunner/ActivitySummary.rb3
-rw-r--r--lib/postrunner/UserProfileView.rb4
-rw-r--r--postrunner.gemspec4
4 files changed, 24 insertions, 7 deletions
diff --git a/Rakefile b/Rakefile
index 7053a89..b965610 100644
--- a/Rakefile
+++ b/Rakefile
@@ -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'