summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorChris Schlaeger <chris@linux.com>2014-08-21 22:27:25 +0200
committerChris Schlaeger <chris@linux.com>2014-08-21 22:27:25 +0200
commitc879fd4a6e1da1996c7f05daf3979080e3d51f29 (patch)
treea17236f406ada4b5b7164156f8fd98c94a904db5 /lib
parentda47178b94d6ff247c8c13c1cc6880f2f1d73bbc (diff)
downloadpostrunner-c879fd4a6e1da1996c7f05daf3979080e3d51f29.zip
Ensure that imported files have HTML reports
Diffstat (limited to 'lib')
-rw-r--r--lib/postrunner/ActivitiesDB.rb4
-rw-r--r--lib/postrunner/Activity.rb2
2 files changed, 6 insertions, 0 deletions
diff --git a/lib/postrunner/ActivitiesDB.rb b/lib/postrunner/ActivitiesDB.rb
index f38ee79..fd26e13 100644
--- a/lib/postrunner/ActivitiesDB.rb
+++ b/lib/postrunner/ActivitiesDB.rb
@@ -56,6 +56,10 @@ module PostRunner
@records = PersonalRecords.new(self)
end
+ # Add a new FIT file to the database.
+ # @param fit_file [String] Name of the FIT file.
+ # @return [TrueClass or FalseClass] True if the file could be added. False
+ # otherwise.
def add(fit_file)
base_fit_file = File.basename(fit_file)
if @activities.find { |a| a.fit_file == base_fit_file }
diff --git a/lib/postrunner/Activity.rb b/lib/postrunner/Activity.rb
index 23972e2..8a0b2a2 100644
--- a/lib/postrunner/Activity.rb
+++ b/lib/postrunner/Activity.rb
@@ -37,6 +37,8 @@ module PostRunner
instance_variable_set(v_str, fit_activity.send(v))
self.class.send(:attr_reader, v.to_sym)
end
+ # Generate HTML file for this activity.
+ ActivityView.new(self)
end
def late_init(db)