tcxread 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/tcxread.rb +3 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 7b17178126aaf26d70869aa047a6054ca4128ac454c75b3fbd0903ce935222dc
4
- data.tar.gz: f27e41c68c87672a7acd2791b4a147c8a0bf09a2da1707a8722091a965508b89
3
+ metadata.gz: a0f94a5a07acd01e1c6b0419324bbef97912e0d7e67b3f2b1dc18d50336dd7e2
4
+ data.tar.gz: 776953d7610ffa6c6903449332eb1bf36ff2a7fb54c5fa10dde8e591ecefd3df
5
5
  SHA512:
6
- metadata.gz: 9281010f7900f5bf0a579c648690329e0f5680ecb9cc91e56733a2718ce15ac75cdfa15eabb4fc4f97b99d6cd26dfbbb53c627124775261fa1083797f9c1d4c1
7
- data.tar.gz: c61eee523a2b34730e40cddce7cd2eb58193bcb9585b84c0d08252f66cd8f4e90f49b6bf77dcbebdf13d8e96336fd5365787a3e670fda68b26cab214a540cd26
6
+ metadata.gz: dc1240984ccb04288e3790d69529eea52269f16888e1b6d8906017b42252ce98eeef44240b729ed1358444e2f0d3f7ce377f3a49123ea5c85c21493a2438cc77
7
+ data.tar.gz: 99863f90228c50f2590709105fab6d55395c26462bec7b2ba2b11c429f2e85453867583fdcb964d83599f669bbc1dc991fa6ca8a0c5eff6aba8a3681007d1b48
data/lib/tcxread.rb CHANGED
@@ -109,7 +109,8 @@ class TCXRead
109
109
  heart_rate: trackpoint.xpath('xmlns:HeartRateBpm/xmlns:Value').text.to_i,
110
110
  cadence: trackpoint.xpath('xmlns:Cadence').text.to_i,
111
111
  sensor_state: trackpoint.xpath('xmlns:SensorState').text,
112
- watts: trackpoint.xpath('xmlns:Extensions/ns3:TPX/ns3:Watts').text.to_f
112
+ watts: trackpoint.xpath('xmlns:Extensions/ns3:TPX/ns3:Watts').text.to_f,
113
+ speed: trackpoint.xpath('xmlns:Extensions/ns3:TPX/ns3:Speed').text.to_f
113
114
  }
114
115
  end
115
116
  tracks << trackpoints
@@ -276,9 +277,7 @@ class TCXRead
276
277
  activities.each do |activity|
277
278
  activity[:laps].each do |lap|
278
279
  lap[:tracks].flatten.each do |trackpoint|
279
- distance = trackpoint[:distance_meters]
280
- time_seconds = lap[:total_time_seconds]
281
- speed = distance / time_seconds if time_seconds > 0
280
+ speed = trackpoint[:speed]
282
281
 
283
282
  if speed
284
283
  total_speed_all += speed
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tcxread
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - firefly-cpp
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-08-17 00:00:00.000000000 Z
11
+ date: 2024-08-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: nokogiri