unitsml 0.6.0 → 0.6.1

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 (61) hide show
  1. checksums.yaml +4 -4
  2. data/.gitmodules +0 -3
  3. data/.rubocop_todo.yml +276 -279
  4. data/Gemfile +13 -13
  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 +6 -4
  34. data/lib/unitsml/unitsdb/dimensions.rb +4 -0
  35. data/lib/unitsml/unitsdb/unit.rb +2 -2
  36. data/lib/unitsml/unitsdb/units.rb +4 -0
  37. data/lib/unitsml/unitsdb.rb +8 -19
  38. data/lib/unitsml/utility.rb +81 -70
  39. data/lib/unitsml/version.rb +1 -1
  40. data/lib/unitsml.rb +31 -31
  41. data/unitsml.gemspec +22 -19
  42. metadata +5 -23
  43. data/unitsdb/Gemfile +0 -6
  44. data/unitsdb/LICENSE.md +0 -53
  45. data/unitsdb/README.adoc +0 -1253
  46. data/unitsdb/RELEASE-NOTES.adoc +0 -269
  47. data/unitsdb/dimensions.yaml +0 -1864
  48. data/unitsdb/prefixes.yaml +0 -874
  49. data/unitsdb/quantities.yaml +0 -3715
  50. data/unitsdb/scales.yaml +0 -97
  51. data/unitsdb/schemas/README.md +0 -159
  52. data/unitsdb/schemas/dimensions-schema.yaml +0 -153
  53. data/unitsdb/schemas/prefixes-schema.yaml +0 -155
  54. data/unitsdb/schemas/quantities-schema.yaml +0 -117
  55. data/unitsdb/schemas/scales-schema.yaml +0 -106
  56. data/unitsdb/schemas/unit_systems-schema.yaml +0 -116
  57. data/unitsdb/schemas/units-schema.yaml +0 -215
  58. data/unitsdb/spec/units_spec.rb +0 -22
  59. data/unitsdb/unit_systems.yaml +0 -78
  60. data/unitsdb/units.yaml +0 -14052
  61. data/unitsdb/validate_schemas.rb +0 -203
data/.rubocop_todo.yml CHANGED
@@ -1,382 +1,400 @@
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-03 23:07:18 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: 6
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
16
+ # Offense count: 1
17
17
  # This cop supports safe autocorrection (--autocorrect).
18
- # Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation.
19
- Gemspec/OrderedDependencies:
18
+ Gemspec/RequireMFA:
20
19
  Exclude:
21
20
  - 'unitsml.gemspec'
22
21
 
23
- # Offense count: 2
22
+ # Offense count: 1
23
+ Gemspec/RequiredRubyVersion:
24
+ Exclude:
25
+ - 'unitsml.gemspec'
26
+
27
+ # Offense count: 23
24
28
  # This cop supports safe autocorrection (--autocorrect).
25
29
  # Configuration parameters: EnforcedStyle, IndentationWidth.
26
30
  # SupportedStyles: with_first_argument, with_fixed_indentation
27
31
  Layout/ArgumentAlignment:
28
32
  Exclude:
29
- - 'spec/unitsml/parser_spec.rb'
30
- - 'unitsdb/validate_schemas.rb'
33
+ - 'lib/unitsml/formula.rb'
34
+ - 'lib/unitsml/model/dimension_quantities.rb'
35
+ - 'lib/unitsml/model/units/symbol.rb'
36
+ - 'lib/unitsml/parse.rb'
37
+ - 'lib/unitsml/unit.rb'
38
+ - 'lib/unitsml/utility.rb'
39
+ - 'spec/unitsml/conv/mathml_spec.rb'
40
+ - 'spec/unitsml/conv/plurimath_spec.rb'
31
41
 
32
- # Offense count: 59
42
+ # Offense count: 1
33
43
  # This cop supports safe autocorrection (--autocorrect).
34
44
  # Configuration parameters: EnforcedStyle, IndentationWidth.
35
45
  # SupportedStyles: with_first_element, with_fixed_indentation
36
46
  Layout/ArrayAlignment:
37
47
  Exclude:
38
- - 'spec/unitsml/conv/plurimath_spec.rb'
39
- - 'spec/unitsml/parser_spec.rb'
48
+ - 'lib/unitsml/unit.rb'
40
49
 
41
- # Offense count: 8
50
+ # Offense count: 49
42
51
  # This cop supports safe autocorrection (--autocorrect).
43
52
  # Configuration parameters: EnforcedStyleAlignWith.
44
53
  # SupportedStylesAlignWith: either, start_of_block, start_of_line
45
54
  Layout/BlockAlignment:
46
55
  Exclude:
56
+ - 'lib/unitsml/formula.rb'
47
57
  - 'lib/unitsml/intermediate_exp_rules.rb'
58
+ - 'lib/unitsml/parse.rb'
59
+ - 'lib/unitsml/prefix.rb'
60
+ - 'lib/unitsml/unitsdb/dimension.rb'
61
+ - 'lib/unitsml/utility.rb'
62
+ - 'spec/unitsml/conv/html_spec.rb'
48
63
  - 'spec/unitsml/conv/latex_spec.rb'
49
- - 'spec/unitsml/conv/plurimath_spec.rb'
64
+ - 'spec/unitsml/conv/unicode_spec.rb'
65
+ - 'spec/unitsml/parse_spec.rb'
66
+ - 'unitsml.gemspec'
50
67
 
51
- # Offense count: 8
68
+ # Offense count: 48
52
69
  # This cop supports safe autocorrection (--autocorrect).
53
70
  Layout/BlockEndNewline:
54
71
  Exclude:
72
+ - 'lib/unitsml/formula.rb'
55
73
  - 'lib/unitsml/intermediate_exp_rules.rb'
74
+ - 'lib/unitsml/parse.rb'
75
+ - 'lib/unitsml/prefix.rb'
76
+ - 'lib/unitsml/unitsdb/dimension.rb'
77
+ - 'lib/unitsml/utility.rb'
78
+ - 'spec/unitsml/conv/html_spec.rb'
56
79
  - 'spec/unitsml/conv/latex_spec.rb'
57
- - 'spec/unitsml/conv/plurimath_spec.rb'
80
+ - 'spec/unitsml/conv/unicode_spec.rb'
81
+ - 'spec/unitsml/parse_spec.rb'
82
+ - 'unitsml.gemspec'
58
83
 
59
- # Offense count: 1
84
+ # Offense count: 2
60
85
  # This cop supports safe autocorrection (--autocorrect).
61
86
  Layout/ClosingParenthesisIndentation:
62
87
  Exclude:
63
- - 'spec/unitsml/conv/plurimath_spec.rb'
88
+ - 'lib/unitsml/parse.rb'
89
+ - 'lib/unitsml/utility.rb'
64
90
 
65
91
  # Offense count: 2
66
92
  # This cop supports safe autocorrection (--autocorrect).
67
- Layout/ElseAlignment:
93
+ # Configuration parameters: AllowForAlignment.
94
+ Layout/CommentIndentation:
68
95
  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
96
+ - 'spec/unitsml/conv/html_spec.rb'
76
97
 
77
- # Offense count: 5
98
+ # Offense count: 2
78
99
  # This cop supports safe autocorrection (--autocorrect).
79
100
  Layout/EmptyLines:
80
101
  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'
93
- - 'spec/unitsml/conv/html_spec.rb'
94
- - 'spec/unitsml/conv/latex_spec.rb'
95
102
  - 'spec/unitsml/conv/mathml_spec.rb'
96
- - 'spec/unitsml/conv/plurimath_spec.rb'
97
- - 'spec/unitsml/conv/unicode_spec.rb'
98
103
  - '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
104
 
108
105
  # Offense count: 2
109
106
  # 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
107
  # Configuration parameters: EnforcedStyle, IndentationWidth.
117
- # SupportedStyles: special_inside_parentheses, consistent, align_brackets
118
- Layout/FirstArrayElementIndentation:
108
+ # SupportedStyles: consistent, consistent_relative_to_receiver, special_for_inner_method_call, special_for_inner_method_call_in_parentheses
109
+ Layout/FirstArgumentIndentation:
119
110
  Exclude:
120
- - 'spec/unitsml/conv/plurimath_spec.rb'
121
- - 'spec/unitsml/parser_spec.rb'
111
+ - 'lib/unitsml/parse.rb'
112
+ - 'lib/unitsml/utility.rb'
122
113
 
123
- # Offense count: 1
114
+ # Offense count: 11
124
115
  # This cop supports safe autocorrection (--autocorrect).
125
- Layout/HeredocIndentation:
116
+ # Configuration parameters: AllowMultipleStyles, EnforcedHashRocketStyle, EnforcedColonStyle, EnforcedLastArgumentHashStyle.
117
+ # SupportedHashRocketStyles: key, separator, table
118
+ # SupportedColonStyles: key, separator, table
119
+ # SupportedLastArgumentHashStyles: always_inspect, always_ignore, ignore_implicit, ignore_explicit
120
+ Layout/HashAlignment:
126
121
  Exclude:
127
- - 'spec/unitsml/conv/xml_spec.rb'
122
+ - 'lib/unitsml/formula.rb'
123
+ - 'lib/unitsml/model/units/symbol.rb'
124
+ - 'lib/unitsml/utility.rb'
125
+ - 'spec/unitsml/conv/mathml_spec.rb'
128
126
 
129
- # Offense count: 2
127
+ # Offense count: 7
130
128
  # This cop supports safe autocorrection (--autocorrect).
131
129
  # Configuration parameters: EnforcedStyle.
132
130
  # SupportedStyles: normal, indented_internal_methods
133
131
  Layout/IndentationConsistency:
134
132
  Exclude:
135
- - 'unitsdb/validate_schemas.rb'
133
+ - 'spec/unitsml/conv/html_spec.rb'
134
+ - 'unitsml.gemspec'
136
135
 
137
- # Offense count: 20
136
+ # Offense count: 97
138
137
  # This cop supports safe autocorrection (--autocorrect).
139
138
  # Configuration parameters: Width, EnforcedStyleAlignWith, AllowedPatterns.
140
139
  # SupportedStylesAlignWith: start_of_line, relative_to_receiver
141
140
  Layout/IndentationWidth:
142
141
  Exclude:
142
+ - 'lib/unitsml/formula.rb'
143
143
  - 'lib/unitsml/intermediate_exp_rules.rb'
144
- - 'lib/unitsml/number.rb'
144
+ - 'lib/unitsml/parse.rb'
145
+ - 'lib/unitsml/prefix.rb'
146
+ - 'lib/unitsml/unitsdb/dimension.rb'
147
+ - 'lib/unitsml/utility.rb'
148
+ - 'spec/unitsml/conv/html_spec.rb'
145
149
  - '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'
150
+ - 'spec/unitsml/conv/unicode_spec.rb'
151
+ - 'spec/unitsml/parse_spec.rb'
152
+ - 'unitsml.gemspec'
168
153
 
169
- # Offense count: 1
154
+ # Offense count: 148
170
155
  # This cop supports safe autocorrection (--autocorrect).
171
- # Configuration parameters: EnforcedStyle, EnforcedStyleForEmptyBraces.
172
- # SupportedStyles: space, no_space
173
- # SupportedStylesForEmptyBraces: space, no_space
174
- Layout/SpaceBeforeBlockBraces:
175
- Exclude:
176
- - 'spec/unitsml/parse_spec.rb'
156
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, AllowQualifiedName, URISchemes, AllowRBSInlineAnnotation, AllowCopDirectives, AllowedPatterns, SplitStrings.
157
+ # URISchemes: http, https
158
+ Layout/LineLength:
159
+ Enabled: false
177
160
 
178
- # Offense count: 4
161
+ # Offense count: 2
179
162
  # 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:
163
+ # Configuration parameters: EnforcedStyle.
164
+ # SupportedStyles: symmetrical, new_line, same_line
165
+ Layout/MultilineMethodCallBraceLayout:
184
166
  Exclude:
185
167
  - 'lib/unitsml/parse.rb'
186
- - 'spec/unitsml/parse_spec.rb'
168
+ - 'lib/unitsml/utility.rb'
187
169
 
188
- # Offense count: 1
170
+ # Offense count: 6
189
171
  # 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:
172
+ # Configuration parameters: EnforcedStyle, IndentationWidth.
173
+ # SupportedStyles: aligned, indented, indented_relative_to_receiver
174
+ Layout/MultilineMethodCallIndentation:
202
175
  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'
176
+ - 'lib/unitsml/utility.rb'
208
177
 
209
- # Offense count: 2
178
+ # Offense count: 23
210
179
  # This cop supports safe autocorrection (--autocorrect).
211
180
  # Configuration parameters: AllowInHeredoc.
212
181
  Layout/TrailingWhitespace:
213
182
  Exclude:
214
- - 'unitsdb/validate_schemas.rb'
183
+ - 'lib/unitsml/formula.rb'
184
+ - 'lib/unitsml/model/dimension_quantities.rb'
185
+ - 'lib/unitsml/model/units/symbol.rb'
186
+ - 'lib/unitsml/parse.rb'
187
+ - 'lib/unitsml/unit.rb'
188
+ - 'lib/unitsml/utility.rb'
189
+ - 'spec/unitsml/conv/mathml_spec.rb'
190
+ - 'spec/unitsml/conv/plurimath_spec.rb'
215
191
 
216
- # Offense count: 1
192
+ # Offense count: 21
217
193
  # This cop supports safe autocorrection (--autocorrect).
218
- # Configuration parameters: AllowedMethods.
219
- # AllowedMethods: present?, blank?, presence, try, try!, in?
220
- Lint/SafeNavigationChain:
194
+ Lint/AmbiguousOperatorPrecedence:
221
195
  Exclude:
196
+ - 'lib/unitsml/intermediate_exp_rules.rb'
222
197
  - 'lib/unitsml/parse.rb'
198
+ - 'lib/unitsml/utility.rb'
223
199
 
224
- # Offense count: 16
225
- # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
200
+ # Offense count: 19
201
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes, Max.
226
202
  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
203
+ Exclude:
204
+ - 'lib/unitsml/fenced.rb'
205
+ - 'lib/unitsml/formula.rb'
206
+ - 'lib/unitsml/parse.rb'
207
+ - 'lib/unitsml/parser.rb'
208
+ - 'lib/unitsml/unit.rb'
209
+ - 'lib/unitsml/utility.rb'
239
210
 
240
- # Offense count: 11
241
- # Configuration parameters: AllowedMethods, AllowedPatterns.
211
+ # Offense count: 13
212
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
242
213
  Metrics/CyclomaticComplexity:
243
- Max: 14
214
+ Exclude:
215
+ - 'lib/unitsml/formula.rb'
216
+ - 'lib/unitsml/parse.rb'
217
+ - 'lib/unitsml/parser.rb'
218
+ - 'lib/unitsml/utility.rb'
244
219
 
245
- # Offense count: 17
220
+ # Offense count: 14
246
221
  # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
247
222
  Metrics/MethodLength:
248
- Max: 47
249
-
250
- # Offense count: 1
251
- # Configuration parameters: CountComments, CountAsOne.
252
- Metrics/ModuleLength:
253
- Max: 290
223
+ Max: 20
254
224
 
255
225
  # Offense count: 1
256
226
  # Configuration parameters: CountKeywordArgs, MaxOptionalParameters.
257
227
  Metrics/ParameterLists:
258
228
  Max: 6
259
229
 
260
- # Offense count: 10
261
- # Configuration parameters: AllowedMethods, AllowedPatterns.
230
+ # Offense count: 9
231
+ # Configuration parameters: AllowedMethods, AllowedPatterns, Max.
262
232
  Metrics/PerceivedComplexity:
263
- Max: 14
233
+ Exclude:
234
+ - 'lib/unitsml/formula.rb'
235
+ - 'lib/unitsml/parse.rb'
236
+ - 'lib/unitsml/parser.rb'
237
+ - 'lib/unitsml/utility.rb'
238
+
239
+ # Offense count: 3
240
+ # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
241
+ # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
242
+ Naming/MethodParameterName:
243
+ Exclude:
244
+ - 'lib/unitsml/utility.rb'
264
245
 
265
246
  # Offense count: 1
266
- Naming/AccessorMethodName:
247
+ # Configuration parameters: MinSize.
248
+ Performance/CollectionLiteralInLoop:
249
+ Exclude:
250
+ - 'lib/unitsml/parser.rb'
251
+
252
+ # Offense count: 1
253
+ # This cop supports unsafe autocorrection (--autocorrect-all).
254
+ Performance/MapCompact:
267
255
  Exclude:
268
256
  - 'lib/unitsml/utility.rb'
269
257
 
270
- # Offense count: 7
258
+ # Offense count: 1
271
259
  # This cop supports safe autocorrection (--autocorrect).
272
- Naming/BinaryOperatorParameterName:
260
+ Performance/RedundantMatch:
273
261
  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'
262
+ - 'lib/unitsml/formula.rb'
281
263
 
282
264
  # Offense count: 2
283
- # This cop supports unsafe autocorrection (--autocorrect-all).
284
- # Configuration parameters: EnforcedStyleForLeadingUnderscores.
285
- # SupportedStylesForLeadingUnderscores: disallowed, required, optional
286
- Naming/MemoizedInstanceVariableName:
265
+ # This cop supports safe autocorrection (--autocorrect).
266
+ Performance/RegexpMatch:
287
267
  Exclude:
288
- - 'lib/unitsml/unitsdb/dimension.rb'
289
- - 'lib/unitsml/unitsdb/units.rb'
268
+ - 'lib/unitsml/formula.rb'
290
269
 
291
- # Offense count: 3
292
- # Configuration parameters: MinNameLength, AllowNamesEndingInNumbers, AllowedNames, ForbiddenNames.
293
- # AllowedNames: as, at, by, cc, db, id, if, in, io, ip, of, on, os, pp, to
294
- Naming/MethodParameterName:
270
+ # Offense count: 1
271
+ RSpec/AnyInstance:
295
272
  Exclude:
296
- - 'lib/unitsml/utility.rb'
273
+ - 'spec/unitsml/conv/plurimath_spec.rb'
297
274
 
298
- # Offense count: 14
275
+ # Offense count: 1
299
276
  # 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:
277
+ # Configuration parameters: EnforcedStyle.
278
+ # SupportedStyles: be, be_nil
279
+ RSpec/BeNil:
306
280
  Exclude:
307
- - 'lib/unitsml/intermediate_exp_rules.rb'
281
+ - 'spec/unitsml_spec.rb'
282
+
283
+ # Offense count: 2
284
+ RSpec/BeforeAfterAll:
285
+ Exclude:
286
+ - 'spec/unitsml/conv/mathml_spec.rb'
287
+ - 'spec/unitsml/conv/xml_spec.rb'
288
+
289
+ # Offense count: 366
290
+ # Configuration parameters: Prefixes, AllowedPatterns.
291
+ # Prefixes: when, with, without
292
+ RSpec/ContextWording:
293
+ Exclude:
294
+ - 'spec/unitsml/conv/asciimath_spec.rb'
295
+ - 'spec/unitsml/conv/html_spec.rb'
308
296
  - 'spec/unitsml/conv/latex_spec.rb'
297
+ - 'spec/unitsml/conv/mathml_spec.rb'
309
298
  - 'spec/unitsml/conv/plurimath_spec.rb'
299
+ - 'spec/unitsml/conv/unicode_spec.rb'
300
+ - 'spec/unitsml/conv/xml_spec.rb'
301
+ - 'spec/unitsml/parse_spec.rb'
302
+ - 'spec/unitsml/parser_spec.rb'
310
303
 
311
- # Offense count: 11
312
- Style/ClassVars:
304
+ # Offense count: 26
305
+ # This cop supports safe autocorrection (--autocorrect).
306
+ RSpec/EmptyLineAfterFinalLet:
313
307
  Exclude:
314
- - 'lib/unitsml/parse.rb'
315
- - 'lib/unitsml/unitsdb.rb'
308
+ - 'spec/unitsml/conv/mathml_spec.rb'
316
309
 
317
- # Offense count: 1
310
+ # Offense count: 3
318
311
  # This cop supports safe autocorrection (--autocorrect).
319
- # Configuration parameters: EnforcedStyle, SingleLineConditionsOnly, IncludeTernaryExpressions.
320
- # SupportedStyles: assign_to_condition, assign_inside_condition
321
- Style/ConditionalAssignment:
312
+ RSpec/EmptyLineAfterSubject:
322
313
  Exclude:
323
- - 'lib/unitsml/number.rb'
324
-
325
- # Offense count: 46
326
- # Configuration parameters: AllowedConstants.
327
- Style/Documentation:
328
- Enabled: false
314
+ - 'spec/unitsml/conv/mathml_spec.rb'
315
+ - 'spec/unitsml/conv/xml_spec.rb'
329
316
 
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
317
+ # Offense count: 5
318
+ # Configuration parameters: CountAsOne.
319
+ RSpec/ExampleLength:
320
+ Max: 7
336
321
 
337
- # Offense count: 1
322
+ # Offense count: 4
338
323
  # 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:
324
+ RSpec/LeadingSubject:
343
325
  Exclude:
344
- - 'Rakefile'
326
+ - 'spec/unitsml/conv/mathml_spec.rb'
327
+ - 'spec/unitsml/conv/xml_spec.rb'
328
+
329
+ # Offense count: 15
330
+ RSpec/MultipleExpectations:
331
+ Max: 6
345
332
 
346
333
  # Offense count: 1
347
334
  # This cop supports safe autocorrection (--autocorrect).
348
- # Configuration parameters: AllowIfModifier.
349
- Style/IfInsideElse:
335
+ RSpec/MultipleSubjects:
350
336
  Exclude:
351
- - 'unitsdb/validate_schemas.rb'
337
+ - 'spec/unitsml/conv/mathml_spec.rb'
352
338
 
353
- # Offense count: 3
354
- # This cop supports safe autocorrection (--autocorrect).
355
- Style/IfUnlessModifier:
339
+ # Offense count: 12
340
+ RSpec/RepeatedExampleGroupBody:
356
341
  Exclude:
357
- - 'lib/unitsml/unit.rb'
358
- - 'unitsdb/validate_schemas.rb'
342
+ - 'spec/unitsml/conv/asciimath_spec.rb'
343
+ - 'spec/unitsml/conv/unicode_spec.rb'
344
+ - 'spec/unitsml/conv/xml_spec.rb'
345
+ - 'spec/unitsml/parse_spec.rb'
359
346
 
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:
347
+ # Offense count: 4
348
+ RSpec/RepeatedExampleGroupDescription:
365
349
  Exclude:
366
- - 'lib/unitsml.rb'
350
+ - 'spec/unitsml/conv/mathml_spec.rb'
351
+ - 'spec/unitsml/parse_spec.rb'
367
352
 
368
- # Offense count: 1
369
- Style/MultilineBlockChain:
353
+ # Offense count: 7
354
+ # Configuration parameters: CustomTransform, IgnoreMethods, IgnoreMetadata, InflectorPath, EnforcedInflector.
355
+ # SupportedInflectors: default, active_support
356
+ RSpec/SpecFilePathFormat:
370
357
  Exclude:
358
+ - 'spec/unitsml/conv/asciimath_spec.rb'
359
+ - 'spec/unitsml/conv/html_spec.rb'
360
+ - 'spec/unitsml/conv/latex_spec.rb'
361
+ - 'spec/unitsml/conv/mathml_spec.rb'
362
+ - 'spec/unitsml/conv/plurimath_spec.rb'
363
+ - 'spec/unitsml/conv/unicode_spec.rb'
364
+ - 'spec/unitsml/conv/xml_spec.rb'
365
+
366
+ # Offense count: 83
367
+ # This cop supports safe autocorrection (--autocorrect).
368
+ # Configuration parameters: EnforcedStyle, ProceduralMethods, FunctionalMethods, AllowedMethods, AllowedPatterns, AllowBracesOnProceduralOneLiners, BracesRequiredMethods.
369
+ # SupportedStyles: line_count_based, semantic, braces_for_chaining, always_braces
370
+ # ProceduralMethods: benchmark, bm, bmbm, create, each_with_object, measure, new, realtime, tap, with_object
371
+ # FunctionalMethods: let, let!, subject, watch
372
+ # AllowedMethods: lambda, proc, it
373
+ Style/BlockDelimiters:
374
+ Exclude:
375
+ - 'lib/unitsml/formula.rb'
376
+ - 'lib/unitsml/intermediate_exp_rules.rb'
377
+ - 'lib/unitsml/parse.rb'
378
+ - 'lib/unitsml/prefix.rb'
379
+ - 'lib/unitsml/unitsdb/dimension.rb'
371
380
  - 'lib/unitsml/utility.rb'
381
+ - 'spec/unitsml/conv/html_spec.rb'
382
+ - 'spec/unitsml/conv/latex_spec.rb'
383
+ - 'spec/unitsml/conv/unicode_spec.rb'
384
+ - 'spec/unitsml/parse_spec.rb'
385
+ - 'unitsml.gemspec'
372
386
 
373
- # Offense count: 1
374
- # This cop supports unsafe autocorrection (--autocorrect-all).
375
- # Configuration parameters: EnforcedStyle.
376
- # SupportedStyles: literals, strict
377
- Style/MutableConstant:
387
+ # Offense count: 2
388
+ # This cop supports safe autocorrection (--autocorrect).
389
+ Style/MultilineIfModifier:
378
390
  Exclude:
379
- - 'lib/unitsml/version.rb'
391
+ - 'lib/unitsml/formula.rb'
392
+
393
+ # Offense count: 3
394
+ # This cop supports safe autocorrection (--autocorrect).
395
+ Style/NegatedIfElseCondition:
396
+ Exclude:
397
+ - 'lib/unitsml/utility.rb'
380
398
 
381
399
  # Offense count: 2
382
400
  # Configuration parameters: AllowedMethods.
@@ -387,72 +405,52 @@ Style/OptionalBooleanParameter:
387
405
  - 'lib/unitsml/prefix.rb'
388
406
 
389
407
  # Offense count: 1
390
- # This cop supports safe autocorrection (--autocorrect).
391
- Style/RedundantBegin:
408
+ # This cop supports unsafe autocorrection (--autocorrect-all).
409
+ Style/ReduceToHash:
392
410
  Exclude:
393
- - 'unitsdb/validate_schemas.rb'
411
+ - 'lib/unitsml/utility.rb'
394
412
 
395
413
  # Offense count: 1
396
- # This cop supports safe autocorrection (--autocorrect).
397
- Style/RedundantFreeze:
414
+ # This cop supports unsafe autocorrection (--autocorrect-all).
415
+ # Configuration parameters: Methods.
416
+ Style/RedundantArgument:
398
417
  Exclude:
399
- - 'lib/unitsml/version.rb'
418
+ - 'lib/unitsml/utility.rb'
400
419
 
401
- # Offense count: 2
420
+ # Offense count: 6
402
421
  # This cop supports safe autocorrection (--autocorrect).
403
- Style/RedundantParentheses:
422
+ Style/RedundantConstantBase:
404
423
  Exclude:
405
- - 'lib/unitsml/unitsdb/units.rb'
424
+ - 'lib/unitsml.rb'
406
425
 
407
- # Offense count: 2
426
+ # Offense count: 3
408
427
  # This cop supports safe autocorrection (--autocorrect).
409
- # Configuration parameters: EnforcedStyle, AllowInnerSlashes.
410
- # SupportedStyles: slashes, percent_r, mixed
411
- Style/RegexpLiteral:
412
- Exclude:
413
- - 'lib/unitsml/parser.rb'
414
- - 'lib/unitsml/unitsdb/units.rb'
415
-
416
- # Offense count: 1
417
- # This cop supports unsafe autocorrection (--autocorrect-all).
418
- # Configuration parameters: ConvertCodeThatCanStartToReturnNil, AllowedMethods, MaxChainLength.
419
- # AllowedMethods: present?, blank?, presence, try, try!
420
- Style/SafeNavigation:
428
+ Style/RedundantRegexpArgument:
421
429
  Exclude:
422
- - 'lib/unitsml/prefix.rb'
430
+ - 'lib/unitsml/utility.rb'
423
431
 
424
432
  # 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:
433
+ # Configuration parameters: Max.
434
+ Style/SafeNavigationChainLength:
429
435
  Exclude:
430
- - 'unitsdb/validate_schemas.rb'
436
+ - 'lib/unitsml/dimension.rb'
437
+ - 'lib/unitsml/parse.rb'
431
438
 
432
- # Offense count: 2
439
+ # Offense count: 1
433
440
  # This cop supports unsafe autocorrection (--autocorrect-all).
434
441
  # Configuration parameters: Mode.
435
442
  Style/StringConcatenation:
436
443
  Exclude:
437
444
  - 'lib/unitsml/utility.rb'
438
- - 'unitsdb/validate_schemas.rb'
439
445
 
440
- # Offense count: 2046
446
+ # Offense count: 2141
441
447
  # This cop supports safe autocorrection (--autocorrect).
442
448
  # Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
443
449
  # SupportedStyles: single_quotes, double_quotes
444
450
  Style/StringLiterals:
445
451
  Enabled: false
446
452
 
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
453
+ # Offense count: 258
456
454
  # This cop supports safe autocorrection (--autocorrect).
457
455
  # Configuration parameters: EnforcedStyleForMultiline.
458
456
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
@@ -465,21 +463,26 @@ Style/TrailingCommaInArguments:
465
463
  - 'lib/unitsml/prefix.rb'
466
464
  - 'lib/unitsml/transform.rb'
467
465
  - 'lib/unitsml/unit.rb'
466
+ - 'lib/unitsml/utility.rb'
467
+ - 'spec/unitsml/conv/asciimath_spec.rb'
468
+ - 'spec/unitsml/conv/html_spec.rb'
469
+ - 'spec/unitsml/conv/latex_spec.rb'
468
470
  - 'spec/unitsml/conv/plurimath_spec.rb'
469
471
  - 'spec/unitsml/parser_spec.rb'
470
472
 
471
- # Offense count: 132
473
+ # Offense count: 154
472
474
  # This cop supports safe autocorrection (--autocorrect).
473
475
  # Configuration parameters: EnforcedStyleForMultiline.
474
476
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
475
477
  Style/TrailingCommaInArrayLiteral:
476
478
  Exclude:
477
479
  - 'lib/unitsml.rb'
480
+ - 'lib/unitsml/formula.rb'
478
481
  - 'lib/unitsml/transform.rb'
479
482
  - 'spec/unitsml/conv/plurimath_spec.rb'
480
483
  - 'spec/unitsml/parser_spec.rb'
481
484
 
482
- # Offense count: 5
485
+ # Offense count: 11
483
486
  # This cop supports safe autocorrection (--autocorrect).
484
487
  # Configuration parameters: EnforcedStyleForMultiline.
485
488
  # SupportedStylesForMultiline: comma, consistent_comma, diff_comma, no_comma
@@ -489,10 +492,4 @@ Style/TrailingCommaInHashLiteral:
489
492
  - 'lib/unitsml/dimension.rb'
490
493
  - 'lib/unitsml/extender.rb'
491
494
  - '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
495
+ - 'lib/unitsml/utility.rb'