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 +4 -4
- data/lib/fit4ruby/DeviceInfo.rb +28 -10
- data/lib/fit4ruby/FitDataRecord.rb +2 -2
- data/lib/fit4ruby/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1867e2f6e32d331216b372024ba0607837bb5dc3baf7daad107b5a23d6465aa6
|
4
|
+
data.tar.gz: 25f0423ccf5e68259f48d02f35400fa2a723a9f7209613f77eca2631d056f2d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 05641db1523d5e8a9b8ab939d4b65def4e5a50ca6bbcae3fb1c727dc7d641cfeda6d7a5e892b38819b840b0a2222e0d775d20bf4f93ae4af6db2c79b4b6753b3
|
7
|
+
data.tar.gz: f4b7d619de81444329009c7a188f08bd4684524ecc1654a57b77df147a0e22730658d57247e30729f619a0ab2c6fbd6fce796908df05ff2d409a06a909656298
|
data/lib/fit4ruby/DeviceInfo.rb
CHANGED
@@ -33,22 +33,40 @@ module Fit4Ruby
|
|
33
33
|
end
|
34
34
|
|
35
35
|
def numeric_manufacturer
|
36
|
-
if @manufacturer.is_a?(String)
|
37
|
-
|
38
|
-
|
39
|
-
|
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
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
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.
|
54
|
-
|
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)
|
data/lib/fit4ruby/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|