summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
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)