asciimath2unitsml 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 559a334bc2dbe285ed496346392630e62b5c301fc23e521ff57a6f2161a3a0ed
4
- data.tar.gz: 981ab1de7d97ce54dd464d707217aab81bfb9be404686c52f3999ef3ec7f44af
3
+ metadata.gz: 161503157f4b3622c8bcae6ece418ed5f675a95f409d60017287017c923f7749
4
+ data.tar.gz: 48571d4a30ea4ade2f864178dcb473c9a636d71d5088b64a2356e3cbfa5f2886
5
5
  SHA512:
6
- metadata.gz: fa493805c784f5f18bad7b16eecaf4e4bac7667e72088f5cf712017c8693703a0006122c827e42f8b4665ad5c3a75d8a86bf79ed361409db5555b77f0694f0c5
7
- data.tar.gz: 8c0cf5a14e1cba4e915266c838fd2eb2f019009cab9b029f14241d89c2f9c0f78bcb53b7f03712324fccbc9f4914b8f9af461cdc65037c63ee919e7cba4b4a14
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
- @units[k].root&.any? { |x| x[:prefix] } || /\*|\^|\/|^1$/.match(k) || @units[k].prefixed
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(/[()]/, "") } |
@@ -1,3 +1,3 @@
1
1
  module Asciimath2UnitsML
2
- VERSION = '0.2.2'.freeze
2
+ VERSION = '0.2.3'.freeze
3
3
  end
@@ -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: "#NISTd85"
10446
+ dimension_url: "#NISTd80"
10443
10447
  short:
10444
10448
  root: false
10445
10449
  unit_system:
@@ -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.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-15 00:00:00.000000000 Z
11
+ date: 2021-03-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciimath