mml 2.0.0 → 2.0.1

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.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/lib/mml/version.rb +1 -1
  3. data/lib/mml.rb +34 -2
  4. metadata +2 -3
  5. data/lib/mml/mml.rb +0 -29
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 61f01527cff794e89026423ce41e07ec025df438d39c67695a30436e5891d501
4
- data.tar.gz: 9e50cfa754f65d87509ba48daffe9ec1c595aa9265e7886a9a0c2adbe5a5cd5b
3
+ metadata.gz: 4edc2cd98bf5ea40cd990bc2f7de88334fda8964d0d50b5c7a3347624276dca6
4
+ data.tar.gz: aaec60ab3f027aa98e7f1bc8690551714414f463802cd981c6f724da8c4c8e9a
5
5
  SHA512:
6
- metadata.gz: 4edbb08f519dee18a3a06d10d57dec5ce7602000a6baa62a41c84ba0f3bba5ec286e3fbefe89375f12f2c874370fd8cb9a219a63bec2a65669c3657820071b5c
7
- data.tar.gz: ccc67661fb1fbd4de41793847f127c896acace0384471d144847e329a220fd61c824181e0c844c31bba5c07ed2a7e89973b051d79eba729f3b447cd6621988fc
6
+ metadata.gz: d6db4bcf4ae1dd66116a5e6e5a90915f2e03ccf205840752fcf682f693e0078a46a38a89f5fa7178101d2fa0400c4638d3afda8561ecc6cdd7ec04f75b5b7b6f
7
+ data.tar.gz: 412834bc7a1872505e480d35c01a58c35cde48eeac5525239d6da2d0622e67597a2735ada95baf0f9fa77c4155c330e8597b98b960282e364d3399a8f5de37d3
data/lib/mml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Mml
4
- VERSION = "2.0.0"
4
+ VERSION = "2.0.1"
5
5
  end
data/lib/mml.rb CHANGED
@@ -2,8 +2,40 @@
2
2
 
3
3
  require "zeitwerk"
4
4
  require "lutaml/model"
5
- require_relative "mml/mml"
5
+
6
+ DEFAULT_ADAPTER = if RUBY_ENGINE == "opal"
7
+ require "lutaml/model/xml_adapter/oga_adapter"
8
+ :oga
9
+ else
10
+ require "lutaml/model/xml_adapter/ox_adapter"
11
+ :ox
12
+ end
6
13
 
7
14
  loader = Zeitwerk::Loader.for_gem(warn_on_extra_files: false)
8
- loader.ignore("#{__dir__}/lib/mml.rb")
9
15
  loader.setup
16
+
17
+ module Mml
18
+ class Error < StandardError; end
19
+
20
+ module_function
21
+
22
+ def config
23
+ Configuration.config
24
+ end
25
+
26
+ def parse(input, namespace_exist: true)
27
+ Configuration.adapter = DEFAULT_ADAPTER unless Configuration.adapter
28
+
29
+ if namespace_exist
30
+ Mml::MathWithNamespace.from_xml(input)
31
+ else
32
+ Mml::MathWithNilNamespace.from_xml(input)
33
+ end
34
+ end
35
+ end
36
+
37
+ begin
38
+ loader.eager_load(force: true)
39
+ rescue Zeitwerk::NameError => e
40
+ flunk e.message
41
+ 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: 2.0.0
4
+ version: 2.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-02-12 00:00:00.000000000 Z
11
+ date: 2025-02-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: lutaml-model
@@ -74,7 +74,6 @@ files:
74
74
  - lib/mml/mi.rb
75
75
  - lib/mml/mlabeledtr.rb
76
76
  - lib/mml/mlongdiv.rb
77
- - lib/mml/mml.rb
78
77
  - lib/mml/mmultiscripts.rb
79
78
  - lib/mml/mn.rb
80
79
  - lib/mml/mo.rb
data/lib/mml/mml.rb DELETED
@@ -1,29 +0,0 @@
1
- # frozen_string_literal: true
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
-
11
- module Mml
12
- class Error < StandardError; end
13
-
14
- module_function
15
-
16
- def config
17
- Configuration.config
18
- end
19
-
20
- def parse(input, namespace_exist: true)
21
- Configuration.adapter = DEFAULT_ADAPTER unless Configuration.adapter
22
-
23
- if namespace_exist
24
- Mml::MathWithNamespace.from_xml(input)
25
- else
26
- Mml::MathWithNilNamespace.from_xml(input)
27
- end
28
- end
29
- end