postrunner 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a3556713751664059a4127db7acc897c02def6807bb6a6e8ca6fdf3518c8cea7
4
- data.tar.gz: 6a2f8b002487a379afa8c46cc58b0cc109fcd950f8abf740e79dffb004d7e865
3
+ metadata.gz: ee79192eef591186d2dcbf992af1d193a60aee49b9ae9d90d6a880d4758c623c
4
+ data.tar.gz: 7fefaf239fe43c71be7183b7773f909415126669f514e608b6c6f16fef9682f3
5
5
  SHA512:
6
- metadata.gz: d3b69049465aa888afd5ca4191ab5b75b1235db7b0cd3e4de3171519dfa6c63c98a5d2300bc45e3592a531c205a91fd3a028b1bedbc4c29b716fc9d6265a8402
7
- data.tar.gz: 01bce18ad81578364eb7c4087fcce790e5025dc6c6d7f336c62001f99327944910991fcfd83493e1c238f16a90385a0e79c5cb95b750b9a883f5acab2091ff77
6
+ metadata.gz: 65900650e3e1751f4f92994f4473c18d0131615ff60f72c1683ee7ed05c40abd6d060ba6eca2cfa4134c7507effb90edc4785901e5a8d006c0ed05fa64b6d23d
7
+ data.tar.gz: 5de44344671bf391611e2636e4cebd0fc6e7a5f5636444ca2fc828c1d699e17086dfe7ea1a80aa89a0a593b279ca17fe0f5c26583af7fa21763ab7130f7f73ba
@@ -144,7 +144,9 @@ module PostRunner
144
144
 
145
145
  # Generate a String that uniquely identifies the device that generated
146
146
  # the FIT file.
147
- id = extract_fit_file_id(fit_entity)
147
+ unless (id = extract_fit_file_id(fit_entity))
148
+ return nil
149
+ end
148
150
  long_uid = "#{id[:numeric_manufacturer]}-" +
149
151
  "#{id[:numeric_product]}-#{id[:serial_number]}"
150
152
 
@@ -503,7 +505,12 @@ module PostRunner
503
505
  end
504
506
 
505
507
  fit_entity.device_infos.each do |di|
506
- if di.device_index == 0
508
+ # Not all FIT file have indexed device sections. In case the device
509
+ # index is nil we'll take the first entry.
510
+ if (di.device_index.nil? || di.device_index == 0) &&
511
+ (di.manufacturer &&
512
+ (di.garmin_product || di.product) &&
513
+ di.numeric_product && di.serial_number)
507
514
  return {
508
515
  :manufacturer => di.manufacturer,
509
516
  :product => di.garmin_product || di.product,
@@ -514,7 +521,7 @@ module PostRunner
514
521
  end
515
522
  end
516
523
 
517
- Log.error "Fit entity has no device info for 0"
524
+ Log.error "Fit entity has no device info section"
518
525
  return nil
519
526
  end
520
527
 
@@ -11,5 +11,5 @@
11
11
  #
12
12
 
13
13
  module PostRunner
14
- VERSION = '1.0.1'
14
+ VERSION = '1.0.2'
15
15
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postrunner
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Chris Schlaeger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-17 00:00:00.000000000 Z
11
+ date: 2020-08-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fit4ruby