fit4ruby 3.6.0 → 3.7.0

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: a6c0eeaa643f6448d85589f5dd3eba27f05b5b98c9612df717c6105941d37c04
4
- data.tar.gz: af7fb428ac6490e2e0ffa239d3f6135e7a66362e35a630f1b83020fed43a9a50
3
+ metadata.gz: 1867e2f6e32d331216b372024ba0607837bb5dc3baf7daad107b5a23d6465aa6
4
+ data.tar.gz: 25f0423ccf5e68259f48d02f35400fa2a723a9f7209613f77eca2631d056f2d0
5
5
  SHA512:
6
- metadata.gz: 251d1d4bf916e08744f3609bf4ee9eec766094b937dc9094fe2f1215d7971ad4a7ae94b2d047370d62d79bf8e9b3e250cb54fb08da036e0444ef37685cbe7736
7
- data.tar.gz: 9c61be05a87a745b3509458ac56f4798c1afb1065d9f1d9808d7fd2e860a400b224e901a57f97263912d15b9199b5f14e9a9c7fab9ee7737f1872ed6dd78f6f5
6
+ metadata.gz: 05641db1523d5e8a9b8ab939d4b65def4e5a50ca6bbcae3fb1c727dc7d641cfeda6d7a5e892b38819b840b0a2222e0d775d20bf4f93ae4af6db2c79b4b6753b3
7
+ data.tar.gz: f4b7d619de81444329009c7a188f08bd4684524ecc1654a57b77df147a0e22730658d57247e30729f619a0ab2c6fbd6fce796908df05ff2d409a06a909656298
@@ -33,22 +33,40 @@ module Fit4Ruby
33
33
  end
34
34
 
35
35
  def numeric_manufacturer
36
- if @manufacturer.is_a?(String)
37
- GlobalFitDictionaries['manufacturer'].value_by_name(@manufacturer)
38
- else
39
- @manufacturer
36
+ if @manufacturer && @manufacturer.is_a?(String)
37
+ if @manufacturer[0..17] == 'Undocumented value'
38
+ return @manufacturer[18..-1].to_i
39
+ else
40
+ return GlobalFitDictionaries['manufacturer'].
41
+ value_by_name(@manufacturer)
42
+ end
40
43
  end
44
+
45
+ Log.fatal "Unexpected @manufacturer (#{@manufacturer}) value"
41
46
  end
42
47
 
43
48
  def numeric_product
49
+ # The numeric product ID must be an integer or nil. In case the
50
+ # dictionary did not contain an entry for the numeric ID in the fit file
51
+ # the @garmin_product or @product variables contain a String starting
52
+ # with 'Undocumented value ' followed by the ID.
44
53
  if @garmin_product && @garmin_product.is_a?(String)
45
- return GlobalFitDictionaries['garmin_product'].
46
- value_by_name(@garmin_product)
47
- elsif @product.is_a?(String)
48
- return GlobalFitDictionaries['product'].value_by_name(@product)
49
- else
50
- return @product
54
+ if @garmin_product[0..17] == 'Undocumented value'
55
+ return @garmin_product[18..-1].to_i
56
+ else
57
+ return GlobalFitDictionaries['garmin_product'].
58
+ value_by_name(@garmin_product)
59
+ end
60
+ elsif @product && @product.is_a?(String)
61
+ if @product[0..17] == 'Undocumented value'
62
+ return @product[18..-1].to_i
63
+ else
64
+ return GlobalFitDictionaries['product'].value_by_name(@product)
65
+ end
51
66
  end
67
+
68
+ Log.fatal "Unexpected @product (#{@product}) or " +
69
+ "@garmin_product (#{@garmin_product}) values"
52
70
  end
53
71
 
54
72
  def check(index)
@@ -50,8 +50,8 @@ module Fit4Ruby
50
50
  def set(name, value)
51
51
  ivar_name = '@' + name
52
52
  unless instance_variable_defined?(ivar_name)
53
- Log.warn("Unknown FIT record field '#{name}' in global message " +
54
- "#{@message.name} (#{@message.number}).")
53
+ Log.debug("Unknown FIT record field '#{name}' in global message " +
54
+ "#{@message.name} (#{@message.number}).")
55
55
  return
56
56
  end
57
57
  instance_variable_set(ivar_name, value)
@@ -1,4 +1,4 @@
1
1
  module Fit4Ruby
2
2
  # The version number of the library.
3
- VERSION = '3.6.0'
3
+ VERSION = '3.7.0'
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fit4ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.6.0
4
+ version: 3.7.0
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-07-26 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata