fit_parser 1.0.5 → 1.0.6
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 -4
- data/lib/fit_parser/version.rb +1 -1
- data/spec/fit_parser_spec.rb +6 -0
- data/spec/support/examples/file/19205208205.fit +0 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 763aa538552a5710b53e2e07aa96e9e168312ba7
|
4
|
+
data.tar.gz: 718d76e9d9ff9d86b83aa88f6e784e062f93c4f6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1f69ea8b46cd2f4769904e4eac82c667b2d3e73eb8b323627f46c146a0eed7eaf0e39abe236f4e06fb9595209479e234b09b987d795e4778346821f3a15d675d
|
7
|
+
data.tar.gz: cb2d3b155de0e86f9ef5bd56044cec4a17afa741ed0ebd6a6053e26790d50964229721a77099ed812c0d7a0ffc7bde4a0bdbe66963944a4dfeda5f17ca534560
|
data/lib/fit_parser/file/data.rb
CHANGED
@@ -64,7 +64,7 @@ module FitParser
|
|
64
64
|
definition.dev_fields_arr.each do |field|
|
65
65
|
data = dev_definitions[field[:developer_data_index].to_s][field[:field_number].to_s]
|
66
66
|
field.base_type_number = data[:raw_field_2]
|
67
|
-
field.name = data[:raw_field_3].downcase.gsub(' ', '_').gsub('.', '')
|
67
|
+
field.name = data[:raw_field_3].downcase.gsub(' ', '_').gsub('.', '').gsub('%', '')
|
68
68
|
field.scale = data[:raw_field_6] && data[:raw_field_6] != 255 ? data[:raw_field_6] : nil
|
69
69
|
code = ''
|
70
70
|
|
@@ -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.gsub('/', '_').gsub('+', '')}"
|
76
|
+
code << "#{field.type} :#{field.raw_name.gsub('/', '_').gsub('+', '').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.gsub('/', '_').gsub('+', '')}\n"
|
83
|
+
code << "def #{field.name.gsub('/', '_').gsub('+', '').gsub('%', '')}\n"
|
84
84
|
|
85
85
|
if field.scale && field.scale != 1
|
86
86
|
scale = field.scale
|
@@ -100,7 +100,7 @@ module FitParser
|
|
100
100
|
end
|
101
101
|
|
102
102
|
code << <<-RUBY
|
103
|
-
get_value #{field.raw_name.gsub('/', '_')}.snapshot, '#{field.real_type}', scale, dyn
|
103
|
+
get_value #{field.raw_name.gsub('/', '_').gsub('%', '')}.snapshot, '#{field.real_type}', scale, dyn
|
104
104
|
end
|
105
105
|
RUBY
|
106
106
|
|
data/lib/fit_parser/version.rb
CHANGED
data/spec/fit_parser_spec.rb
CHANGED
@@ -127,4 +127,10 @@ describe FitParser do
|
|
127
127
|
data = FitParser.load_file(path)
|
128
128
|
expect(data.records).to_not be_nil
|
129
129
|
end
|
130
|
+
|
131
|
+
it 'works 19205208205.fit' do
|
132
|
+
path = 'spec/support/examples/file/19205208205.fit'
|
133
|
+
data = FitParser.load_file(path)
|
134
|
+
expect(data.records).to_not be_nil
|
135
|
+
end
|
130
136
|
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.6
|
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-
|
11
|
+
date: 2018-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bindata
|
@@ -172,6 +172,7 @@ files:
|
|
172
172
|
- spec/support/examples/6AUI5200.FIT
|
173
173
|
- spec/support/examples/file/16050359900.fit
|
174
174
|
- spec/support/examples/file/18119560227.fit
|
175
|
+
- spec/support/examples/file/19205208205.fit
|
175
176
|
- spec/support/examples/file/3110334490
|
176
177
|
- spec/support/examples/file/3863374146
|
177
178
|
- spec/support/examples/file/598363e9-3121-4f24-8b6f-b1368a269e8f.
|