asciimath2unitsml 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/asciimath2unitsml/conv.rb +1 -1
- data/lib/asciimath2unitsml/version.rb +1 -1
- data/spec/conv_spec.rb +53 -53
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '049ec45166f29cb157a85f9a5d3ac4ec6b1235ed1e673879623477b0b793c402'
|
4
|
+
data.tar.gz: 1671804ae7f17bc92268b7c77f7206d216f0c7b08a4318d7e9a3df116f45c47c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a4f6944f43e7a5336b648d8db1027bd93b4672d2ac22f90dc7277d4a6553959623db23b043bbd792cf9c4b351862980cee35b0828d44ac060ec21207fe7bf41
|
7
|
+
data.tar.gz: 8c8836120abac3f0a3fa49877efe3619c188af201e82d3afd37e56327063c624e629ac953b96eb5842cadf7186c354827773979d0291d94ab346ee528f699283
|
@@ -24,7 +24,7 @@ module Asciimath2UnitsML
|
|
24
24
|
def multiplier(x)
|
25
25
|
case x
|
26
26
|
when :space
|
27
|
-
{ html: "
|
27
|
+
{ html: " ", mathml: "<mo rspace='thickmathspace'>⁢</mo>" }
|
28
28
|
when :nospace
|
29
29
|
{ html: "", mathml: "<mo>⁢</mo>" }
|
30
30
|
else
|
data/spec/conv_spec.rb
CHANGED
@@ -315,59 +315,59 @@ RSpec.describe Asciimath2UnitsML do
|
|
315
315
|
1 "unitsml(kg*s^-2)"
|
316
316
|
INPUT
|
317
317
|
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
347
|
-
|
348
|
-
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
366
|
-
|
367
|
-
|
368
|
-
|
369
|
-
|
370
|
-
</math>
|
318
|
+
<mn>1</mn>
|
319
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
320
|
+
<mrow xref='U_kg.s-2'>
|
321
|
+
<mi mathvariant='normal'>kg</mi>
|
322
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
323
|
+
<msup>
|
324
|
+
<mrow>
|
325
|
+
<mi mathvariant='normal'>s</mi>
|
326
|
+
</mrow>
|
327
|
+
<mrow>
|
328
|
+
<mo>−</mo>
|
329
|
+
<mn>2</mn>
|
330
|
+
</mrow>
|
331
|
+
</msup>
|
332
|
+
</mrow>
|
333
|
+
<Unit xmlns='http://unitsml.nist.gov/2005' xml:id='U_kg.s-2' dimensionURL='#D_MT-2'>
|
334
|
+
<UnitSystem name='SI' type='SI_derived' xml:lang='en-US'/>
|
335
|
+
<UnitName xml:lang='en'>kg*s^-2</UnitName>
|
336
|
+
<UnitSymbol type='HTML'>
|
337
|
+
kg s
|
338
|
+
<sup>−2</sup>
|
339
|
+
</UnitSymbol>
|
340
|
+
<UnitSymbol type='MathML'>
|
341
|
+
<math xmlns='http://www.w3.org/1998/Math/MathML'>
|
342
|
+
<mrow>
|
343
|
+
<mi mathvariant='normal'>kg</mi>
|
344
|
+
<mo rspace='thickmathspace'>⁢</mo>
|
345
|
+
<msup>
|
346
|
+
<mrow>
|
347
|
+
<mi mathvariant='normal'>s</mi>
|
348
|
+
</mrow>
|
349
|
+
<mrow>
|
350
|
+
<mo>−</mo>
|
351
|
+
<mn>2</mn>
|
352
|
+
</mrow>
|
353
|
+
</msup>
|
354
|
+
</mrow>
|
355
|
+
</math>
|
356
|
+
</UnitSymbol>
|
357
|
+
<RootUnits>
|
358
|
+
<EnumeratedRootUnit unit='gram' prefix='k'/>
|
359
|
+
<EnumeratedRootUnit unit='second' powerNumerator='-2'/>
|
360
|
+
</RootUnits>
|
361
|
+
</Unit>
|
362
|
+
<Prefix xmlns='http://unitsml.nist.gov/2005' prefixBase='10' prefixPower='3' xml:id='NISTp10_3'>
|
363
|
+
<PrefixName xml:lang='en'>kilo</PrefixName>
|
364
|
+
<PrefixSymbol type='ASCII'>k</PrefixSymbol>
|
365
|
+
</Prefix>
|
366
|
+
<Dimension xmlns='http://unitsml.nist.gov/2005' xml:id='D_MT-2'>
|
367
|
+
<Mass symbol='M' powerNumerator='1'/>
|
368
|
+
<Time symbol='T' powerNumerator='-2'/>
|
369
|
+
</Dimension>
|
370
|
+
</math>
|
371
371
|
OUTPUT
|
372
372
|
expect(xmlpp(Asciimath2UnitsML::Conv.new(multiplier: :nospace).Asciimath2UnitsML(<<~INPUT))).to be_equivalent_to xmlpp(<<~OUTPUT)
|
373
373
|
1 "unitsml(kg*s^-2)"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: asciimath2unitsml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-02-
|
11
|
+
date: 2021-02-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|