fit_parser 1.0.2 → 1.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/fit_parser/file/data.rb +4 -3
- data/lib/fit_parser/version.rb +1 -1
- data/spec/fit_parser_spec.rb +6 -0
- data/spec/support/examples/file/16050359900.fit +0 -0
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4e4819fd3bb8005892624c8c2f10bc7959d5288
|
4
|
+
data.tar.gz: da1a0d45c960d7f6c798ce8658c165963480c257
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8279e0a004871aaa87854315ee46fc844fc4d1c999954fa3887018fa148bd33bfee1fb1b25218b2ebdbe35e33e7f4caf0072c5323581b2e0b884eae8437c82f6
|
7
|
+
data.tar.gz: 7d40e4fb71a1e4990d393eda08ff9e6779d7413d16a5a6e563c3a907b974939c58d2fc55e1301e8d0552955b3df032775eab921e7aa3df599395773a8100d607
|
data/lib/fit_parser/file/data.rb
CHANGED
@@ -73,14 +73,14 @@ module FitParser
|
|
73
73
|
code << "array :#{field.raw_name}, :type => :#{field.type}, :initial_length => #{field.field_size/field.length}\n"
|
74
74
|
else
|
75
75
|
# string are not null terminated when they have exactly the lenght of the field
|
76
|
-
code << "#{field.type} :#{field.raw_name}"
|
76
|
+
code << "#{field.type} :#{field.raw_name.gsub('/', '_')}"
|
77
77
|
if field.type == 'string'
|
78
78
|
code << ", :read_length => #{field.field_size}, :trim_padding => true"
|
79
79
|
end
|
80
80
|
code << "\n"
|
81
81
|
end
|
82
82
|
|
83
|
-
code << "def #{field.name}\n"
|
83
|
+
code << "def #{field.name.gsub('/', '_')}\n"
|
84
84
|
|
85
85
|
if field.scale && field.scale != 1
|
86
86
|
scale = field.scale
|
@@ -98,8 +98,9 @@ module FitParser
|
|
98
98
|
else
|
99
99
|
code << "dyn = nil\n"
|
100
100
|
end
|
101
|
+
|
101
102
|
code << <<-RUBY
|
102
|
-
get_value #{field.raw_name}.snapshot, '#{field.real_type}', scale, dyn
|
103
|
+
get_value #{field.raw_name.gsub('/', '_')}.snapshot, '#{field.real_type}', scale, dyn
|
103
104
|
end
|
104
105
|
RUBY
|
105
106
|
|
data/lib/fit_parser/version.rb
CHANGED
data/spec/fit_parser_spec.rb
CHANGED
@@ -115,4 +115,10 @@ describe FitParser do
|
|
115
115
|
data = FitParser.load_file(path)
|
116
116
|
expect(data.records).to_not be_nil
|
117
117
|
end
|
118
|
+
|
119
|
+
it 'works 16050359900.fit' do
|
120
|
+
path = 'spec/support/examples/file/16050359900.fit'
|
121
|
+
data = FitParser.load_file(path)
|
122
|
+
expect(data.records).to_not be_nil
|
123
|
+
end
|
118
124
|
end
|
Binary file
|
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.
|
4
|
+
version: 1.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Dima Mescheryakov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-12-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -170,6 +170,7 @@ files:
|
|
170
170
|
- spec/support/examples/1379311720.fit
|
171
171
|
- spec/support/examples/1426768070-2.fit
|
172
172
|
- spec/support/examples/6AUI5200.FIT
|
173
|
+
- spec/support/examples/file/16050359900.fit
|
173
174
|
- spec/support/examples/file/3110334490
|
174
175
|
- spec/support/examples/file/3863374146
|
175
176
|
- spec/support/examples/file/598363e9-3121-4f24-8b6f-b1368a269e8f.
|
@@ -218,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
218
219
|
version: '0'
|
219
220
|
requirements: []
|
220
221
|
rubyforge_project:
|
221
|
-
rubygems_version: 2.
|
222
|
+
rubygems_version: 2.6.11
|
222
223
|
signing_key:
|
223
224
|
specification_version: 4
|
224
225
|
summary: ''
|