mml 1.0.0 → 1.0.2
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/mml/configuration.rb +1 -4
- data/lib/mml/math_with_namespace.rb +4 -0
- data/lib/mml/math_with_nil_namespace.rb +4 -0
- data/lib/mml/mml.rb +9 -1
- data/lib/mml/mn.rb +1 -1
- data/lib/mml/version.rb +1 -1
- data/mml.gemspec +1 -1
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 88f5cead9c67648d4832c53955d29c71ed5ce9effc4d949ec4fde1ef029e1c08
|
4
|
+
data.tar.gz: 2223572c63e4cd432ce8f92e6e9174fac687f92b5a18d9f701cc501b8b3843b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac0a7546e651f323eaad7e1a76899309bb0e8f1856de2b8f180d0d7b16666cbfddf89990d6256fc23ec796603e09ec902c4947e87ae3e646aa61ea42d867de0
|
7
|
+
data.tar.gz: e3915cfc2aaae307091e797c2db31584047cf38bd26d8b205752fc82270cfeb4d7d528ee53db86b343e01cc8ec2787bb3de10ba6f5d6e8bac6988de0eb5fcc45
|
data/lib/mml/configuration.rb
CHANGED
@@ -57,10 +57,7 @@ module Mml
|
|
57
57
|
end
|
58
58
|
|
59
59
|
def adapter=(adapter)
|
60
|
-
Lutaml::Model::Config.
|
61
|
-
require "lutaml/model/xml_adapter/#{adapter.downcase}_adapter"
|
62
|
-
config.xml_adapter = Lutaml::Model::XmlAdapter.const_get("#{adapter.to_s.capitalize}Adapter")
|
63
|
-
end
|
60
|
+
Lutaml::Model::Config.xml_adapter_type = adapter.downcase
|
64
61
|
end
|
65
62
|
|
66
63
|
def class_for(class_name)
|
@@ -8,6 +8,8 @@ module Mml
|
|
8
8
|
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
9
9
|
end
|
10
10
|
|
11
|
+
attribute :display, :string
|
12
|
+
|
11
13
|
xml do
|
12
14
|
root "math", mixed: true
|
13
15
|
namespace "http://www.w3.org/1998/Math/MathML", nil
|
@@ -15,6 +17,8 @@ module Mml
|
|
15
17
|
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
16
18
|
map_element tag.to_sym, to: :"#{tag}_value"
|
17
19
|
end
|
20
|
+
|
21
|
+
map_attribute :display, to: :display
|
18
22
|
end
|
19
23
|
end
|
20
24
|
end
|
@@ -8,12 +8,16 @@ module Mml
|
|
8
8
|
attribute :"#{tag}_value", Mml.const_get(tag.capitalize), collection: true
|
9
9
|
end
|
10
10
|
|
11
|
+
attribute :display, :string
|
12
|
+
|
11
13
|
xml do
|
12
14
|
root "math", mixed: true
|
13
15
|
|
14
16
|
Mml::Configuration::SUPPORTED_TAGS.each do |tag|
|
15
17
|
map_element tag.to_sym, to: :"#{tag}_value"
|
16
18
|
end
|
19
|
+
|
20
|
+
map_attribute :display, to: :display
|
17
21
|
end
|
18
22
|
end
|
19
23
|
end
|
data/lib/mml/mml.rb
CHANGED
@@ -1,5 +1,13 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
DEFAULT_ADAPTER = if RUBY_ENGINE == "opal"
|
4
|
+
require "lutaml/model/xml_adapter/oga_adapter"
|
5
|
+
:oga
|
6
|
+
else
|
7
|
+
require "lutaml/model/xml_adapter/ox_adapter"
|
8
|
+
:ox
|
9
|
+
end
|
10
|
+
|
3
11
|
module Mml
|
4
12
|
class Error < StandardError; end
|
5
13
|
|
@@ -10,7 +18,7 @@ module Mml
|
|
10
18
|
end
|
11
19
|
|
12
20
|
def parse(input, namespace_exist: true)
|
13
|
-
Configuration.adapter =
|
21
|
+
Configuration.adapter = DEFAULT_ADAPTER unless Configuration.adapter
|
14
22
|
|
15
23
|
if namespace_exist
|
16
24
|
Mml::MathWithNamespace.from_xml(input)
|
data/lib/mml/mn.rb
CHANGED
data/lib/mml/version.rb
CHANGED
data/mml.gemspec
CHANGED
@@ -30,6 +30,6 @@ Gem::Specification.new do |spec|
|
|
30
30
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
31
31
|
spec.require_paths = ["lib"]
|
32
32
|
|
33
|
-
spec.add_runtime_dependency "lutaml-model", "~> 0.
|
33
|
+
spec.add_runtime_dependency "lutaml-model", "~> 0.5"
|
34
34
|
spec.add_runtime_dependency "zeitwerk"
|
35
35
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2025-01-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: lutaml-model
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.5'
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: '0.
|
26
|
+
version: '0.5'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: zeitwerk
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -112,7 +112,7 @@ homepage: https://github.com/plurimath/mml
|
|
112
112
|
licenses:
|
113
113
|
- BSD-2-Clause
|
114
114
|
metadata: {}
|
115
|
-
post_install_message:
|
115
|
+
post_install_message:
|
116
116
|
rdoc_options: []
|
117
117
|
require_paths:
|
118
118
|
- lib
|
@@ -128,7 +128,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
128
128
|
version: '0'
|
129
129
|
requirements: []
|
130
130
|
rubygems_version: 3.3.27
|
131
|
-
signing_key:
|
131
|
+
signing_key:
|
132
132
|
specification_version: 4
|
133
133
|
summary: MathML parser by Plurimath.
|
134
134
|
test_files: []
|