ski_binding_calculator 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- data/config/binding_codes.yml +4 -2
- data/config/binding_settings.yml +273 -270
- data/lib/{calculator → ski_binding_calculator}/calculator.rb +6 -4
- data/lib/{calculator → ski_binding_calculator}/code.rb +0 -0
- data/lib/{calculator → ski_binding_calculator}/config_loader.rb +0 -0
- data/lib/{person.rb → ski_binding_calculator/person.rb} +0 -0
- data/lib/ski_binding_calculator/setting.rb +3 -0
- data/lib/{ski_binding.rb → ski_binding_calculator/ski_binding.rb} +0 -0
- data/lib/ski_binding_calculator.rb +6 -6
- data/ski_binding_calculator.gemspec +3 -3
- data/spec/{calculator_spec.rb → lib/calculator_spec.rb} +25 -26
- data/spec/{code_spec.rb → lib/code_spec.rb} +1 -1
- data/spec/{config_loader_spec.rb → lib/config_loader_spec.rb} +1 -1
- data/spec/{person_spec.rb → lib/person_spec.rb} +14 -3
- data/spec/{setting_spec.rb → lib/setting_spec.rb} +7 -7
- data/spec/spec_helper.rb +1 -1
- metadata +14 -14
- data/lib/calculator/setting.rb +0 -3
data/config/binding_codes.yml
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
#weight [kg]
|
2
|
+
#height [cm]
|
1
3
|
- !ruby/object:SkiBinding::Code
|
2
4
|
weight: !ruby/range 10..13
|
3
5
|
height: !ruby/range 1..148
|
@@ -36,8 +38,8 @@
|
|
36
38
|
height: !ruby/range 179..194
|
37
39
|
- !ruby/object:SkiBinding::Code
|
38
40
|
weight: !ruby/range
|
39
|
-
begin:
|
41
|
+
begin: 95
|
40
42
|
end: .inf
|
41
43
|
height: !ruby/range
|
42
|
-
begin:
|
44
|
+
begin: 195
|
43
45
|
end: .inf
|
data/config/binding_settings.yml
CHANGED
@@ -1,485 +1,488 @@
|
|
1
|
+
# shoe_size_range [mm]
|
2
|
+
# twist [Nm]
|
3
|
+
# forward_lean [Nm]
|
1
4
|
-
|
2
5
|
- !ruby/object:SkiBinding::Setting
|
3
|
-
|
6
|
+
shoe_size_range: !ruby/range 1..250
|
4
7
|
z_value: 0.75
|
5
|
-
|
6
|
-
|
8
|
+
twist: &turning_moment 8
|
9
|
+
forward_lean: &forward_lean 29
|
7
10
|
- !ruby/object:SkiBinding::Setting
|
8
|
-
|
11
|
+
shoe_size_range: !ruby/range 251..270
|
9
12
|
z_value: 0.75
|
10
|
-
|
11
|
-
|
13
|
+
twist: *turning_moment
|
14
|
+
forward_lean: *forward_lean
|
12
15
|
- !ruby/object:SkiBinding::Setting
|
13
|
-
|
16
|
+
shoe_size_range: ~
|
14
17
|
z_value: ~
|
15
|
-
|
16
|
-
|
18
|
+
twist: ~
|
19
|
+
forward_lean: ~
|
17
20
|
- !ruby/object:SkiBinding::Setting
|
18
|
-
|
21
|
+
shoe_size_range: ~
|
19
22
|
z_value: ~
|
20
|
-
|
21
|
-
|
23
|
+
twist: ~
|
24
|
+
forward_lean: ~
|
22
25
|
- !ruby/object:SkiBinding::Setting
|
23
|
-
|
26
|
+
shoe_size_range: ~
|
24
27
|
z_value: ~
|
25
|
-
|
26
|
-
|
28
|
+
twist: ~
|
29
|
+
forward_lean: ~
|
27
30
|
- !ruby/object:SkiBinding::Setting
|
28
|
-
|
31
|
+
shoe_size_range: ~
|
29
32
|
z_value: ~
|
30
|
-
|
31
|
-
|
33
|
+
twist: ~
|
34
|
+
forward_lean: ~
|
32
35
|
-
|
33
36
|
- !ruby/object:SkiBinding::Setting
|
34
|
-
|
37
|
+
shoe_size_range: !ruby/range 1..250
|
35
38
|
z_value: 1
|
36
|
-
|
37
|
-
|
39
|
+
twist: &turning_moment 11
|
40
|
+
forward_lean: &forward_lean 40
|
38
41
|
- !ruby/object:SkiBinding::Setting
|
39
|
-
|
42
|
+
shoe_size_range: !ruby/range 251..270
|
40
43
|
z_value: 1
|
41
|
-
|
42
|
-
|
44
|
+
twist: *turning_moment
|
45
|
+
forward_lean: *forward_lean
|
43
46
|
- !ruby/object:SkiBinding::Setting
|
44
|
-
|
47
|
+
shoe_size_range: !ruby/range 271..290
|
45
48
|
z_value: 0.75
|
46
|
-
|
47
|
-
|
49
|
+
twist: *turning_moment
|
50
|
+
forward_lean: *forward_lean
|
48
51
|
- !ruby/object:SkiBinding::Setting
|
49
|
-
|
52
|
+
shoe_size_range: ~
|
50
53
|
z_value: ~
|
51
|
-
|
52
|
-
|
54
|
+
twist: ~
|
55
|
+
forward_lean: ~
|
53
56
|
- !ruby/object:SkiBinding::Setting
|
54
|
-
|
57
|
+
shoe_size_range: ~
|
55
58
|
z_value: ~
|
56
|
-
|
57
|
-
|
59
|
+
twist: ~
|
60
|
+
forward_lean: ~
|
58
61
|
- !ruby/object:SkiBinding::Setting
|
59
|
-
|
62
|
+
shoe_size_range: ~
|
60
63
|
z_value: ~
|
61
|
-
|
62
|
-
|
64
|
+
twist: ~
|
65
|
+
forward_lean: ~
|
63
66
|
-
|
64
67
|
- !ruby/object:SkiBinding::Setting
|
65
|
-
|
68
|
+
shoe_size_range: !ruby/range 1..250
|
66
69
|
z_value: 1.5
|
67
|
-
|
68
|
-
|
70
|
+
twist: &turning_moment 14
|
71
|
+
forward_lean: &forward_lean 52
|
69
72
|
- !ruby/object:SkiBinding::Setting
|
70
|
-
|
73
|
+
shoe_size_range: !ruby/range 251..270
|
71
74
|
z_value: 1.25
|
72
|
-
|
73
|
-
|
75
|
+
twist: *turning_moment
|
76
|
+
forward_lean: *forward_lean
|
74
77
|
- !ruby/object:SkiBinding::Setting
|
75
|
-
|
78
|
+
shoe_size_range: !ruby/range 271..290
|
76
79
|
z_value: 1
|
77
|
-
|
78
|
-
|
80
|
+
twist: *turning_moment
|
81
|
+
forward_lean: *forward_lean
|
79
82
|
- !ruby/object:SkiBinding::Setting
|
80
|
-
|
83
|
+
shoe_size_range: ~
|
81
84
|
z_value: ~
|
82
|
-
|
83
|
-
|
85
|
+
twist: ~
|
86
|
+
forward_lean: ~
|
84
87
|
- !ruby/object:SkiBinding::Setting
|
85
|
-
|
88
|
+
shoe_size_range: ~
|
86
89
|
z_value: ~
|
87
|
-
|
88
|
-
|
90
|
+
twist: ~
|
91
|
+
forward_lean: ~
|
89
92
|
- !ruby/object:SkiBinding::Setting
|
90
|
-
|
93
|
+
shoe_size_range: ~
|
91
94
|
z_value: ~
|
92
|
-
|
93
|
-
|
95
|
+
twist: ~
|
96
|
+
forward_lean: ~
|
94
97
|
-
|
95
98
|
- !ruby/object:SkiBinding::Setting
|
96
|
-
|
99
|
+
shoe_size_range: !ruby/range 1..250
|
97
100
|
z_value: 1.75
|
98
|
-
|
99
|
-
|
101
|
+
twist: &turning_moment 17
|
102
|
+
forward_lean: &forward_lean 64
|
100
103
|
- !ruby/object:SkiBinding::Setting
|
101
|
-
|
104
|
+
shoe_size_range: !ruby/range 251..270
|
102
105
|
z_value: 1.5
|
103
|
-
|
104
|
-
|
106
|
+
twist: *turning_moment
|
107
|
+
forward_lean: *forward_lean
|
105
108
|
- !ruby/object:SkiBinding::Setting
|
106
|
-
|
109
|
+
shoe_size_range: !ruby/range 271..290
|
107
110
|
z_value: 1.5
|
108
|
-
|
109
|
-
|
111
|
+
twist: *turning_moment
|
112
|
+
forward_lean: *forward_lean
|
110
113
|
- !ruby/object:SkiBinding::Setting
|
111
|
-
|
114
|
+
shoe_size_range: !ruby/range 291..310
|
112
115
|
z_value: 1.25
|
113
|
-
|
114
|
-
|
116
|
+
twist: *turning_moment
|
117
|
+
forward_lean: *forward_lean
|
115
118
|
- !ruby/object:SkiBinding::Setting
|
116
|
-
|
119
|
+
shoe_size_range: ~
|
117
120
|
z_value: ~
|
118
|
-
|
119
|
-
|
121
|
+
twist: ~
|
122
|
+
forward_lean: ~
|
120
123
|
- !ruby/object:SkiBinding::Setting
|
121
|
-
|
124
|
+
shoe_size_range: ~
|
122
125
|
z_value: ~
|
123
|
-
|
124
|
-
|
126
|
+
twist: ~
|
127
|
+
forward_lean: ~
|
125
128
|
-
|
126
129
|
- !ruby/object:SkiBinding::Setting
|
127
|
-
|
130
|
+
shoe_size_range: !ruby/range 1..250
|
128
131
|
z_value: 2.25
|
129
|
-
|
130
|
-
|
132
|
+
twist: &turning_moment 20
|
133
|
+
forward_lean: &forward_lean 75
|
131
134
|
- !ruby/object:SkiBinding::Setting
|
132
|
-
|
135
|
+
shoe_size_range: !ruby/range 251..270
|
133
136
|
z_value: 2
|
134
|
-
|
135
|
-
|
137
|
+
twist: *turning_moment
|
138
|
+
forward_lean: *forward_lean
|
136
139
|
- !ruby/object:SkiBinding::Setting
|
137
|
-
|
140
|
+
shoe_size_range: !ruby/range 271..290
|
138
141
|
z_value: 1.75
|
139
|
-
|
140
|
-
|
142
|
+
twist: *turning_moment
|
143
|
+
forward_lean: *forward_lean
|
141
144
|
- !ruby/object:SkiBinding::Setting
|
142
|
-
|
145
|
+
shoe_size_range: !ruby/range 291..310
|
143
146
|
z_value: 1.5
|
144
|
-
|
145
|
-
|
147
|
+
twist: *turning_moment
|
148
|
+
forward_lean: *forward_lean
|
146
149
|
- !ruby/object:SkiBinding::Setting
|
147
|
-
|
150
|
+
shoe_size_range: !ruby/range 311..330
|
148
151
|
z_value: 1.5
|
149
|
-
|
150
|
-
|
152
|
+
twist: *turning_moment
|
153
|
+
forward_lean: *forward_lean
|
151
154
|
- !ruby/object:SkiBinding::Setting
|
152
|
-
|
155
|
+
shoe_size_range: ~
|
153
156
|
z_value: ~
|
154
|
-
|
155
|
-
|
157
|
+
twist: ~
|
158
|
+
forward_lean: ~
|
156
159
|
-
|
157
160
|
- !ruby/object:SkiBinding::Setting
|
158
|
-
|
161
|
+
shoe_size_range: !ruby/range 1..250
|
159
162
|
z_value: 2.75
|
160
|
-
|
161
|
-
|
163
|
+
twist: &turning_moment 23
|
164
|
+
forward_lean: &forward_lean 87
|
162
165
|
- !ruby/object:SkiBinding::Setting
|
163
|
-
|
166
|
+
shoe_size_range: !ruby/range 251..270
|
164
167
|
z_value: 2.5
|
165
|
-
|
166
|
-
|
168
|
+
twist: *turning_moment
|
169
|
+
forward_lean: *forward_lean
|
167
170
|
- !ruby/object:SkiBinding::Setting
|
168
|
-
|
171
|
+
shoe_size_range: !ruby/range 271..290
|
169
172
|
z_value: 2.25
|
170
|
-
|
171
|
-
|
173
|
+
twist: *turning_moment
|
174
|
+
forward_lean: *forward_lean
|
172
175
|
- !ruby/object:SkiBinding::Setting
|
173
|
-
|
176
|
+
shoe_size_range: !ruby/range 291..310
|
174
177
|
z_value: 2
|
175
|
-
|
176
|
-
|
178
|
+
twist: *turning_moment
|
179
|
+
forward_lean: *forward_lean
|
177
180
|
- !ruby/object:SkiBinding::Setting
|
178
|
-
|
181
|
+
shoe_size_range: !ruby/range 311..330
|
179
182
|
z_value: 1.75
|
180
|
-
|
181
|
-
|
183
|
+
twist: *turning_moment
|
184
|
+
forward_lean: *forward_lean
|
182
185
|
- !ruby/object:SkiBinding::Setting
|
183
|
-
|
186
|
+
shoe_size_range: !ruby/range
|
184
187
|
begin: 331
|
185
188
|
end: .inf
|
186
189
|
z_value: 1.75
|
187
|
-
|
188
|
-
|
190
|
+
twist: *turning_moment
|
191
|
+
forward_lean: *forward_lean
|
189
192
|
-
|
190
193
|
- !ruby/object:SkiBinding::Setting
|
191
|
-
|
194
|
+
shoe_size_range: !ruby/range 1..250
|
192
195
|
z_value: 3.5
|
193
|
-
|
194
|
-
|
196
|
+
twist: &turning_moment 27
|
197
|
+
forward_lean: &forward_lean 102
|
195
198
|
- !ruby/object:SkiBinding::Setting
|
196
|
-
|
199
|
+
shoe_size_range: !ruby/range 251..270
|
197
200
|
z_value: 3
|
198
|
-
|
199
|
-
|
201
|
+
twist: *turning_moment
|
202
|
+
forward_lean: *forward_lean
|
200
203
|
- !ruby/object:SkiBinding::Setting
|
201
|
-
|
204
|
+
shoe_size_range: !ruby/range 271..290
|
202
205
|
z_value: 2.75
|
203
|
-
|
204
|
-
|
206
|
+
twist: *turning_moment
|
207
|
+
forward_lean: *forward_lean
|
205
208
|
- !ruby/object:SkiBinding::Setting
|
206
|
-
|
209
|
+
shoe_size_range: !ruby/range 291..310
|
207
210
|
z_value: 2.5
|
208
|
-
|
209
|
-
|
211
|
+
twist: *turning_moment
|
212
|
+
forward_lean: *forward_lean
|
210
213
|
- !ruby/object:SkiBinding::Setting
|
211
|
-
|
214
|
+
shoe_size_range: !ruby/range 311..330
|
212
215
|
z_value: 2.25
|
213
|
-
|
214
|
-
|
216
|
+
twist: *turning_moment
|
217
|
+
forward_lean: *forward_lean
|
215
218
|
- !ruby/object:SkiBinding::Setting
|
216
|
-
|
219
|
+
shoe_size_range: !ruby/range
|
217
220
|
begin: 331
|
218
221
|
end: .inf
|
219
222
|
z_value: 2
|
220
|
-
|
221
|
-
|
223
|
+
twist: *turning_moment
|
224
|
+
forward_lean: *forward_lean
|
222
225
|
-
|
223
226
|
- !ruby/object:SkiBinding::Setting
|
224
|
-
|
227
|
+
shoe_size_range: !ruby/range 1..250
|
225
228
|
z_value: 3.5
|
226
|
-
|
227
|
-
|
229
|
+
twist: &turning_moment 31
|
230
|
+
forward_lean: &forward_lean 120
|
228
231
|
- !ruby/object:SkiBinding::Setting
|
229
|
-
|
232
|
+
shoe_size_range: !ruby/range 251..270
|
230
233
|
z_value: 3.5
|
231
|
-
|
232
|
-
|
234
|
+
twist: *turning_moment
|
235
|
+
forward_lean: *forward_lean
|
233
236
|
- !ruby/object:SkiBinding::Setting
|
234
|
-
|
237
|
+
shoe_size_range: !ruby/range 271..290
|
235
238
|
z_value: 3
|
236
|
-
|
237
|
-
|
239
|
+
twist: *turning_moment
|
240
|
+
forward_lean: *forward_lean
|
238
241
|
- !ruby/object:SkiBinding::Setting
|
239
|
-
|
242
|
+
shoe_size_range: !ruby/range 291..310
|
240
243
|
z_value: 3
|
241
|
-
|
242
|
-
|
244
|
+
twist: *turning_moment
|
245
|
+
forward_lean: *forward_lean
|
243
246
|
- !ruby/object:SkiBinding::Setting
|
244
|
-
|
247
|
+
shoe_size_range: !ruby/range 311..330
|
245
248
|
z_value: 2.75
|
246
|
-
|
247
|
-
|
249
|
+
twist: *turning_moment
|
250
|
+
forward_lean: *forward_lean
|
248
251
|
- !ruby/object:SkiBinding::Setting
|
249
|
-
|
252
|
+
shoe_size_range: !ruby/range
|
250
253
|
begin: 331
|
251
254
|
end: .inf
|
252
255
|
z_value: 2.5
|
253
|
-
|
254
|
-
|
256
|
+
twist: *turning_moment
|
257
|
+
forward_lean: *forward_lean
|
255
258
|
-
|
256
259
|
- !ruby/object:SkiBinding::Setting
|
257
|
-
|
260
|
+
shoe_size_range: !ruby/range 1..250
|
258
261
|
z_value: 3.5
|
259
|
-
|
260
|
-
|
262
|
+
twist: &turning_moment 37
|
263
|
+
forward_lean: &forward_lean 141
|
261
264
|
- !ruby/object:SkiBinding::Setting
|
262
|
-
|
265
|
+
shoe_size_range: !ruby/range 251..270
|
263
266
|
z_value: 4.5
|
264
|
-
|
265
|
-
|
267
|
+
twist: *turning_moment
|
268
|
+
forward_lean: *forward_lean
|
266
269
|
- !ruby/object:SkiBinding::Setting
|
267
|
-
|
270
|
+
shoe_size_range: !ruby/range 271..290
|
268
271
|
z_value: 4
|
269
|
-
|
270
|
-
|
272
|
+
twist: *turning_moment
|
273
|
+
forward_lean: *forward_lean
|
271
274
|
- !ruby/object:SkiBinding::Setting
|
272
|
-
|
275
|
+
shoe_size_range: !ruby/range 291..310
|
273
276
|
z_value: 3.5
|
274
|
-
|
275
|
-
|
277
|
+
twist: *turning_moment
|
278
|
+
forward_lean: *forward_lean
|
276
279
|
- !ruby/object:SkiBinding::Setting
|
277
|
-
|
280
|
+
shoe_size_range: !ruby/range 311..330
|
278
281
|
z_value: 3.5
|
279
|
-
|
280
|
-
|
282
|
+
twist: *turning_moment
|
283
|
+
forward_lean: *forward_lean
|
281
284
|
- !ruby/object:SkiBinding::Setting
|
282
|
-
|
285
|
+
shoe_size_range: !ruby/range
|
283
286
|
begin: 331
|
284
287
|
end: .inf
|
285
288
|
z_value: 3
|
286
|
-
|
287
|
-
|
289
|
+
twist: *turning_moment
|
290
|
+
forward_lean: *forward_lean
|
288
291
|
-
|
289
292
|
- !ruby/object:SkiBinding::Setting
|
290
|
-
|
293
|
+
shoe_size_range: !ruby/range 1..250
|
291
294
|
z_value: 3.5
|
292
|
-
|
293
|
-
|
295
|
+
twist: &turning_moment 43
|
296
|
+
forward_lean: &forward_lean 165
|
294
297
|
- !ruby/object:SkiBinding::Setting
|
295
|
-
|
298
|
+
shoe_size_range: !ruby/range 251..270
|
296
299
|
z_value: 5.5
|
297
|
-
|
298
|
-
|
300
|
+
twist: *turning_moment
|
301
|
+
forward_lean: *forward_lean
|
299
302
|
- !ruby/object:SkiBinding::Setting
|
300
|
-
|
303
|
+
shoe_size_range: !ruby/range 271..290
|
301
304
|
z_value: 5
|
302
|
-
|
303
|
-
|
305
|
+
twist: *turning_moment
|
306
|
+
forward_lean: *forward_lean
|
304
307
|
- !ruby/object:SkiBinding::Setting
|
305
|
-
|
308
|
+
shoe_size_range: !ruby/range 291..310
|
306
309
|
z_value: 4.5
|
307
|
-
|
308
|
-
|
310
|
+
twist: *turning_moment
|
311
|
+
forward_lean: *forward_lean
|
309
312
|
- !ruby/object:SkiBinding::Setting
|
310
|
-
|
313
|
+
shoe_size_range: !ruby/range 311..330
|
311
314
|
z_value: 4
|
312
|
-
|
313
|
-
|
315
|
+
twist: *turning_moment
|
316
|
+
forward_lean: *forward_lean
|
314
317
|
- !ruby/object:SkiBinding::Setting
|
315
|
-
|
318
|
+
shoe_size_range: !ruby/range
|
316
319
|
begin: 331
|
317
320
|
end: .inf
|
318
321
|
z_value: 3.5
|
319
|
-
|
320
|
-
|
322
|
+
twist: *turning_moment
|
323
|
+
forward_lean: *forward_lean
|
321
324
|
-
|
322
325
|
- !ruby/object:SkiBinding::Setting
|
323
|
-
|
326
|
+
shoe_size_range: !ruby/range 1..250
|
324
327
|
z_value: 3.5
|
325
|
-
|
326
|
-
|
328
|
+
twist: &turning_moment 50
|
329
|
+
forward_lean: &forward_lean 194
|
327
330
|
- !ruby/object:SkiBinding::Setting
|
328
|
-
|
331
|
+
shoe_size_range: !ruby/range 251..270
|
329
332
|
z_value: 6.5
|
330
|
-
|
331
|
-
|
333
|
+
twist: *turning_moment
|
334
|
+
forward_lean: *forward_lean
|
332
335
|
- !ruby/object:SkiBinding::Setting
|
333
|
-
|
336
|
+
shoe_size_range: !ruby/range 271..290
|
334
337
|
z_value: 6
|
335
|
-
|
336
|
-
|
338
|
+
twist: *turning_moment
|
339
|
+
forward_lean: *forward_lean
|
337
340
|
- !ruby/object:SkiBinding::Setting
|
338
|
-
|
341
|
+
shoe_size_range: !ruby/range 291..310
|
339
342
|
z_value: 5.5
|
340
|
-
|
341
|
-
|
343
|
+
twist: *turning_moment
|
344
|
+
forward_lean: *forward_lean
|
342
345
|
- !ruby/object:SkiBinding::Setting
|
343
|
-
|
346
|
+
shoe_size_range: !ruby/range 311..330
|
344
347
|
z_value: 5
|
345
|
-
|
346
|
-
|
348
|
+
twist: *turning_moment
|
349
|
+
forward_lean: *forward_lean
|
347
350
|
- !ruby/object:SkiBinding::Setting
|
348
|
-
|
351
|
+
shoe_size_range: !ruby/range
|
349
352
|
begin: 331
|
350
353
|
end: .inf
|
351
354
|
z_value: 4.5
|
352
|
-
|
353
|
-
|
355
|
+
twist: *turning_moment
|
356
|
+
forward_lean: *forward_lean
|
354
357
|
-
|
355
358
|
- !ruby/object:SkiBinding::Setting
|
356
|
-
|
359
|
+
shoe_size_range: !ruby/range 1..250
|
357
360
|
z_value: 3.5
|
358
|
-
|
359
|
-
|
361
|
+
twist: &turning_moment 58
|
362
|
+
forward_lean: &forward_lean 229
|
360
363
|
- !ruby/object:SkiBinding::Setting
|
361
|
-
|
364
|
+
shoe_size_range: !ruby/range 251..270
|
362
365
|
z_value: 7.5
|
363
|
-
|
364
|
-
|
366
|
+
twist: *turning_moment
|
367
|
+
forward_lean: *forward_lean
|
365
368
|
- !ruby/object:SkiBinding::Setting
|
366
|
-
|
369
|
+
shoe_size_range: !ruby/range 271..290
|
367
370
|
z_value: 7
|
368
|
-
|
369
|
-
|
371
|
+
twist: *turning_moment
|
372
|
+
forward_lean: *forward_lean
|
370
373
|
- !ruby/object:SkiBinding::Setting
|
371
|
-
|
374
|
+
shoe_size_range: !ruby/range 291..310
|
372
375
|
z_value: 6.5
|
373
|
-
|
374
|
-
|
376
|
+
twist: *turning_moment
|
377
|
+
forward_lean: *forward_lean
|
375
378
|
- !ruby/object:SkiBinding::Setting
|
376
|
-
|
379
|
+
shoe_size_range: !ruby/range 311..330
|
377
380
|
z_value: 6
|
378
|
-
|
379
|
-
|
381
|
+
twist: *turning_moment
|
382
|
+
forward_lean: *forward_lean
|
380
383
|
- !ruby/object:SkiBinding::Setting
|
381
|
-
|
384
|
+
shoe_size_range: !ruby/range
|
382
385
|
begin: 331
|
383
386
|
end: .inf
|
384
387
|
z_value: 5.5
|
385
|
-
|
386
|
-
|
388
|
+
twist: *turning_moment
|
389
|
+
forward_lean: *forward_lean
|
387
390
|
-
|
388
391
|
- !ruby/object:SkiBinding::Setting
|
389
|
-
|
392
|
+
shoe_size_range: !ruby/range 1..250
|
390
393
|
z_value: 3.5
|
391
|
-
|
392
|
-
|
394
|
+
twist: &turning_moment 67
|
395
|
+
forward_lean: &forward_lean 271
|
393
396
|
- !ruby/object:SkiBinding::Setting
|
394
|
-
|
397
|
+
shoe_size_range: !ruby/range 251..270
|
395
398
|
z_value: 7.5
|
396
|
-
|
397
|
-
|
399
|
+
twist: *turning_moment
|
400
|
+
forward_lean: *forward_lean
|
398
401
|
- !ruby/object:SkiBinding::Setting
|
399
|
-
|
402
|
+
shoe_size_range: !ruby/range 271..290
|
400
403
|
z_value: 8.5
|
401
|
-
|
402
|
-
|
404
|
+
twist: *turning_moment
|
405
|
+
forward_lean: *forward_lean
|
403
406
|
- !ruby/object:SkiBinding::Setting
|
404
|
-
|
407
|
+
shoe_size_range: !ruby/range 291..310
|
405
408
|
z_value: 8
|
406
|
-
|
407
|
-
|
409
|
+
twist: *turning_moment
|
410
|
+
forward_lean: *forward_lean
|
408
411
|
- !ruby/object:SkiBinding::Setting
|
409
|
-
|
412
|
+
shoe_size_range: !ruby/range 311..330
|
410
413
|
z_value: 7
|
411
|
-
|
412
|
-
|
414
|
+
twist: *turning_moment
|
415
|
+
forward_lean: *forward_lean
|
413
416
|
- !ruby/object:SkiBinding::Setting
|
414
|
-
|
417
|
+
shoe_size_range: !ruby/range
|
415
418
|
begin: 331
|
416
419
|
end: .inf
|
417
420
|
z_value: 6.5
|
418
|
-
|
419
|
-
|
421
|
+
twist: *turning_moment
|
422
|
+
forward_lean: *forward_lean
|
420
423
|
-
|
421
424
|
- !ruby/object:SkiBinding::Setting
|
422
|
-
|
425
|
+
shoe_size_range: !ruby/range 1..250
|
423
426
|
z_value: 3.5
|
424
|
-
|
425
|
-
|
427
|
+
twist: &turning_moment 78
|
428
|
+
forward_lean: &forward_lean 320
|
426
429
|
- !ruby/object:SkiBinding::Setting
|
427
|
-
|
430
|
+
shoe_size_range: !ruby/range 251..270
|
428
431
|
z_value: 7.5
|
429
|
-
|
430
|
-
|
432
|
+
twist: *turning_moment
|
433
|
+
forward_lean: *forward_lean
|
431
434
|
- !ruby/object:SkiBinding::Setting
|
432
|
-
|
435
|
+
shoe_size_range: !ruby/range 271..290
|
433
436
|
z_value: 10
|
434
|
-
|
435
|
-
|
437
|
+
twist: *turning_moment
|
438
|
+
forward_lean: *forward_lean
|
436
439
|
- !ruby/object:SkiBinding::Setting
|
437
|
-
|
440
|
+
shoe_size_range: !ruby/range 291..310
|
438
441
|
z_value: 9.5
|
439
|
-
|
440
|
-
|
442
|
+
twist: *turning_moment
|
443
|
+
forward_lean: *forward_lean
|
441
444
|
- !ruby/object:SkiBinding::Setting
|
442
|
-
|
445
|
+
shoe_size_range: !ruby/range 311..330
|
443
446
|
z_value: 8.5
|
444
|
-
|
445
|
-
|
447
|
+
twist: *turning_moment
|
448
|
+
forward_lean: *forward_lean
|
446
449
|
- !ruby/object:SkiBinding::Setting
|
447
|
-
|
450
|
+
shoe_size_range: !ruby/range
|
448
451
|
begin: 331
|
449
452
|
end: .inf
|
450
453
|
z_value: 8
|
451
|
-
|
452
|
-
|
454
|
+
twist: *turning_moment
|
455
|
+
forward_lean: *forward_lean
|
453
456
|
-
|
454
457
|
- !ruby/object:SkiBinding::Setting
|
455
|
-
|
458
|
+
shoe_size_range: !ruby/range 1..250
|
456
459
|
z_value: 3.5
|
457
|
-
|
458
|
-
|
460
|
+
twist: &turning_moment 91
|
461
|
+
forward_lean: &forward_lean 380
|
459
462
|
- !ruby/object:SkiBinding::Setting
|
460
|
-
|
463
|
+
shoe_size_range: !ruby/range 251..270
|
461
464
|
z_value: 7.5
|
462
|
-
|
463
|
-
|
465
|
+
twist: *turning_moment
|
466
|
+
forward_lean: *forward_lean
|
464
467
|
- !ruby/object:SkiBinding::Setting
|
465
|
-
|
468
|
+
shoe_size_range: !ruby/range 271..290
|
466
469
|
z_value: 11.5
|
467
|
-
|
468
|
-
|
470
|
+
twist: *turning_moment
|
471
|
+
forward_lean: *forward_lean
|
469
472
|
- !ruby/object:SkiBinding::Setting
|
470
|
-
|
473
|
+
shoe_size_range: !ruby/range 291..310
|
471
474
|
z_value: 11
|
472
|
-
|
473
|
-
|
475
|
+
twist: *turning_moment
|
476
|
+
forward_lean: *forward_lean
|
474
477
|
- !ruby/object:SkiBinding::Setting
|
475
|
-
|
478
|
+
shoe_size_range: !ruby/range 311..330
|
476
479
|
z_value: 10
|
477
|
-
|
478
|
-
|
480
|
+
twist: *turning_moment
|
481
|
+
forward_lean: *forward_lean
|
479
482
|
- !ruby/object:SkiBinding::Setting
|
480
|
-
|
483
|
+
shoe_size_range: !ruby/range
|
481
484
|
begin: 331
|
482
485
|
end: .inf
|
483
486
|
z_value: 9.5
|
484
|
-
|
485
|
-
|
487
|
+
twist: *turning_moment
|
488
|
+
forward_lean: *forward_lean
|
@@ -1,4 +1,4 @@
|
|
1
|
-
require '
|
1
|
+
require 'ski_binding_calculator/config_loader'
|
2
2
|
|
3
3
|
class SkiBinding::Calculator
|
4
4
|
extend SkiBinding::ConfigLoader
|
@@ -29,9 +29,11 @@ class SkiBinding::Calculator
|
|
29
29
|
def self.binding_setting(code, person)
|
30
30
|
settings = self.load_binding_settings(code)
|
31
31
|
settings.each do |s|
|
32
|
-
|
33
|
-
|
34
|
-
|
32
|
+
if s.shoe_size_range.include?(person.shoe_size)
|
33
|
+
return {"z_value" => s.z_value,
|
34
|
+
"twist" => s.twist,
|
35
|
+
"forward_lean" => s.forward_lean}
|
36
|
+
end
|
35
37
|
end
|
36
38
|
end
|
37
39
|
end
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,6 @@
|
|
1
|
-
require 'ski_binding'
|
2
|
-
require '
|
3
|
-
require '
|
4
|
-
require '
|
5
|
-
require '
|
6
|
-
require 'person'
|
1
|
+
require 'ski_binding_calculator/ski_binding'
|
2
|
+
require 'ski_binding_calculator/calculator'
|
3
|
+
require 'ski_binding_calculator/config_loader'
|
4
|
+
require 'ski_binding_calculator/code'
|
5
|
+
require 'ski_binding_calculator/setting'
|
6
|
+
require 'ski_binding_calculator/person'
|
@@ -1,10 +1,10 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
|
3
3
|
s.name = 'ski_binding_calculator'
|
4
|
-
s.version = '0.5.
|
5
|
-
s.date = '2013-08-
|
4
|
+
s.version = '0.5.2'
|
5
|
+
s.date = '2013-08-05'
|
6
6
|
s.summary = "Ski Binding Calculator"
|
7
|
-
s.description = "calculate the z-value, forward pressure and
|
7
|
+
s.description = "calculate the z-value, forward pressure and turning
|
8
8
|
moment according to ISO 11088."
|
9
9
|
s.authors = ["Jonas Ruef, Felix Langenegger"]
|
10
10
|
s.email = 'support@fadendaten.ch'
|
@@ -8,30 +8,16 @@ describe SkiBinding::Calculator do
|
|
8
8
|
@person = SkiBinding::Person.new(hash)
|
9
9
|
end
|
10
10
|
|
11
|
-
describe "new" do
|
11
|
+
describe "#new" do
|
12
12
|
it "returns a BindingCalculator class" do
|
13
13
|
SkiBinding::Calculator.new.class.should == SkiBinding::Calculator
|
14
14
|
end
|
15
15
|
end
|
16
16
|
|
17
|
-
describe "config loader" do
|
18
|
-
it "responds to binding_settings" do
|
19
|
-
SkiBinding::Calculator.should respond_to :setting
|
20
|
-
end
|
21
|
-
|
22
|
-
it "responds to binding_codes" do
|
23
|
-
SkiBinding::Calculator.should respond_to :binding_code
|
24
|
-
end
|
25
|
-
|
26
|
-
it "responds to binding_settings" do
|
27
|
-
SkiBinding::Calculator.should respond_to :binding_setting
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
17
|
describe "#setting" do
|
32
18
|
it "returns a valid setting" do
|
33
19
|
SkiBinding::Calculator.setting(@person).should ==
|
34
|
-
{"z_value"=>6, "
|
20
|
+
{"z_value"=>6, "twist"=>58, "forward_lean"=>229}
|
35
21
|
end
|
36
22
|
end
|
37
23
|
|
@@ -40,17 +26,30 @@ describe SkiBinding::Calculator do
|
|
40
26
|
SkiBinding::Calculator.binding_code(@person).should == 11
|
41
27
|
end
|
42
28
|
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
29
|
+
context "returns code one less if age >= 50" do
|
30
|
+
before :each do
|
31
|
+
@code = SkiBinding::Calculator.binding_code(@person)
|
32
|
+
end
|
33
|
+
|
34
|
+
it "age is 50" do
|
35
|
+
hash = {:type => "Type2", :weight => 70,
|
36
|
+
:height => 170, :shoe_size => 315, :age => 50}
|
37
|
+
person = SkiBinding::Person.new(hash)
|
38
|
+
lambda { @code = SkiBinding::Calculator.binding_code(person) }
|
39
|
+
.should change{@code}.by(-1)
|
40
|
+
end
|
41
|
+
|
42
|
+
it "age is 51" do
|
43
|
+
hash = {:type => "Type2", :weight => 70,
|
44
|
+
:height => 170, :shoe_size => 315, :age => 51}
|
45
|
+
person = SkiBinding::Person.new(hash)
|
46
|
+
lambda { @code = SkiBinding::Calculator.binding_code(person) }
|
47
|
+
.should change{@code}.by(-1)
|
48
|
+
end
|
51
49
|
end
|
52
50
|
|
53
|
-
it "returns code
|
51
|
+
it "returns unchanged code if weight less than 13kg" do
|
52
|
+
# because we set "Type2" the code would be changed by 1
|
54
53
|
hash = {:type => "Type2", :weight => 12,
|
55
54
|
:height => 147, :shoe_size => 249, :age => 30}
|
56
55
|
@person = SkiBinding::Person.new(hash)
|
@@ -61,7 +60,7 @@ describe SkiBinding::Calculator do
|
|
61
60
|
describe "#binding_setting" do
|
62
61
|
it "returns a valid setting" do
|
63
62
|
SkiBinding::Calculator.binding_setting(11, @person).should ==
|
64
|
-
{"z_value"=>6, "
|
63
|
+
{"z_value"=>6, "twist"=>58, "forward_lean"=>229}
|
65
64
|
end
|
66
65
|
end
|
67
66
|
end
|
@@ -2,10 +2,14 @@ require 'spec_helper'
|
|
2
2
|
|
3
3
|
describe SkiBinding::Person do
|
4
4
|
before :all do
|
5
|
-
@hash = {:type => "Type2",
|
5
|
+
@hash = {:type => "Type2",
|
6
|
+
:weight => 70,
|
7
|
+
:height => 170,
|
8
|
+
:shoe_size => 315,
|
9
|
+
:age => 30}
|
6
10
|
end
|
7
11
|
|
8
|
-
describe "new" do
|
12
|
+
describe "#new" do
|
9
13
|
it "should return a Person class" do
|
10
14
|
SkiBinding::Person.new(@hash).class.should == SkiBinding::Person
|
11
15
|
end
|
@@ -41,7 +45,14 @@ describe SkiBinding::Person do
|
|
41
45
|
@person.type.should == 1
|
42
46
|
end
|
43
47
|
|
44
|
-
it "sets type \"unknown\" to nil"
|
48
|
+
it "sets type \"unknown\" to nil" do
|
49
|
+
hash = {:type => "unknown",
|
50
|
+
:weight => 70,
|
51
|
+
:height => 170,
|
52
|
+
:shoe_size => 315,
|
53
|
+
:age => 30}
|
54
|
+
SkiBinding::Person.new(hash).type.should == nil
|
55
|
+
end
|
45
56
|
end
|
46
57
|
end
|
47
58
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe SkiBinding::Setting do
|
4
|
-
describe "new" do
|
4
|
+
describe "#new" do
|
5
5
|
it "should return a Setting class" do
|
6
6
|
SkiBinding::Setting.new.class.should == SkiBinding::Setting
|
7
7
|
end
|
@@ -12,20 +12,20 @@ describe SkiBinding::Setting do
|
|
12
12
|
@setting = SkiBinding::Setting.new
|
13
13
|
end
|
14
14
|
|
15
|
-
it "has attribute
|
16
|
-
@setting.should respond_to :
|
15
|
+
it "has attribute shoe_size_range" do
|
16
|
+
@setting.should respond_to :shoe_size_range
|
17
17
|
end
|
18
18
|
|
19
19
|
it "has attribute z_value" do
|
20
20
|
@setting.should respond_to :z_value
|
21
21
|
end
|
22
22
|
|
23
|
-
it "has attribute
|
24
|
-
@setting.should respond_to :
|
23
|
+
it "has attribute twist" do
|
24
|
+
@setting.should respond_to :twist
|
25
25
|
end
|
26
26
|
|
27
|
-
it "has attribute
|
28
|
-
@setting.should respond_to :
|
27
|
+
it "has attribute forward_lean" do
|
28
|
+
@setting.should respond_to :forward_lean
|
29
29
|
end
|
30
30
|
end
|
31
31
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ski_binding_calculator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-08-
|
12
|
+
date: 2013-08-05 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rspec
|
@@ -59,7 +59,7 @@ dependencies:
|
|
59
59
|
- - ~>
|
60
60
|
- !ruby/object:Gem::Version
|
61
61
|
version: 0.7.1
|
62
|
-
description: ! "calculate the z-value, forward pressure and
|
62
|
+
description: ! "calculate the z-value, forward pressure and turning\n moment
|
63
63
|
according to ISO 11088."
|
64
64
|
email: support@fadendaten.ch
|
65
65
|
executables: []
|
@@ -68,18 +68,18 @@ extra_rdoc_files: []
|
|
68
68
|
files:
|
69
69
|
- config/binding_codes.yml
|
70
70
|
- config/binding_settings.yml
|
71
|
-
- lib/
|
72
|
-
- lib/
|
73
|
-
- lib/
|
74
|
-
- lib/
|
75
|
-
- lib/
|
76
|
-
- lib/ski_binding.rb
|
71
|
+
- lib/ski_binding_calculator/calculator.rb
|
72
|
+
- lib/ski_binding_calculator/code.rb
|
73
|
+
- lib/ski_binding_calculator/config_loader.rb
|
74
|
+
- lib/ski_binding_calculator/person.rb
|
75
|
+
- lib/ski_binding_calculator/setting.rb
|
76
|
+
- lib/ski_binding_calculator/ski_binding.rb
|
77
77
|
- lib/ski_binding_calculator.rb
|
78
|
-
- spec/calculator_spec.rb
|
79
|
-
- spec/code_spec.rb
|
80
|
-
- spec/config_loader_spec.rb
|
81
|
-
- spec/person_spec.rb
|
82
|
-
- spec/setting_spec.rb
|
78
|
+
- spec/lib/calculator_spec.rb
|
79
|
+
- spec/lib/code_spec.rb
|
80
|
+
- spec/lib/config_loader_spec.rb
|
81
|
+
- spec/lib/person_spec.rb
|
82
|
+
- spec/lib/setting_spec.rb
|
83
83
|
- spec/spec_helper.rb
|
84
84
|
- Rakefile
|
85
85
|
- ski_binding_calculator.gemspec
|
data/lib/calculator/setting.rb
DELETED