teich-hrmparser 0.4.1 → 0.4.2
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/CHANGELOG.txt +4 -1
- data/VERSION.yml +1 -1
- data/lib/hrmparser/importer/gpx.rb +3 -1
- data/spec/hrmparser_spec.rb +1 -1
- metadata +1 -1
data/CHANGELOG.txt
CHANGED
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
0.4.2 - May 9th, 2009
|
|
2
|
+
Fixed GPX to grab time from first trackpoint.
|
|
3
|
+
|
|
1
4
|
0.4.1 - May 9th, 2009
|
|
2
5
|
Added GPX support.
|
|
3
6
|
NOTE: all workouts do NOT account for stopped time.
|
|
@@ -11,4 +14,4 @@
|
|
|
11
14
|
|
|
12
15
|
0.2.3
|
|
13
16
|
Now should keep lat and lng set to nil when they don't exist in garmin files.
|
|
14
|
-
|
|
17
|
+
|
data/VERSION.yml
CHANGED
|
@@ -7,7 +7,9 @@ module Importer
|
|
|
7
7
|
def restore
|
|
8
8
|
workout = HRMParser::Workout.new(:duration => 0)
|
|
9
9
|
@xml = Hpricot::XML(@data)
|
|
10
|
-
|
|
10
|
+
|
|
11
|
+
# Set the time based on first trackpoint. Seen an instance where the gpx begining time is wrong
|
|
12
|
+
ttime = (@xml/:trk/:trkpt/:time).first.innerHTML
|
|
11
13
|
workout.time = Time.parse(ttime)
|
|
12
14
|
|
|
13
15
|
trackpoints = []
|
data/spec/hrmparser_spec.rb
CHANGED
|
@@ -58,7 +58,7 @@ module HRMParser
|
|
|
58
58
|
data = File.read(filename)
|
|
59
59
|
importer = Importer::GPX.new(:data => data)
|
|
60
60
|
workout = importer.restore
|
|
61
|
-
workout.time.should == Time.parse("
|
|
61
|
+
workout.time.should == Time.parse("Thu May 07 21:32:31 UTC 2009")
|
|
62
62
|
|
|
63
63
|
# Duration is actualy less, but we don't account for stopped time right now
|
|
64
64
|
workout.duration.should be_close(6382,1)
|