unitsml 0.6.0 → 0.6.2

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.
Files changed (63) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/.rubocop_todo.yml +97 -412
  4. data/Gemfile +15 -14
  5. data/Rakefile +2 -2
  6. data/bin/console +3 -3
  7. data/lib/unitsml/dimension.rb +3 -3
  8. data/lib/unitsml/errors.rb +2 -2
  9. data/lib/unitsml/extender.rb +9 -9
  10. data/lib/unitsml/fenced.rb +3 -3
  11. data/lib/unitsml/formula.rb +29 -20
  12. data/lib/unitsml/intermediate_exp_rules.rb +30 -20
  13. data/lib/unitsml/model/dimension.rb +1 -1
  14. data/lib/unitsml/model/dimension_quantities.rb +8 -4
  15. data/lib/unitsml/model/prefix.rb +1 -1
  16. data/lib/unitsml/model/prefixes/name.rb +2 -2
  17. data/lib/unitsml/model/prefixes/symbol.rb +1 -1
  18. data/lib/unitsml/model/quantities/name.rb +2 -2
  19. data/lib/unitsml/model/quantity.rb +2 -2
  20. data/lib/unitsml/model/unit.rb +1 -1
  21. data/lib/unitsml/model/units/name.rb +2 -2
  22. data/lib/unitsml/model/units/root_units.rb +1 -1
  23. data/lib/unitsml/model/units/symbol.rb +4 -2
  24. data/lib/unitsml/model/units/system.rb +2 -2
  25. data/lib/unitsml/model/units.rb +5 -5
  26. data/lib/unitsml/namespace.rb +2 -2
  27. data/lib/unitsml/number.rb +11 -11
  28. data/lib/unitsml/parse.rb +30 -19
  29. data/lib/unitsml/parser.rb +11 -11
  30. data/lib/unitsml/prefix.rb +6 -4
  31. data/lib/unitsml/transform.rb +26 -26
  32. data/lib/unitsml/unit.rb +8 -6
  33. data/lib/unitsml/unitsdb/dimension.rb +24 -12
  34. data/lib/unitsml/unitsdb/dimensions.rb +4 -0
  35. data/lib/unitsml/unitsdb/prefix_reference.rb +3 -1
  36. data/lib/unitsml/unitsdb/si_derived_base.rb +14 -0
  37. data/lib/unitsml/unitsdb/unit.rb +11 -3
  38. data/lib/unitsml/unitsdb/units.rb +4 -0
  39. data/lib/unitsml/unitsdb.rb +9 -19
  40. data/lib/unitsml/utility.rb +81 -70
  41. data/lib/unitsml/version.rb +1 -1
  42. data/lib/unitsml.rb +31 -31
  43. data/unitsml.gemspec +22 -19
  44. metadata +6 -23
  45. data/unitsdb/Gemfile +0 -6
  46. data/unitsdb/LICENSE.md +0 -53
  47. data/unitsdb/README.adoc +0 -1253
  48. data/unitsdb/RELEASE-NOTES.adoc +0 -269
  49. data/unitsdb/dimensions.yaml +0 -1864
  50. data/unitsdb/prefixes.yaml +0 -874
  51. data/unitsdb/quantities.yaml +0 -3715
  52. data/unitsdb/scales.yaml +0 -97
  53. data/unitsdb/schemas/README.md +0 -159
  54. data/unitsdb/schemas/dimensions-schema.yaml +0 -153
  55. data/unitsdb/schemas/prefixes-schema.yaml +0 -155
  56. data/unitsdb/schemas/quantities-schema.yaml +0 -117
  57. data/unitsdb/schemas/scales-schema.yaml +0 -106
  58. data/unitsdb/schemas/unit_systems-schema.yaml +0 -116
  59. data/unitsdb/schemas/units-schema.yaml +0 -215
  60. data/unitsdb/spec/units_spec.rb +0 -22
  61. data/unitsdb/unit_systems.yaml +0 -78
  62. data/unitsdb/units.yaml +0 -14052
  63. data/unitsdb/validate_schemas.rb +0 -203
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7484b38ea8a6aed7be580a14fc3b85852d29986957fa3d33951ae5e18e2ad6b
4
- data.tar.gz: 422e09800989b3a9ac50177bd449e210f667451ba024e865884ab5926f917f99
3
+ metadata.gz: 519edb3bcbb3adee7983969d11be6a300340d782e8e305dae7622633b86e7677
4
+ data.tar.gz: 68becf0180daf138fc4f38048f052debef3d82433f4806d0f631c0c14e6ea852
5
5
  SHA512:
6
- metadata.gz: 8d56aa6d5bf8db31f70914adb64655601cf22c2de6886c36c67aa2eac423322f7116582451e588bf6018442b960147b8b3672377474fbf28d8e1d20237f9f437
7
- data.tar.gz: b774ddedf3bd41a0b33596550d6cc9410519db3cbc8a23c525c34ae76968bce1b6666a00b4ad83cd6f6f03e5e49eca01948b4d9ac04929318cf65861e8a40ab8
6
+ metadata.gz: b6cb0077f5037893a02e69e6ff6c4b8a7c75ae3e67615897a4ccee3966349121bdaa1d8a8b244c42b6e9ba59898c6b2243a4c911239a54fd7f254a360208154a
7
+ data.tar.gz: 3fa4b5a9542487d7e502a18a22eca293664dc44b556cd9acca4e1bf589f6cd4d88daa9448b2ac18f37a678de4d63646e8f558ac128192d188a46efc56d5d27c6
data/.gitmodules CHANGED
@@ -1,6 +1,3 @@
1
- [submodule "unitsdb"]
2
- path = unitsdb
3
- url = https://github.com/unitsml/unitsdb.git
4
1
  [submodule "vendor/unitsdb"]
5
2
  path = vendor/unitsdb
6
3
  url = https://github.com/unitsml/unitsdb.git
data/.rubocop_todo.yml CHANGED
@@ -1,293 +1,90 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2026-04-01 01:44:59 UTC using RuboCop version 1.86.0.
3
+ # on 2026-04-04 03:19:03 UTC using RuboCop version 1.86.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 3
9
+ # Offense count: 2
10
10
  # This cop supports safe autocorrection (--autocorrect).
11
11
  # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
12
12
  Bundler/OrderedGems:
13
13
  Exclude:
14
14
  - 'Gemfile'
15
15
 
16
- # Offense count: 3
17
- # This cop supports safe autocorrection (--autocorrect).
18
- # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
19
- Gemspec/OrderedDependencies:
16
+ # Offense count: 1
17
+ Gemspec/RequiredRubyVersion:
20
18
  Exclude:
21
19
  - 'unitsml.gemspec'
22
20
 
23
- # Offense count: 2
24
- # This cop supports safe autocorrection (--autocorrect).
25
- # Configuration parameters: EnforcedStyle, IndentationWidth.
26
- # SupportedStyles: with_first_argument, with_fixed_indentation
27
- Layout/ArgumentAlignment:
28
- Exclude:
29
- - 'spec/unitsml/parser_spec.rb'
30
- - 'unitsdb/validate_schemas.rb'
31
-
32
- # Offense count: 59
33
- # This cop supports safe autocorrection (--autocorrect).
34
- # Configuration parameters: EnforcedStyle, IndentationWidth.
35
- # SupportedStyles: with_first_element, with_fixed_indentation
36
- Layout/ArrayAlignment:
37
- Exclude:
38
- - 'spec/unitsml/conv/plurimath_spec.rb'
39
- - 'spec/unitsml/parser_spec.rb'
40
-
41
- # Offense count: 8
42
- # This cop supports safe autocorrection (--autocorrect).
43
- # Configuration parameters: EnforcedStyleAlignWith.
44
- # SupportedStylesAlignWith: either, start_of_block, start_of_line
45
- Layout/BlockAlignment:
46
- Exclude:
47
- - 'lib/unitsml/intermediate_exp_rules.rb'
48
- - 'spec/unitsml/conv/latex_spec.rb'
49
- - 'spec/unitsml/conv/plurimath_spec.rb'
50
-
51
- # Offense count: 8
21
+ # Offense count: 75
52
22
  # This cop supports safe autocorrection (--autocorrect).
53
- Layout/BlockEndNewline:
23
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
24
+ # URISchemes: http, https
25
+ Layout/LineLength:
54
26
  Exclude:
27
+ - 'lib/unitsml/fenced.rb'
28
+ - 'lib/unitsml/formula.rb'
55
29
  - 'lib/unitsml/intermediate_exp_rules.rb'
56
- - 'spec/unitsml/conv/latex_spec.rb'
57
- - 'spec/unitsml/conv/plurimath_spec.rb'
58
-
59
- # Offense count: 1
60
- # This cop supports safe autocorrection (--autocorrect).
61
- Layout/ClosingParenthesisIndentation:
62
- Exclude:
63
- - 'spec/unitsml/conv/plurimath_spec.rb'
64
-
65
- # Offense count: 2
66
- # This cop supports safe autocorrection (--autocorrect).
67
- Layout/ElseAlignment:
68
- Exclude:
69
- - 'lib/unitsml/number.rb'
70
- - 'unitsdb/validate_schemas.rb'
71
-
72
- # Offense count: 18
73
- # This cop supports safe autocorrection (--autocorrect).
74
- Layout/EmptyLineAfterMagicComment:
75
- Enabled: false
76
-
77
- # Offense count: 5
78
- # This cop supports safe autocorrection (--autocorrect).
79
- Layout/EmptyLines:
80
- Exclude:
81
- - 'lib/unitsml/model/dimension.rb'
82
- - 'lib/unitsml/model/prefix.rb'
83
- - 'lib/unitsml/model/quantity.rb'
84
- - 'lib/unitsml/model/units/root_units.rb'
85
-
86
- # Offense count: 10
87
- # This cop supports safe autocorrection (--autocorrect).
88
- # Configuration parameters: EnforcedStyle.
89
- # SupportedStyles: empty_lines, no_empty_lines
90
- Layout/EmptyLinesAroundBlockBody:
91
- Exclude:
92
- - 'spec/unitsml/conv/asciimath_spec.rb'
30
+ - 'lib/unitsml/parse.rb'
31
+ - 'lib/unitsml/parser.rb'
32
+ - 'lib/unitsml/unit.rb'
33
+ - 'lib/unitsml/unitsdb/dimensions.rb'
34
+ - 'lib/unitsml/utility.rb'
93
35
  - 'spec/unitsml/conv/html_spec.rb'
94
36
  - 'spec/unitsml/conv/latex_spec.rb'
95
37
  - 'spec/unitsml/conv/mathml_spec.rb'
96
38
  - 'spec/unitsml/conv/plurimath_spec.rb'
97
39
  - 'spec/unitsml/conv/unicode_spec.rb'
98
40
  - 'spec/unitsml/conv/xml_spec.rb'
99
- - 'spec/unitsml/parse_spec.rb'
100
- - 'spec/unitsml/parser_spec.rb'
101
-
102
- # Offense count: 1
103
- # This cop supports safe autocorrection (--autocorrect).
104
- Layout/EmptyLinesAroundExceptionHandlingKeywords:
105
- Exclude:
106
- - 'unitsdb/validate_schemas.rb'
107
-
108
- # Offense count: 2
109
- # This cop supports safe autocorrection (--autocorrect).
110
- Layout/EmptyLinesAroundMethodBody:
111
- Exclude:
112
- - 'unitsdb/validate_schemas.rb'
113
-
114
- # Offense count: 82
115
- # This cop supports safe autocorrection (--autocorrect).
116
- # Configuration parameters: EnforcedStyle, IndentationWidth.
117
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
118
- Layout/FirstArrayElementIndentation:
119
- Exclude:
120
- - 'spec/unitsml/conv/plurimath_spec.rb'
121
- - 'spec/unitsml/parser_spec.rb'
122
-
123
- # Offense count: 1
124
- # This cop supports safe autocorrection (--autocorrect).
125
- Layout/HeredocIndentation:
126
- Exclude:
127
- - 'spec/unitsml/conv/xml_spec.rb'
128
-
129
- # Offense count: 2
130
- # This cop supports safe autocorrection (--autocorrect).
131
- # Configuration parameters: EnforcedStyle.
132
- # SupportedStyles: normal, indented_internal_methods
133
- Layout/IndentationConsistency:
134
- Exclude:
135
- - 'unitsdb/validate_schemas.rb'
136
-
137
- # Offense count: 20
138
- # This cop supports safe autocorrection (--autocorrect).
139
- # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
140
- # SupportedStylesAlignWith: start_of_line, relative_to_receiver
141
- Layout/IndentationWidth:
142
- Exclude:
143
- - 'lib/unitsml/intermediate_exp_rules.rb'
144
- - 'lib/unitsml/number.rb'
145
- - 'spec/unitsml/conv/latex_spec.rb'
146
- - 'spec/unitsml/conv/plurimath_spec.rb'
147
- - 'unitsdb/validate_schemas.rb'
148
-
149
- # Offense count: 1
150
- # This cop supports safe autocorrection (--autocorrect).
151
- # Configuration parameters: EnforcedStyle.
152
- # SupportedStyles: symmetrical, new_line, same_line
153
- Layout/MultilineArrayBraceLayout:
154
- Exclude:
155
- - 'lib/unitsml/transform.rb'
156
-
157
- # Offense count: 1
158
- # This cop supports safe autocorrection (--autocorrect).
159
- Layout/RescueEnsureAlignment:
160
- Exclude:
161
- - 'unitsdb/validate_schemas.rb'
162
-
163
- # Offense count: 1
164
- # This cop supports safe autocorrection (--autocorrect).
165
- Layout/SpaceAfterComma:
166
- Exclude:
167
- - 'lib/unitsml/unitsdb.rb'
41
+ - 'unitsml.gemspec'
168
42
 
169
- # Offense count: 1
170
- # This cop supports safe autocorrection (--autocorrect).
171
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
172
- # SupportedStyles: space, no_space
173
- # SupportedStylesForEmptyBraces: space, no_space
174
- Layout/SpaceBeforeBlockBraces:
43
+ # Offense count: 3
44
+ Lint/ReturnInVoidContext:
175
45
  Exclude:
176
- - 'spec/unitsml/parse_spec.rb'
46
+ - 'lib/unitsml/unitsdb/si_derived_base.rb'
47
+ - 'lib/unitsml/unitsdb/unit.rb'
177
48
 
178
- # Offense count: 4
179
- # This cop supports safe autocorrection (--autocorrect).
180
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces, SpaceBeforeBlockParameters.
181
- # SupportedStyles: space, no_space
182
- # SupportedStylesForEmptyBraces: space, no_space
183
- Layout/SpaceInsideBlockBraces:
49
+ # Offense count: 19
50
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
51
+ Metrics/AbcSize:
184
52
  Exclude:
53
+ - 'lib/unitsml/fenced.rb'
54
+ - 'lib/unitsml/formula.rb'
185
55
  - 'lib/unitsml/parse.rb'
186
- - 'spec/unitsml/parse_spec.rb'
187
-
188
- # Offense count: 1
189
- # This cop supports safe autocorrection (--autocorrect).
190
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
191
- # SupportedStyles: space, no_space, compact
192
- # SupportedStylesForEmptyBraces: space, no_space
193
- Layout/SpaceInsideHashLiteralBraces:
194
- Exclude:
195
- - 'lib/unitsml/prefix.rb'
196
-
197
- # Offense count: 5
198
- # This cop supports safe autocorrection (--autocorrect).
199
- # Configuration parameters: EnforcedStyle.
200
- # SupportedStyles: final_newline, final_blank_line
201
- Layout/TrailingEmptyLines:
202
- Exclude:
203
- - 'lib/unitsml.rb'
204
- - 'lib/unitsml/unitsdb/dimensions.rb'
205
- - 'lib/unitsml/unitsdb/prefixes.rb'
206
- - 'lib/unitsml/unitsdb/quantities.rb'
207
- - 'lib/unitsml/unitsdb/units.rb'
208
-
209
- # Offense count: 2
210
- # This cop supports safe autocorrection (--autocorrect).
211
- # Configuration parameters: AllowInHeredoc.
212
- Layout/TrailingWhitespace:
213
- Exclude:
214
- - 'unitsdb/validate_schemas.rb'
56
+ - 'lib/unitsml/parser.rb'
57
+ - 'lib/unitsml/unit.rb'
58
+ - 'lib/unitsml/utility.rb'
215
59
 
216
- # Offense count: 1
217
- # This cop supports safe autocorrection (--autocorrect).
218
- # Configuration parameters: AllowedMethods.
219
- # AllowedMethods: present?, blank?, presence, try, try!, in?
220
- Lint/SafeNavigationChain:
60
+ # Offense count: 13
61
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
62
+ Metrics/CyclomaticComplexity:
221
63
  Exclude:
64
+ - 'lib/unitsml/formula.rb'
222
65
  - 'lib/unitsml/parse.rb'
66
+ - 'lib/unitsml/parser.rb'
67
+ - 'lib/unitsml/utility.rb'
223
68
 
224
- # Offense count: 16
225
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
226
- Metrics/AbcSize:
227
- Max: 51
228
-
229
- # Offense count: 89
230
- # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
231
- # AllowedMethods: refine
232
- Metrics/BlockLength:
233
- Max: 1251
234
-
235
- # Offense count: 5
236
- # Configuration parameters: CountComments, CountAsOne.
237
- Metrics/ClassLength:
238
- Max: 252
239
-
240
- # Offense count: 11
241
- # Configuration parameters: AllowedMethods, AllowedPatterns.
242
- Metrics/CyclomaticComplexity:
243
- Max: 14
244
-
245
- # Offense count: 17
69
+ # Offense count: 14
246
70
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
247
71
  Metrics/MethodLength:
248
- Max: 47
249
-
250
- # Offense count: 1
251
- # Configuration parameters: CountComments, CountAsOne.
252
- Metrics/ModuleLength:
253
- Max: 290
72
+ Max: 20
254
73
 
255
74
  # Offense count: 1
256
75
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
257
76
  Metrics/ParameterLists:
258
77
  Max: 6
259
78
 
260
- # Offense count: 10
261
- # Configuration parameters: AllowedMethods, AllowedPatterns.
79
+ # Offense count: 9
80
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
262
81
  Metrics/PerceivedComplexity:
263
- Max: 14
264
-
265
- # Offense count: 1
266
- Naming/AccessorMethodName:
267
82
  Exclude:
83
+ - 'lib/unitsml/formula.rb'
84
+ - 'lib/unitsml/parse.rb'
85
+ - 'lib/unitsml/parser.rb'
268
86
  - 'lib/unitsml/utility.rb'
269
87
 
270
- # Offense count: 7
271
- # This cop supports safe autocorrection (--autocorrect).
272
- Naming/BinaryOperatorParameterName:
273
- Exclude:
274
- - 'lib/unitsml/dimension.rb'
275
- - 'lib/unitsml/extender.rb'
276
- - 'lib/unitsml/fenced.rb'
277
- - 'lib/unitsml/number.rb'
278
- - 'lib/unitsml/prefix.rb'
279
- - 'lib/unitsml/sqrt.rb'
280
- - 'lib/unitsml/unit.rb'
281
-
282
- # Offense count: 2
283
- # This cop supports unsafe autocorrection (--autocorrect-all).
284
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
285
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
286
- Naming/MemoizedInstanceVariableName:
287
- Exclude:
288
- - 'lib/unitsml/unitsdb/dimension.rb'
289
- - 'lib/unitsml/unitsdb/units.rb'
290
-
291
88
  # Offense count: 3
292
89
  # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
293
90
  # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
@@ -295,88 +92,73 @@ Naming/MethodParameterName:
295
92
  Exclude:
296
93
  - 'lib/unitsml/utility.rb'
297
94
 
298
- # Offense count: 14
299
- # This cop supports safe autocorrection (--autocorrect).
300
- # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
301
- # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
302
- # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
303
- # FunctionalMethods: let, let!, subject, watch
304
- # AllowedMethods: lambda, proc, it
305
- Style/BlockDelimiters:
306
- Exclude:
307
- - 'lib/unitsml/intermediate_exp_rules.rb'
308
- - 'spec/unitsml/conv/latex_spec.rb'
309
- - 'spec/unitsml/conv/plurimath_spec.rb'
310
-
311
- # Offense count: 11
312
- Style/ClassVars:
313
- Exclude:
314
- - 'lib/unitsml/parse.rb'
315
- - 'lib/unitsml/unitsdb.rb'
316
-
317
95
  # Offense count: 1
318
- # This cop supports safe autocorrection (--autocorrect).
319
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
320
- # SupportedStyles: assign_to_condition, assign_inside_condition
321
- Style/ConditionalAssignment:
96
+ # Configuration parameters: MinSize.
97
+ Performance/CollectionLiteralInLoop:
322
98
  Exclude:
323
- - 'lib/unitsml/number.rb'
324
-
325
- # Offense count: 46
326
- # Configuration parameters: AllowedConstants.
327
- Style/Documentation:
328
- Enabled: false
329
-
330
- # Offense count: 20
331
- # This cop supports unsafe autocorrection (--autocorrect-all).
332
- # Configuration parameters: EnforcedStyle.
333
- # SupportedStyles: always, always_true, never
334
- Style/FrozenStringLiteralComment:
335
- Enabled: false
99
+ - 'lib/unitsml/parser.rb'
336
100
 
337
101
  # Offense count: 1
338
- # This cop supports safe autocorrection (--autocorrect).
339
- # Configuration parameters: EnforcedStyle, EnforcedShorthandSyntax, UseHashRocketsWithSymbolValues, PreferHashRocketsForNonAlnumEndingSymbols.
340
- # SupportedStyles: ruby19, hash_rockets, no_mixed_keys, ruby19_no_mixed_keys
341
- # SupportedShorthandSyntax: always, never, either, consistent, either_consistent
342
- Style/HashSyntax:
102
+ RSpec/AnyInstance:
343
103
  Exclude:
344
- - 'Rakefile'
104
+ - 'spec/unitsml/conv/plurimath_spec.rb'
345
105
 
346
- # Offense count: 1
347
- # This cop supports safe autocorrection (--autocorrect).
348
- # Configuration parameters: AllowIfModifier.
349
- Style/IfInsideElse:
106
+ # Offense count: 2
107
+ RSpec/BeforeAfterAll:
350
108
  Exclude:
351
- - 'unitsdb/validate_schemas.rb'
109
+ - 'spec/unitsml/conv/mathml_spec.rb'
110
+ - 'spec/unitsml/conv/xml_spec.rb'
352
111
 
353
- # Offense count: 3
354
- # This cop supports safe autocorrection (--autocorrect).
355
- Style/IfUnlessModifier:
112
+ # Offense count: 366
113
+ # Configuration parameters: Prefixes, AllowedPatterns.
114
+ # Prefixes: when, with, without
115
+ RSpec/ContextWording:
356
116
  Exclude:
357
- - 'lib/unitsml/unit.rb'
358
- - 'unitsdb/validate_schemas.rb'
117
+ - 'spec/unitsml/conv/asciimath_spec.rb'
118
+ - 'spec/unitsml/conv/html_spec.rb'
119
+ - 'spec/unitsml/conv/latex_spec.rb'
120
+ - 'spec/unitsml/conv/mathml_spec.rb'
121
+ - 'spec/unitsml/conv/plurimath_spec.rb'
122
+ - 'spec/unitsml/conv/unicode_spec.rb'
123
+ - 'spec/unitsml/conv/xml_spec.rb'
124
+ - 'spec/unitsml/parse_spec.rb'
125
+ - 'spec/unitsml/parser_spec.rb'
359
126
 
360
- # Offense count: 1
361
- # This cop supports unsafe autocorrection (--autocorrect-all).
362
- # Configuration parameters: EnforcedStyle, Autocorrect.
363
- # SupportedStyles: module_function, extend_self, forbidden
364
- Style/ModuleFunction:
127
+ # Offense count: 5
128
+ # Configuration parameters: CountAsOne.
129
+ RSpec/ExampleLength:
130
+ Max: 7
131
+
132
+ # Offense count: 15
133
+ RSpec/MultipleExpectations:
134
+ Max: 6
135
+
136
+ # Offense count: 12
137
+ RSpec/RepeatedExampleGroupBody:
365
138
  Exclude:
366
- - 'lib/unitsml.rb'
139
+ - 'spec/unitsml/conv/asciimath_spec.rb'
140
+ - 'spec/unitsml/conv/unicode_spec.rb'
141
+ - 'spec/unitsml/conv/xml_spec.rb'
142
+ - 'spec/unitsml/parse_spec.rb'
367
143
 
368
- # Offense count: 1
369
- Style/MultilineBlockChain:
144
+ # Offense count: 4
145
+ RSpec/RepeatedExampleGroupDescription:
370
146
  Exclude:
371
- - 'lib/unitsml/utility.rb'
147
+ - 'spec/unitsml/conv/mathml_spec.rb'
148
+ - 'spec/unitsml/parse_spec.rb'
372
149
 
373
- # Offense count: 1
374
- # This cop supports unsafe autocorrection (--autocorrect-all).
375
- # Configuration parameters: EnforcedStyle.
376
- # SupportedStyles: literals, strict
377
- Style/MutableConstant:
150
+ # Offense count: 7
151
+ # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
152
+ # SupportedInflectors: default, active_support
153
+ RSpec/SpecFilePathFormat:
378
154
  Exclude:
379
- - 'lib/unitsml/version.rb'
155
+ - 'spec/unitsml/conv/asciimath_spec.rb'
156
+ - 'spec/unitsml/conv/html_spec.rb'
157
+ - 'spec/unitsml/conv/latex_spec.rb'
158
+ - 'spec/unitsml/conv/mathml_spec.rb'
159
+ - 'spec/unitsml/conv/plurimath_spec.rb'
160
+ - 'spec/unitsml/conv/unicode_spec.rb'
161
+ - 'spec/unitsml/conv/xml_spec.rb'
380
162
 
381
163
  # Offense count: 2
382
164
  # Configuration parameters: AllowedMethods.
@@ -386,113 +168,16 @@ Style/OptionalBooleanParameter:
386
168
  - 'lib/unitsml/parser.rb'
387
169
  - 'lib/unitsml/prefix.rb'
388
170
 
389
- # Offense count: 1
390
- # This cop supports safe autocorrection (--autocorrect).
391
- Style/RedundantBegin:
392
- Exclude:
393
- - 'unitsdb/validate_schemas.rb'
394
-
395
- # Offense count: 1
396
- # This cop supports safe autocorrection (--autocorrect).
397
- Style/RedundantFreeze:
398
- Exclude:
399
- - 'lib/unitsml/version.rb'
400
-
401
- # Offense count: 2
402
- # This cop supports safe autocorrection (--autocorrect).
403
- Style/RedundantParentheses:
404
- Exclude:
405
- - 'lib/unitsml/unitsdb/units.rb'
406
-
407
171
  # Offense count: 2
408
- # This cop supports safe autocorrection (--autocorrect).
409
- # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
410
- # SupportedStyles: slashes, percent_r, mixed
411
- Style/RegexpLiteral:
172
+ # Configuration parameters: Max.
173
+ Style/SafeNavigationChainLength:
412
174
  Exclude:
413
- - 'lib/unitsml/parser.rb'
414
- - 'lib/unitsml/unitsdb/units.rb'
175
+ - 'lib/unitsml/dimension.rb'
176
+ - 'lib/unitsml/parse.rb'
415
177
 
416
178
  # Offense count: 1
417
179
  # This cop supports unsafe autocorrection (--autocorrect-all).
418
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
419
- # AllowedMethods: present?, blank?, presence, try, try!
420
- Style/SafeNavigation:
421
- Exclude:
422
- - 'lib/unitsml/prefix.rb'
423
-
424
- # Offense count: 2
425
- # This cop supports unsafe autocorrection (--autocorrect-all).
426
- # Configuration parameters: RequireEnglish, EnforcedStyle.
427
- # SupportedStyles: use_perl_names, use_english_names, use_builtin_english_names
428
- Style/SpecialGlobalVars:
429
- Exclude:
430
- - 'unitsdb/validate_schemas.rb'
431
-
432
- # Offense count: 2
433
- # This cop supports unsafe autocorrection (--autocorrect-all).
434
180
  # Configuration parameters: Mode.
435
181
  Style/StringConcatenation:
436
182
  Exclude:
437
183
  - 'lib/unitsml/utility.rb'
438
- - 'unitsdb/validate_schemas.rb'
439
-
440
- # Offense count: 2046
441
- # This cop supports safe autocorrection (--autocorrect).
442
- # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
443
- # SupportedStyles: single_quotes, double_quotes
444
- Style/StringLiterals:
445
- Enabled: false
446
-
447
- # Offense count: 1
448
- # This cop supports safe autocorrection (--autocorrect).
449
- # Configuration parameters: EnforcedStyle.
450
- # SupportedStyles: single_quotes, double_quotes
451
- Style/StringLiteralsInInterpolation:
452
- Exclude:
453
- - 'unitsdb/validate_schemas.rb'
454
-
455
- # Offense count: 235
456
- # This cop supports safe autocorrection (--autocorrect).
457
- # Configuration parameters: EnforcedStyleForMultiline.
458
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
459
- Style/TrailingCommaInArguments:
460
- Exclude:
461
- - 'lib/unitsml.rb'
462
- - 'lib/unitsml/dimension.rb'
463
- - 'lib/unitsml/number.rb'
464
- - 'lib/unitsml/parser.rb'
465
- - 'lib/unitsml/prefix.rb'
466
- - 'lib/unitsml/transform.rb'
467
- - 'lib/unitsml/unit.rb'
468
- - 'spec/unitsml/conv/plurimath_spec.rb'
469
- - 'spec/unitsml/parser_spec.rb'
470
-
471
- # Offense count: 132
472
- # This cop supports safe autocorrection (--autocorrect).
473
- # Configuration parameters: EnforcedStyleForMultiline.
474
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
475
- Style/TrailingCommaInArrayLiteral:
476
- Exclude:
477
- - 'lib/unitsml.rb'
478
- - 'lib/unitsml/transform.rb'
479
- - 'spec/unitsml/conv/plurimath_spec.rb'
480
- - 'spec/unitsml/parser_spec.rb'
481
-
482
- # Offense count: 5
483
- # This cop supports safe autocorrection (--autocorrect).
484
- # Configuration parameters: EnforcedStyleForMultiline.
485
- # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
486
- Style/TrailingCommaInHashLiteral:
487
- Exclude:
488
- - 'lib/unitsml.rb'
489
- - 'lib/unitsml/dimension.rb'
490
- - 'lib/unitsml/extender.rb'
491
- - 'lib/unitsml/number.rb'
492
-
493
- # Offense count: 17
494
- # This cop supports safe autocorrection (--autocorrect).
495
- # Configuration parameters: AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
496
- # URISchemes: http, https
497
- Layout/LineLength:
498
- Max: 215
data/Gemfile CHANGED
@@ -1,20 +1,21 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- source 'https://rubygems.org'
3
+ source "https://rubygems.org"
4
4
 
5
5
  # Specify your gem's dependencies in unitsml.gemspec
6
6
  gemspec
7
7
 
8
- gem 'lutaml-model', '~> 0.8.0', github: 'lutaml/lutaml-model', branch: 'main'
9
-
10
- gem 'canon'
11
- gem 'mml', github: 'plurimath/mml', branch: 'main'
12
- gem 'oga'
13
- gem 'ox'
14
- gem 'unitsdb', github: 'unitsml/unitsdb-ruby', branch: 'main'
15
- gem 'plurimath', github: 'plurimath/plurimath', branch: 'rt-lutaml-080'
16
- gem 'pry'
17
- gem 'rake'
18
- gem 'rspec'
19
- gem 'rubocop'
20
- gem 'simplecov'
8
+ gem "canon"
9
+ gem "lutaml-model", "~> 0.8.0", github: "lutaml/lutaml-model", branch: "main"
10
+ gem "mml"
11
+ gem "oga"
12
+ gem "ox"
13
+ gem "plurimath", github: "plurimath/plurimath", branch: "rt-lutaml-080"
14
+ gem "pry"
15
+ gem "rake"
16
+ gem "rspec"
17
+ gem "rubocop"
18
+ gem "rubocop-performance"
19
+ gem "rubocop-rake"
20
+ gem "rubocop-rspec"
21
+ gem "simplecov"
data/Rakefile CHANGED
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'bundler/gem_tasks'
4
- require 'rspec/core/rake_task'
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
5
 
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
data/bin/console CHANGED
@@ -1,8 +1,8 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- require 'bundler/setup'
5
- require 'unitsml'
4
+ require "bundler/setup"
5
+ require "unitsml"
6
6
 
7
7
  # You can add fixtures and/or initialization code here to make experimenting
8
8
  # with your gem easier. You can also use a different console, if you like.
@@ -11,5 +11,5 @@ require 'unitsml'
11
11
  # require "pry"
12
12
  # Pry.start
13
13
 
14
- require 'irb'
14
+ require "irb"
15
15
  IRB.start(__FILE__)