fit_parser 1.0.8 → 1.0.9

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2431365ee2ab9ab2e8f53d2b128761fca850eb25
4
- data.tar.gz: 7aa974c7955ace6587130b244ff67c6704b8c47b
2
+ SHA256:
3
+ metadata.gz: 17f6f10d0f1eac15b399041a0d59f6eca99fb6d276435c4c0f98ad8e2bbb6190
4
+ data.tar.gz: 176655ba11d443e33b33e9c04739d8bc93c9a580259c0a46fb8f7aaf3c30a30d
5
5
  SHA512:
6
- metadata.gz: 79123d4ddd3a2f92b8a21bbe34d4d53101b868d6fc5201c4e42f154d36b54a05d29daba27afe262141a065932fe8987d815f0defe632b9dd693225d5ce815dd5
7
- data.tar.gz: 027eed9d8886cc3a88f1d7541041f4d3a4e940b368705ad950e117b120595afa76875520403ab07464646d427dbd8ec719f07ebc4be13679237ca0cd0a8adbae
6
+ metadata.gz: 81b3e8cbc9e9fd58340b5f193419fbbfde45f06bddb72d788e7279f311136d3a143be015162a23e54a69858c81e4be95b1965d9adf6c655b23ec63722a67a19d
7
+ data.tar.gz: 1d947f7fd22a8019a4d7d4876a9f1c699a0269a6facb95ce6f62507397c1d3cb8e3aef568543b7f2c62d21b2208df4b5c387872871058428d09c25e799bffd43
@@ -22,13 +22,14 @@ module FitParser
22
22
 
23
23
  definition.fields_arr.each do |field|
24
24
  code = ''
25
+ field_raw_name_sanitized = field.raw_name.gsub('/', '_').gsub('+', '').gsub('%', '').gsub('-', '')
25
26
 
26
27
  # in case the field size is a multiple of the field length, we must build an array
27
28
  if field.type != 'string' && field.size > field.length
28
- code << "array :#{field.raw_name}, :type => :#{field.type}, :initial_length => #{field.size/field.length}\n"
29
+ code << "array :#{field_raw_name_sanitized}, :type => :#{field.type}, :initial_length => #{field.size/field.length}\n"
29
30
  else
30
31
  # string are not null terminated when they have exactly the lenght of the field
31
- code << "#{field.type} :#{field.raw_name}"
32
+ code << "#{field.type} :#{field_raw_name_sanitized}"
32
33
  if field.type == 'string'
33
34
  code << ", :read_length => #{field.size}, :trim_padding => true"
34
35
  end
@@ -54,7 +55,7 @@ module FitParser
54
55
  code << "dyn = nil\n"
55
56
  end
56
57
  code << <<-RUBY
57
- get_value #{field.raw_name}.snapshot, '#{field.real_type}', scale, dyn
58
+ get_value #{field_raw_name_sanitized}.snapshot, '#{field.real_type}', scale, dyn
58
59
  end
59
60
  RUBY
60
61
 
@@ -70,13 +71,14 @@ module FitParser
70
71
  field.name = data[:raw_field_3].downcase.gsub(' ', '_').gsub('.', '').gsub('%', '')
71
72
  field.scale = data[:raw_field_6] && data[:raw_field_6] != 255 ? data[:raw_field_6] : nil
72
73
  code = ''
74
+ field_raw_name_sanitized = field.raw_name.gsub('/', '_').gsub('+', '').gsub('%', '').gsub('-', '')
73
75
 
74
76
  # in case the field size is a multiple of the field length, we must build an array
75
77
  if field.type != 'string' && field.field_size > field.length
76
- code << "array :#{field.raw_name}, :type => :#{field.type}, :initial_length => #{field.field_size/field.length}\n"
78
+ code << "array :#{field_raw_name_sanitized}, :type => :#{field.type}, :initial_length => #{field.field_size/field.length}\n"
77
79
  else
78
80
  # string are not null terminated when they have exactly the lenght of the field
79
- code << "#{field.type} :#{field.raw_name.gsub('/', '_').gsub('+', '').gsub('%', '')}"
81
+ code << "#{field.type} :#{field_raw_name_sanitized}"
80
82
  if field.type == 'string'
81
83
  code << ", :read_length => #{field.field_size}, :trim_padding => true"
82
84
  end
@@ -103,7 +105,7 @@ module FitParser
103
105
  end
104
106
 
105
107
  code << <<-RUBY
106
- get_value #{field.raw_name}.snapshot, '#{field.real_type}', scale, dyn
108
+ get_value #{field_raw_name_sanitized}.snapshot, '#{field.real_type}', scale, dyn
107
109
  end
108
110
  RUBY
109
111
 
@@ -1,3 +1,3 @@
1
1
  module FitParser
2
- VERSION = '1.0.8'
2
+ VERSION = '1.0.9'
3
3
  end
@@ -73,7 +73,7 @@ describe FitParser do
73
73
  end
74
74
 
75
75
  it 'works 6AUI5200.FIT' do
76
- path = 'spec/support/examples/6AUI5200.fit'
76
+ path = 'spec/support/examples/6AUI5200.FIT'
77
77
  data = FitParser.load_file(path)
78
78
  expect(data.records).to_not be_nil
79
79
  end
@@ -104,6 +104,19 @@ describe FitParser do
104
104
  expect(data.records).to_not be_nil
105
105
  end
106
106
 
107
+ it 'works 31675356730' do
108
+ path = 'spec/support/examples/file/31675356730'
109
+ data = FitParser.load_file(path)
110
+ expect(data.records).to_not be_nil
111
+ end
112
+
113
+ it 'works for suunto' do
114
+ Dir.glob('spec/support/examples/suunto-app/*.fit').each do |f|
115
+ data = FitParser.load_file(f)
116
+ expect(data.records).to_not be_nil
117
+ end
118
+ end
119
+
107
120
  it 'works 7420309810' do
108
121
  path = 'spec/support/examples/file/7420309810'
109
122
  data = FitParser.load_file(path)
@@ -0,0 +1,114 @@
1
+ ----------------------------------------------------------
2
+ 1
3
+ ----------------------------------------------------------
4
+ 5bd6eb3252ce7b074fc4fa82
5
+
6
+ 16.10.2018
7
+ SUUNTO 9 BARO
8
+ RUNNING
9
+ FINLAND
10
+ HR, GPS, CADENCE, ALTITUDE
11
+ INTERVALS
12
+
13
+ ----------------------------------------------------------
14
+ 2
15
+ ----------------------------------------------------------
16
+ 5bd6ea7052ce7b074fc4f975
17
+
18
+ 30.6.2018
19
+ SUUNTO SPARTAN SPORT
20
+ TRIATHLON
21
+ FINLAND
22
+ GPS,HR, ALTITUDE, CADENCE
23
+ INTERVALS, AUTOLAPS, ACTIVITY CHANGE
24
+
25
+ ----------------------------------------------------------
26
+ 3
27
+ ----------------------------------------------------------
28
+ 5bd6ea9252ce7b074fc4f9be
29
+
30
+ 14.7.2018
31
+ SUUNTO SPARTAN SPORT
32
+ CYCLING
33
+ TALLIN
34
+ GPS, POWER,CADENCE ETC.
35
+ AUTOLAPS, PAUSE
36
+
37
+ ----------------------------------------------------------
38
+ 4
39
+ ----------------------------------------------------------
40
+ 5bd6e91752ce7b074fc4f8d1
41
+
42
+ 2.4.2017
43
+ SUUNTO SPARTAN SPORT WHR
44
+ RUNNING
45
+ SOUTH AFRICA
46
+ AUTOLAPS
47
+ HEART RATE, SPEED, GPS
48
+
49
+ ----------------------------------------------------------
50
+ 5
51
+ ----------------------------------------------------------
52
+ 5bd6eaaf52ce7b074fc4f9ed
53
+
54
+ 10.8.2018
55
+ SUUNTO 9 BARO
56
+ OPENWATER SWIM
57
+ GPS, PACE, STROKERATE ETC
58
+
59
+ ----------------------------------------------------------
60
+ 6
61
+ ----------------------------------------------------------
62
+ 5bd6ead352ce7b074fc4fa0d
63
+
64
+ 1.9.2018
65
+ SUUNTO 9 BARO
66
+ WEIGHT TRAINING
67
+ HEART RATE, ALTITUDE, TEMPERATURE
68
+
69
+ ----------------------------------------------------------
70
+ 7
71
+ ----------------------------------------------------------
72
+ 5bd6ea2552ce7b074fc4f931
73
+
74
+ 20.10.2017
75
+ SUUNTO SPARTAN SPORT
76
+ SWIMMING
77
+ POOL LENGHTS, SWIM INTERVALS
78
+ POOL SWIMMING
79
+ NO LOCATION
80
+
81
+ ----------------------------------------------------------
82
+ 8
83
+ ----------------------------------------------------------
84
+ 5bd6ea4752ce7b074fc4f951
85
+
86
+ 22.10.2017
87
+ SUUNTO SPARTAN SPORT
88
+ RUNNING
89
+ FLORIDA
90
+ GPS, HR, SPEED, ALTITUDE, CADENCE
91
+ LAPS, AUTOLAPS, PAUSE
92
+
93
+ ----------------------------------------------------------
94
+ 9
95
+ ----------------------------------------------------------
96
+ 5bd6eb1952ce7b074fc4fa56
97
+
98
+ 13.10.2018
99
+ POOL SWIM
100
+ SUUNTO 9 BARO
101
+ POOL LENGTHS, INTERVALS
102
+ HR, SWIM PACE, SWOLF
103
+ NO LOCATION
104
+
105
+ ----------------------------------------------------------
106
+ 10
107
+ ---------------------------------------------------------
108
+ 5bd6eaff52ce7b074fc4fa28
109
+
110
+ 12.10.2018
111
+ RUNNING
112
+ SUUNTO 9 BARO
113
+ GPS,HR, ALTITUDE,SPEED, TEMPERATURE ETC.
114
+ INTERVALS
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fit_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.8
4
+ version: 1.0.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dima Mescheryakov
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-08-29 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bindata
@@ -176,6 +176,7 @@ files:
176
176
  - spec/support/examples/file/23489915119.fit
177
177
  - spec/support/examples/file/24093026216.fit
178
178
  - spec/support/examples/file/3110334490
179
+ - spec/support/examples/file/31675356730
179
180
  - spec/support/examples/file/3863374146
180
181
  - spec/support/examples/file/598363e9-3121-4f24-8b6f-b1368a269e8f.
181
182
  - spec/support/examples/file/7348726805
@@ -203,6 +204,17 @@ files:
203
204
  - spec/support/examples/record/message/definition_field_array.fit
204
205
  - spec/support/examples/record/message/definition_file_capabilities.fit
205
206
  - spec/support/examples/record/normal_header
207
+ - spec/support/examples/suunto-app/5bd6e91752ce7b074fc4f8d1.fit
208
+ - spec/support/examples/suunto-app/5bd6ea2552ce7b074fc4f931.fit
209
+ - spec/support/examples/suunto-app/5bd6ea4752ce7b074fc4f951.fit
210
+ - spec/support/examples/suunto-app/5bd6ea7052ce7b074fc4f975.fit
211
+ - spec/support/examples/suunto-app/5bd6ea9252ce7b074fc4f9be.fit
212
+ - spec/support/examples/suunto-app/5bd6eaaf52ce7b074fc4f9ed.fit
213
+ - spec/support/examples/suunto-app/5bd6ead352ce7b074fc4fa0d.fit
214
+ - spec/support/examples/suunto-app/5bd6eaff52ce7b074fc4fa28.fit
215
+ - spec/support/examples/suunto-app/5bd6eb1952ce7b074fc4fa56.fit
216
+ - spec/support/examples/suunto-app/5bd6eb3252ce7b074fc4fa82.fit
217
+ - spec/support/examples/suunto-app/FIT file information.txt
206
218
  homepage: https://github.com/zhublik/fit_parser
207
219
  licenses:
208
220
  - MIT
@@ -222,8 +234,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
222
234
  - !ruby/object:Gem::Version
223
235
  version: '0'
224
236
  requirements: []
225
- rubyforge_project:
226
- rubygems_version: 2.6.11
237
+ rubygems_version: 3.0.3
227
238
  signing_key:
228
239
  specification_version: 4
229
240
  summary: ''