mml 1.0.0 → 1.0.2

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: 565c1e39fe3e4ac67501f0064c9685dae36c40339c12ed1d7d489a73fbdb8a73
4
- data.tar.gz: 1f7fb702767b86261862c161384b6f1f44899b31923285e3af00de766daae784
3
+ metadata.gz: 88f5cead9c67648d4832c53955d29c71ed5ce9effc4d949ec4fde1ef029e1c08
4
+ data.tar.gz: 2223572c63e4cd432ce8f92e6e9174fac687f92b5a18d9f701cc501b8b3843b6
5
5
  SHA512:
6
- metadata.gz: a06d4db0336c75b7c888c03c3c88fecba8bc0f4dd1622354b41d829a60ae0a5548b162bf9334320bac88984f7a77f043e909e0ff13c069d0debcff4f973ade23
7
- data.tar.gz: 0b3a278522ec51b683a0be41198909fe9f3a882148d053f4d444771dfb2cfe4ab6f16ed73cb11c30b89acbeb51fe56c935216e4527c7c9a71cd2436df3d3ce81
6
+ metadata.gz: 2ac0a7546e651f323eaad7e1a76899309bb0e8f1856de2b8f180d0d7b16666cbfddf89990d6256fc23ec796603e09ec902c4947e87ae3e646aa61ea42d867de0
7
+ data.tar.gz: e3915cfc2aaae307091e797c2db31584047cf38bd26d8b205752fc82270cfeb4d7d528ee53db86b343e01cc8ec2787bb3de10ba6f5d6e8bac6988de0eb5fcc45
@@ -57,10 +57,7 @@ module Mml
57
57
  end
58
58
 
59
59
  def adapter=(adapter)
60
- Lutaml::Model::Config.configure do |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 = :ox unless 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
@@ -4,7 +4,7 @@ module Mml
4
4
  class Mn < Lutaml::Model::Serializable
5
5
  model Mml::Configuration.class_for(:mn)
6
6
 
7
- attribute :value, :integer
7
+ attribute :value, :string
8
8
  attribute :mathcolor, :string
9
9
  attribute :mathbackground, :string
10
10
  attribute :mathvariant, :string
data/lib/mml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mml
4
- VERSION = "1.0.0"
4
+ VERSION = "1.0.2"
5
5
  end
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.3"
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.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: 2024-11-18 00:00:00.000000000 Z
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.3'
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.3'
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: []