teich-hrmparser 0.4.6 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION.yml +1 -1
- data/lib/hrmparser/importer/suunto.rb +11 -3
- data/lib/hrmparser/workout.rb +1 -1
- data/spec/hrmparser_spec.rb +6 -5
- metadata +2 -2
data/VERSION.yml
CHANGED
|
@@ -79,9 +79,17 @@ module Importer
|
|
|
79
79
|
points_f = %w[epoc kcal speed]
|
|
80
80
|
points_i = %w[altitude hr respiration ventilation vo2 distance cadence temp]
|
|
81
81
|
|
|
82
|
-
points_f.each
|
|
83
|
-
|
|
84
|
-
|
|
82
|
+
points_f.each do |p|
|
|
83
|
+
value = (eval p).to_f
|
|
84
|
+
value = nil if value == 0.0
|
|
85
|
+
trackpoint.send("#{p}=".to_sym, value)
|
|
86
|
+
end
|
|
87
|
+
|
|
88
|
+
points_i.each do |p|
|
|
89
|
+
value = (eval p).to_i
|
|
90
|
+
value = nil if value == 0
|
|
91
|
+
trackpoint.send("#{p}=".to_sym, value)
|
|
92
|
+
end
|
|
85
93
|
dt = DateTime.strptime(date + " " + time, "%d.%m.%Y %H:%M.%S")
|
|
86
94
|
time_for_parse = dt.strftime("%b %d %H:%M:%S @time_zone %Y")
|
|
87
95
|
trackpoint.time = Time.parse(time_for_parse)
|
data/lib/hrmparser/workout.rb
CHANGED
data/spec/hrmparser_spec.rb
CHANGED
|
@@ -109,7 +109,7 @@ module HRMParser
|
|
|
109
109
|
workout.distance.should be_close(11740, 5)
|
|
110
110
|
workout.average_hr.should be_close(149.7, 0.5)
|
|
111
111
|
workout.average_speed.should be_close(1.5, 0.2)
|
|
112
|
-
workout.altitude_gain.should be_close(
|
|
112
|
+
workout.altitude_gain.should be_close(580, 25)
|
|
113
113
|
end
|
|
114
114
|
|
|
115
115
|
it "gets workout level settings for weird distance workout" do
|
|
@@ -120,7 +120,7 @@ module HRMParser
|
|
|
120
120
|
workout.distance.should be_close(9426, 1)
|
|
121
121
|
workout.average_hr.should == nil
|
|
122
122
|
workout.average_speed.should be_close(6.7, 0.2)
|
|
123
|
-
workout.altitude_gain.should be_close(40,
|
|
123
|
+
workout.altitude_gain.should be_close(40, 10)
|
|
124
124
|
end
|
|
125
125
|
|
|
126
126
|
it "doesn't have any 0 in latitude" do
|
|
@@ -178,7 +178,8 @@ module HRMParser
|
|
|
178
178
|
workout = importer.restore
|
|
179
179
|
workout.average_hr.should be_close(152,1)
|
|
180
180
|
workout.average_speed.should == nil
|
|
181
|
-
workout.
|
|
181
|
+
workout.trackpoints.each { |tp| tp.speed.should == nil }
|
|
182
|
+
workout.altitude_gain.should be_close(115, 10)
|
|
182
183
|
end
|
|
183
184
|
it "calculates the speed and distance" do
|
|
184
185
|
filename = "spec/samples/suunto-with-cadence-speed-distance.sdf"
|
|
@@ -186,8 +187,8 @@ module HRMParser
|
|
|
186
187
|
importer = Importer::Suunto.new(:data => data, :time_zone => "Pacific Time (US & Canada)")
|
|
187
188
|
workout = importer.restore
|
|
188
189
|
workout.average_hr.should be_close(131,1)
|
|
189
|
-
workout.average_speed.should be_close(9.
|
|
190
|
-
workout.altitude_gain.should be_close(
|
|
190
|
+
workout.average_speed.should be_close(9.3, 0.1)
|
|
191
|
+
workout.altitude_gain.should be_close(70, 10)
|
|
191
192
|
workout.distance.should == 124597
|
|
192
193
|
end
|
|
193
194
|
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: teich-hrmparser
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.7
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Oren Teich
|
|
@@ -9,7 +9,7 @@ autorequire:
|
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
11
|
|
|
12
|
-
date: 2009-05-
|
|
12
|
+
date: 2009-05-13 00:00:00 -07:00
|
|
13
13
|
default_executable:
|
|
14
14
|
dependencies: []
|
|
15
15
|
|