asciimath2unitsml 0.2.4 → 0.3.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +2 -23
- data/.gitignore +1 -0
- data/.hound.yml +5 -0
- data/.rubocop.yml +10 -0
- data/Gemfile +1 -1
- data/README.adoc +4 -1
- data/Rakefile +1 -1
- data/asciimath2unitsml.gemspec +14 -17
- data/bin/rspec +1 -2
- data/lib/asciimath2unitsml.rb +0 -1
- data/lib/asciimath2unitsml/conv.rb +91 -61
- data/lib/asciimath2unitsml/parse.rb +74 -85
- data/lib/asciimath2unitsml/render.rb +24 -17
- data/lib/asciimath2unitsml/unit.rb +21 -17
- data/lib/asciimath2unitsml/validate.rb +57 -0
- data/lib/asciimath2unitsml/version.rb +1 -1
- data/lib/unitsdb_ruby/unitsdb.rb +21 -11
- data/spec/conv_spec.rb +1250 -986
- data/spec/spec_helper.rb +10 -10
- metadata +26 -22
data/spec/spec_helper.rb
CHANGED
@@ -1,13 +1,13 @@
|
|
1
|
-
require
|
2
|
-
|
3
|
-
SimpleCov.profiles.define
|
4
|
-
add_filter
|
5
|
-
add_filter
|
6
|
-
add_group
|
1
|
+
require "simplecov"
|
2
|
+
|
3
|
+
SimpleCov.profiles.define "gem" do
|
4
|
+
add_filter "/spec/"
|
5
|
+
add_filter "/autotest/"
|
6
|
+
add_group "Libraries", "/lib/"
|
7
7
|
end
|
8
|
-
SimpleCov.start
|
8
|
+
SimpleCov.start "gem"
|
9
9
|
|
10
|
-
require
|
10
|
+
require "asciimath2unitsml"
|
11
11
|
require "rspec/matchers"
|
12
12
|
require "equivalent-xml/rspec_matchers"
|
13
13
|
require "rexml/document"
|
@@ -24,10 +24,10 @@ RSpec.configure do |config|
|
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
27
|
-
def xmlpp(
|
27
|
+
def xmlpp(xml)
|
28
28
|
s = ""
|
29
29
|
f = REXML::Formatters::Pretty.new(2)
|
30
30
|
f.compact = true
|
31
|
-
f.write(REXML::Document.new(
|
31
|
+
f.write(REXML::Document.new(xml), s)
|
32
32
|
s
|
33
33
|
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.
|
4
|
+
version: 0.3.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-
|
11
|
+
date: 2021-06-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: asciimath
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: 1.
|
47
|
+
version: '1.11'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: 1.
|
54
|
+
version: '1.11'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: rsec
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,6 +150,20 @@ dependencies:
|
|
150
150
|
- - "~>"
|
151
151
|
- !ruby/object:Gem::Version
|
152
152
|
version: '12.0'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: rexml
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - ">="
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - ">="
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
168
|
name: rspec
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -168,16 +182,16 @@ dependencies:
|
|
168
182
|
name: rubocop
|
169
183
|
requirement: !ruby/object:Gem::Requirement
|
170
184
|
requirements:
|
171
|
-
- -
|
185
|
+
- - "~>"
|
172
186
|
- !ruby/object:Gem::Version
|
173
|
-
version:
|
187
|
+
version: 1.5.2
|
174
188
|
type: :development
|
175
189
|
prerelease: false
|
176
190
|
version_requirements: !ruby/object:Gem::Requirement
|
177
191
|
requirements:
|
178
|
-
- -
|
192
|
+
- - "~>"
|
179
193
|
- !ruby/object:Gem::Version
|
180
|
-
version:
|
194
|
+
version: 1.5.2
|
181
195
|
- !ruby/object:Gem::Dependency
|
182
196
|
name: simplecov
|
183
197
|
requirement: !ruby/object:Gem::Requirement
|
@@ -206,20 +220,6 @@ dependencies:
|
|
206
220
|
- - "~>"
|
207
221
|
- !ruby/object:Gem::Version
|
208
222
|
version: '0.9'
|
209
|
-
- !ruby/object:Gem::Dependency
|
210
|
-
name: rexml
|
211
|
-
requirement: !ruby/object:Gem::Requirement
|
212
|
-
requirements:
|
213
|
-
- - ">="
|
214
|
-
- !ruby/object:Gem::Version
|
215
|
-
version: '0'
|
216
|
-
type: :development
|
217
|
-
prerelease: false
|
218
|
-
version_requirements: !ruby/object:Gem::Requirement
|
219
|
-
requirements:
|
220
|
-
- - ">="
|
221
|
-
- !ruby/object:Gem::Version
|
222
|
-
version: '0'
|
223
223
|
description: 'Convert Asciimath via MathML to UnitsML
|
224
224
|
|
225
225
|
'
|
@@ -230,7 +230,10 @@ extensions: []
|
|
230
230
|
extra_rdoc_files: []
|
231
231
|
files:
|
232
232
|
- ".github/workflows/rake.yml"
|
233
|
+
- ".gitignore"
|
233
234
|
- ".gitmodules"
|
235
|
+
- ".hound.yml"
|
236
|
+
- ".rubocop.yml"
|
234
237
|
- Gemfile
|
235
238
|
- LICENSE
|
236
239
|
- README.adoc
|
@@ -243,6 +246,7 @@ files:
|
|
243
246
|
- lib/asciimath2unitsml/render.rb
|
244
247
|
- lib/asciimath2unitsml/string.rb
|
245
248
|
- lib/asciimath2unitsml/unit.rb
|
249
|
+
- lib/asciimath2unitsml/validate.rb
|
246
250
|
- lib/asciimath2unitsml/version.rb
|
247
251
|
- lib/unitsdb/dimensions.yaml
|
248
252
|
- lib/unitsdb/prefixes.yaml
|