asciimath2unitsml 0.2.2 → 0.2.3
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.
- checksums.yaml +4 -4
- data/lib/asciimath2unitsml/parse.rb +1 -1
- data/lib/asciimath2unitsml/version.rb +1 -1
- data/lib/unitsdb/units.yaml +5 -1
- data/lib/unitsdb_ruby/unitsdb.rb +1 -0
- 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: 161503157f4b3622c8bcae6ece418ed5f675a95f409d60017287017c923f7749
|
|
4
|
+
data.tar.gz: 48571d4a30ea4ade2f864178dcb473c9a636d71d5088b64a2356e3cbfa5f2886
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: a50f75b036f2a19dcd1925965f192d1652ddabc242ce22c33efcfaf0d03c0ee5118c46021f22ee02237f93e5e32492c922466fd7f3206a20713c7a2bf749e6ef
|
|
7
|
+
data.tar.gz: 279f88fb13d2ed6961b42fec192312b52b82d993daf4efa2750de21b2e240b2b63702d82dac831e4dc3a0b86bd6b797cbbca057809d4c971eb27bf71548f9010
|
|
@@ -87,7 +87,7 @@ module Asciimath2UnitsML
|
|
|
87
87
|
prefix2 = /#{@prefixes.keys.select { |x| x.size == 2 }.join("|")}/.r
|
|
88
88
|
prefix1 = /#{@prefixes.keys.select { |x| x.size == 1 }.join("|")}/.r
|
|
89
89
|
unit_keys = @units.keys.reject do |k|
|
|
90
|
-
|
|
90
|
+
/\*|\^|\/|^1$/.match(k) || @units[k].prefixed
|
|
91
91
|
end.map { |k| Regexp.escape(k) }
|
|
92
92
|
unit1 = /#{unit_keys.sort_by(&:length).reverse.join("|")}/.r
|
|
93
93
|
exponent = /\^\(-?\d+\)/.r.map { |m| m.sub(/\^/, "").gsub(/[()]/, "") } |
|
data/lib/unitsdb/units.yaml
CHANGED
|
@@ -1745,6 +1745,7 @@
|
|
|
1745
1745
|
dimension_url: "#NISTd15"
|
|
1746
1746
|
short:
|
|
1747
1747
|
root: false
|
|
1748
|
+
prefixed: true
|
|
1748
1749
|
unit_system:
|
|
1749
1750
|
type: "non-SI_acceptable"
|
|
1750
1751
|
name: "non-SI"
|
|
@@ -2046,6 +2047,7 @@
|
|
|
2046
2047
|
dimension_url: "#NISTd16"
|
|
2047
2048
|
short:
|
|
2048
2049
|
root: false
|
|
2050
|
+
prefixed: true
|
|
2049
2051
|
unit_system:
|
|
2050
2052
|
type: "non-SI_not_acceptable"
|
|
2051
2053
|
name: "non-SI"
|
|
@@ -2398,6 +2400,7 @@
|
|
|
2398
2400
|
dimension_url: "#NISTd14"
|
|
2399
2401
|
short:
|
|
2400
2402
|
root: false
|
|
2403
|
+
prefixed: true
|
|
2401
2404
|
unit_system:
|
|
2402
2405
|
type: "non-SI_not_acceptable"
|
|
2403
2406
|
name: "non-SI"
|
|
@@ -9981,6 +9984,7 @@
|
|
|
9981
9984
|
dimension_url: "#NISTd56"
|
|
9982
9985
|
short:
|
|
9983
9986
|
root: false
|
|
9987
|
+
prefixed: true
|
|
9984
9988
|
unit_system:
|
|
9985
9989
|
type: "non-SI_not_acceptable"
|
|
9986
9990
|
name: "non-SI"
|
|
@@ -10439,7 +10443,7 @@
|
|
|
10439
10443
|
url: "#NISTq1"
|
|
10440
10444
|
|
|
10441
10445
|
"NISTu400":
|
|
10442
|
-
dimension_url: "#
|
|
10446
|
+
dimension_url: "#NISTd80"
|
|
10443
10447
|
short:
|
|
10444
10448
|
root: false
|
|
10445
10449
|
unit_system:
|
data/lib/unitsdb_ruby/unitsdb.rb
CHANGED
|
@@ -135,6 +135,7 @@ module UnitsDB
|
|
|
135
135
|
@root = hash[:root_units][:enumerated_root_units]
|
|
136
136
|
hash[:quantity_reference] and @quantities = hash[:quantity_reference].map { |x| x[:url].sub(/^#/, "") }
|
|
137
137
|
hash[:si_derived_bases] and @si_derived_bases = hash[:si_derived_bases]
|
|
138
|
+
@prefixed = (hash[:prefixed] == true)
|
|
138
139
|
rescue
|
|
139
140
|
raise StandardError.new "Parse fail on Unit #{id}: #{hash}"
|
|
140
141
|
end
|
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.2.
|
|
4
|
+
version: 0.2.3
|
|
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-03-
|
|
11
|
+
date: 2021-03-16 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: asciimath
|