moxml 0.5.178 → 0.6.0
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/.github/workflows/nightly-fuzz.yml +0 -14
- data/.github/workflows/performance-release.yml +0 -13
- data/.github/workflows/performance.yml +0 -17
- data/.github/workflows/rake.yml +0 -38
- data/.github/workflows/round-trip.yml +0 -45
- data/.github/workflows/windows.yml +0 -12
- data/Gemfile +4 -14
- data/README.adoc +5 -388
- data/Rakefile +2 -179
- data/docs/_references/processing-model.adoc +3 -2
- data/lib/moxml/adapter/customized_oga.rb +6 -4
- data/lib/moxml/adapter/customized_rexml.rb +5 -3
- data/lib/moxml/adapter/headed_ox.rb +0 -2
- data/lib/moxml/adapter/leptris.rb +0 -2
- data/lib/moxml/adapter/libxml.rb +0 -2
- data/lib/moxml/adapter/nokogiri.rb +0 -2
- data/lib/moxml/adapter/ox.rb +0 -2
- data/lib/moxml/adapter/rexml.rb +1 -3
- data/lib/moxml/adapter.rb +1 -6
- data/lib/moxml/config.rb +0 -17
- data/lib/moxml/entity_registry.rb +1 -5
- data/lib/moxml/native_attachment.rb +1 -3
- data/lib/moxml/version.rb +1 -1
- data/lib/moxml.rb +1 -2
- data/spec/moxml/adapter/platform_spec.rb +2 -47
- data/spec/moxml/native_attachment_spec.rb +4 -50
- data/spec/moxml/signature/edge_cases_spec.rb +0 -1
- data/spec/spec_helper.rb +13 -31
- metadata +1 -21
- data/.github/workflows/opal.yml +0 -61
- data/.gitmodules +0 -6
- data/lib/compat/opal/moxml_boot.rb +0 -68
- data/lib/compat/opal/rexml/namespace.rb +0 -59
- data/lib/compat/opal/rexml/parsers/baseparser.rb +0 -1016
- data/lib/compat/opal/rexml/source.rb +0 -214
- data/lib/compat/opal/rexml/text.rb +0 -426
- data/lib/compat/opal/rexml/xmltokens.rb +0 -45
- data/lib/compat/opal/rexml_compat.rb +0 -77
- data/lib/moxml/entity_registry_opal_data.rb +0 -2138
- data/lib/moxml/native_attachment/opal.rb +0 -38
- data/spec/moxml/native_attachment/opal_spec.rb +0 -66
- data/spec/moxml/opal_oga_adapter_spec.rb +0 -20
- data/spec/moxml/opal_oga_features_spec.rb +0 -212
- data/spec/moxml/opal_oga_smoke_spec.rb +0 -35
- data/spec/moxml/opal_rexml_adapter_spec.rb +0 -14
- data/spec/moxml/opal_smoke_spec.rb +0 -61
- data/spec/moxml/reference_opal_spec.rb +0 -29
- data/spec/moxml/signature_autoload_spec.rb +0 -52
- data/spec/support/opal.rb +0 -16
data/lib/moxml/adapter/libxml.rb
CHANGED
data/lib/moxml/adapter/ox.rb
CHANGED
data/lib/moxml/adapter/rexml.rb
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
require "rexml/document"
|
|
4
4
|
require "rexml/xpath"
|
|
5
5
|
require "rexml/streamlistener"
|
|
6
|
-
require "set"
|
|
7
|
-
require "stringio" if RUBY_ENGINE == "opal"
|
|
6
|
+
require "set"
|
|
8
7
|
|
|
9
8
|
module Moxml
|
|
10
9
|
module Adapter
|
|
@@ -697,7 +696,6 @@ module Moxml
|
|
|
697
696
|
end
|
|
698
697
|
|
|
699
698
|
def serialize(node, options = {})
|
|
700
|
-
output = StringIO.new("") if RUBY_ENGINE == "opal"
|
|
701
699
|
output ||= +""
|
|
702
700
|
|
|
703
701
|
if node.is_a?(::REXML::Document)
|
data/lib/moxml/adapter.rb
CHANGED
|
@@ -29,8 +29,6 @@ module Moxml
|
|
|
29
29
|
# canonical XML parser for the JavaScript runtime. REXML is also pure Ruby
|
|
30
30
|
# but requires extensive runtime compat shims (regex features like /n,
|
|
31
31
|
# \u{...}, (?-mix:...) don't transpile cleanly), so it is opt-in only.
|
|
32
|
-
OPAL_AVAILABLE_ADAPTERS = %i[oga rexml].freeze
|
|
33
|
-
|
|
34
32
|
# Registry mapping adapter names to their class name suffixes.
|
|
35
33
|
# Special cases (like :headed_ox → "HeadedOx") live here instead of
|
|
36
34
|
# a case statement, keeping the dispatch open for extension.
|
|
@@ -78,7 +76,7 @@ module Moxml
|
|
|
78
76
|
end
|
|
79
77
|
|
|
80
78
|
def platform_adapters
|
|
81
|
-
|
|
79
|
+
AVAILABLE_ADAPTERS
|
|
82
80
|
end
|
|
83
81
|
|
|
84
82
|
private
|
|
@@ -99,9 +97,6 @@ module Moxml
|
|
|
99
97
|
end
|
|
100
98
|
|
|
101
99
|
def require_adapter(name)
|
|
102
|
-
# Opal pre-loads all dependencies via the Rakefile; skip runtime require.
|
|
103
|
-
return if RUBY_ENGINE == "opal"
|
|
104
|
-
|
|
105
100
|
require "moxml/adapter/base"
|
|
106
101
|
require "moxml/adapter/#{name}"
|
|
107
102
|
rescue LoadError
|
data/lib/moxml/config.rb
CHANGED
|
@@ -16,8 +16,6 @@ module Moxml
|
|
|
16
16
|
# its C extension and cannot load there; otherwise rexml.
|
|
17
17
|
PREFERRED_ADAPTER = :leptris
|
|
18
18
|
FALLBACK_ADAPTER = :nokogiri
|
|
19
|
-
OPAL_DEFAULT_ADAPTER = :oga
|
|
20
|
-
OPAL_FALLBACK_ADAPTER = :rexml
|
|
21
19
|
|
|
22
20
|
# Entity loading modes:
|
|
23
21
|
# - :required - Must load entities, raise error if unavailable (default)
|
|
@@ -45,8 +43,6 @@ module Moxml
|
|
|
45
43
|
end
|
|
46
44
|
|
|
47
45
|
def runtime_default_adapter
|
|
48
|
-
return opal_runtime_adapter if RUBY_ENGINE == "opal"
|
|
49
|
-
|
|
50
46
|
preferred = leptris_preferred_available?
|
|
51
47
|
return PREFERRED_ADAPTER if preferred == true
|
|
52
48
|
|
|
@@ -68,19 +64,6 @@ module Moxml
|
|
|
68
64
|
detect_loaded_adapter || FALLBACK_ADAPTER
|
|
69
65
|
end
|
|
70
66
|
|
|
71
|
-
# Stock oga requires its C extension, so under Opal the oga
|
|
72
|
-
# adapter can only come from the vendored pure-Ruby fork — a
|
|
73
|
-
# repo-only artifact the released gem does not ship. Bundles
|
|
74
|
-
# that compiled it in (moxml's own harness) keep oga; everyone
|
|
75
|
-
# else gets the rexml adapter, whose Opal compat ships in-gem.
|
|
76
|
-
# `defined?` is safe here: this branch never runs under MRI,
|
|
77
|
-
# where it would trigger autoload resolution.
|
|
78
|
-
def opal_runtime_adapter
|
|
79
|
-
return OPAL_DEFAULT_ADAPTER if defined?(Moxml::Adapter::Oga)
|
|
80
|
-
|
|
81
|
-
OPAL_FALLBACK_ADAPTER
|
|
82
|
-
end
|
|
83
|
-
|
|
84
67
|
# True when the leptris gem is installed AND meets the adapter's
|
|
85
68
|
# binding floor (issue #149; 1.9.32 — traverse bounding #89,
|
|
86
69
|
# built-docs parts #91, and every capability surface the adapter
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
-
require "json"
|
|
3
|
+
require "json"
|
|
4
4
|
require "set"
|
|
5
5
|
|
|
6
6
|
module Moxml
|
|
@@ -107,10 +107,6 @@ module Moxml
|
|
|
107
107
|
# Load entity data from bundled gem data or local file
|
|
108
108
|
# @return [Hash{String => String}]
|
|
109
109
|
def load_entity_data
|
|
110
|
-
if RUBY_ENGINE == "opal"
|
|
111
|
-
return OPAL_ENTITY_DATA
|
|
112
|
-
end
|
|
113
|
-
|
|
114
110
|
# Try multiple paths in order of priority
|
|
115
111
|
paths_to_try = []
|
|
116
112
|
|
|
@@ -2,12 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
module Moxml
|
|
4
4
|
class NativeAttachment
|
|
5
|
-
autoload :Opal, "moxml/native_attachment/opal"
|
|
6
5
|
autoload :Native, "moxml/native_attachment/native"
|
|
7
6
|
|
|
8
7
|
def self.default_backend
|
|
9
|
-
|
|
10
|
-
const_get(constant).new
|
|
8
|
+
const_get(:Native).new
|
|
11
9
|
end
|
|
12
10
|
|
|
13
11
|
attr_reader :backend
|
data/lib/moxml/version.rb
CHANGED
data/lib/moxml.rb
CHANGED
|
@@ -91,7 +91,6 @@ module Moxml
|
|
|
91
91
|
autoload :EntityRegistry, "moxml/entity_registry"
|
|
92
92
|
# Opal has no autoload; the compat boot file requires this eagerly
|
|
93
93
|
# alongside the registry.
|
|
94
|
-
autoload :EntityRegistryOpalData, "moxml/entity_registry_opal_data"
|
|
95
94
|
autoload :NativeAttachment, "moxml/native_attachment"
|
|
96
95
|
autoload :XmlUtils, "moxml/xml_utils"
|
|
97
96
|
autoload :XmlEmitter, "moxml/xml_emitter"
|
|
@@ -101,7 +100,7 @@ module Moxml
|
|
|
101
100
|
autoload :Adapter, "moxml/adapter"
|
|
102
101
|
autoload :XPath, "moxml/xpath"
|
|
103
102
|
autoload :SAX, "moxml/sax"
|
|
104
|
-
autoload :Signature, "moxml/signature"
|
|
103
|
+
autoload :Signature, "moxml/signature"
|
|
105
104
|
autoload :C14n, "moxml/c14n"
|
|
106
105
|
autoload :Reference, "moxml/reference"
|
|
107
106
|
autoload :XSLT, "moxml/xslt"
|
|
@@ -9,7 +9,7 @@ RSpec.describe Moxml::Adapter do
|
|
|
9
9
|
:rexml, :ox)
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
-
it "uses the AVAILABLE_ADAPTERS constant
|
|
12
|
+
it "uses the AVAILABLE_ADAPTERS constant" do
|
|
13
13
|
expect(described_class.platform_adapters).to eq(Moxml::Adapter::AVAILABLE_ADAPTERS)
|
|
14
14
|
end
|
|
15
15
|
end
|
|
@@ -19,49 +19,9 @@ RSpec.describe Moxml::Adapter do
|
|
|
19
19
|
expect(described_class.available?(:oga)).to be true
|
|
20
20
|
end
|
|
21
21
|
|
|
22
|
-
it "returns true for :nokogiri
|
|
22
|
+
it "returns true for :nokogiri" do
|
|
23
23
|
expect(described_class.available?(:nokogiri)).to be true
|
|
24
24
|
end
|
|
25
|
-
|
|
26
|
-
context "when Opal platform adapters are in effect" do
|
|
27
|
-
before do
|
|
28
|
-
allow(described_class).to receive(:platform_adapters)
|
|
29
|
-
.and_return(Moxml::Adapter::OPAL_AVAILABLE_ADAPTERS)
|
|
30
|
-
end
|
|
31
|
-
|
|
32
|
-
it "returns false for :nokogiri" do
|
|
33
|
-
expect(described_class.available?(:nokogiri)).to be false
|
|
34
|
-
end
|
|
35
|
-
|
|
36
|
-
it "returns true for :oga" do
|
|
37
|
-
expect(described_class.available?(:oga)).to be true
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
it "returns true for :rexml" do
|
|
41
|
-
expect(described_class.available?(:rexml)).to be true
|
|
42
|
-
end
|
|
43
|
-
end
|
|
44
|
-
end
|
|
45
|
-
|
|
46
|
-
describe ".load" do
|
|
47
|
-
context "when Opal platform adapters are in effect" do
|
|
48
|
-
before do
|
|
49
|
-
allow(described_class).to receive(:platform_adapters)
|
|
50
|
-
.and_return(Moxml::Adapter::OPAL_AVAILABLE_ADAPTERS)
|
|
51
|
-
end
|
|
52
|
-
|
|
53
|
-
it "raises AdapterError for :nokogiri" do
|
|
54
|
-
expect { described_class.load(:nokogiri) }.to raise_error(
|
|
55
|
-
Moxml::AdapterError, /not available on this platform/
|
|
56
|
-
)
|
|
57
|
-
end
|
|
58
|
-
end
|
|
59
|
-
end
|
|
60
|
-
|
|
61
|
-
describe "OPAL_AVAILABLE_ADAPTERS" do
|
|
62
|
-
it "lists :oga as the primary Opal adapter, with :rexml as opt-in" do
|
|
63
|
-
expect(Moxml::Adapter::OPAL_AVAILABLE_ADAPTERS).to eq(%i[oga rexml])
|
|
64
|
-
end
|
|
65
25
|
end
|
|
66
26
|
|
|
67
27
|
describe "CONST_NAME_MAP" do
|
|
@@ -101,10 +61,5 @@ RSpec.describe Moxml::Adapter do
|
|
|
101
61
|
expect(Gem::Version.new(Leptris::VERSION))
|
|
102
62
|
.to be >= Gem::Version.new(adapter::MINIMUM_BINDING_VERSION)
|
|
103
63
|
end
|
|
104
|
-
|
|
105
|
-
it "OPAL_DEFAULT_ADAPTER is a member of OPAL_AVAILABLE_ADAPTERS" do
|
|
106
|
-
expect(Moxml::Adapter::OPAL_AVAILABLE_ADAPTERS)
|
|
107
|
-
.to include(Moxml::Config::OPAL_DEFAULT_ADAPTER)
|
|
108
|
-
end
|
|
109
64
|
end
|
|
110
65
|
end
|
|
@@ -6,15 +6,7 @@ require "spec_helper"
|
|
|
6
6
|
|
|
7
7
|
RSpec.describe Moxml::NativeAttachment do
|
|
8
8
|
describe ".default_backend" do
|
|
9
|
-
it "uses the
|
|
10
|
-
stub_const("RUBY_ENGINE", "opal")
|
|
11
|
-
|
|
12
|
-
expect(described_class.default_backend).to be_a(described_class::Opal)
|
|
13
|
-
end
|
|
14
|
-
|
|
15
|
-
it "uses the native backend under non-Opal Ruby engines" do
|
|
16
|
-
stub_const("RUBY_ENGINE", "ruby")
|
|
17
|
-
|
|
9
|
+
it "uses the native backend" do
|
|
18
10
|
expect(described_class.default_backend).to be_a(described_class::Native)
|
|
19
11
|
end
|
|
20
12
|
end
|
|
@@ -69,13 +61,7 @@ RSpec.describe Moxml::NativeAttachment do
|
|
|
69
61
|
end
|
|
70
62
|
|
|
71
63
|
it "uses the selected runtime backend" do
|
|
72
|
-
|
|
73
|
-
described_class::Opal
|
|
74
|
-
else
|
|
75
|
-
described_class::Native
|
|
76
|
-
end
|
|
77
|
-
|
|
78
|
-
expect(attachments.backend).to be_a(expected_class)
|
|
64
|
+
expect(attachments.backend).to be_a(described_class::Native)
|
|
79
65
|
end
|
|
80
66
|
end
|
|
81
67
|
|
|
@@ -109,7 +95,7 @@ RSpec.describe Moxml::NativeAttachment do
|
|
|
109
95
|
expect(stdout).to eq("true\n")
|
|
110
96
|
end
|
|
111
97
|
|
|
112
|
-
it "registers backend
|
|
98
|
+
it "registers the backend implementation with a require-style autoload path" do
|
|
113
99
|
stdout, stderr, status = Open3.capture3(
|
|
114
100
|
ruby,
|
|
115
101
|
"-I",
|
|
@@ -118,16 +104,12 @@ RSpec.describe Moxml::NativeAttachment do
|
|
|
118
104
|
<<~RUBY,
|
|
119
105
|
require "moxml/native_attachment"
|
|
120
106
|
|
|
121
|
-
puts Moxml::NativeAttachment.autoload?(:Opal)
|
|
122
107
|
puts Moxml::NativeAttachment.autoload?(:Native)
|
|
123
108
|
RUBY
|
|
124
109
|
)
|
|
125
110
|
|
|
126
111
|
expect(status.success?).to be(true), stderr
|
|
127
|
-
expect(stdout).to eq(
|
|
128
|
-
"moxml/native_attachment/opal\n" \
|
|
129
|
-
"moxml/native_attachment/native\n",
|
|
130
|
-
)
|
|
112
|
+
expect(stdout).to eq("moxml/native_attachment/native\n")
|
|
131
113
|
end
|
|
132
114
|
|
|
133
115
|
it "loads the native backend lazily when selected" do
|
|
@@ -142,7 +124,6 @@ RSpec.describe Moxml::NativeAttachment do
|
|
|
142
124
|
puts $LOADED_FEATURES.grep(%r{/native_attachment/native\.rb\z}).empty?
|
|
143
125
|
puts Moxml::NativeAttachment.new.backend.class
|
|
144
126
|
puts !$LOADED_FEATURES.grep(%r{/native_attachment/native\.rb\z}).empty?
|
|
145
|
-
puts $LOADED_FEATURES.grep(%r{/native_attachment/opal\.rb\z}).empty?
|
|
146
127
|
RUBY
|
|
147
128
|
)
|
|
148
129
|
|
|
@@ -150,33 +131,6 @@ RSpec.describe Moxml::NativeAttachment do
|
|
|
150
131
|
expect(stdout).to eq(
|
|
151
132
|
"true\n" \
|
|
152
133
|
"Moxml::NativeAttachment::Native\n" \
|
|
153
|
-
"true\n" \
|
|
154
|
-
"true\n",
|
|
155
|
-
)
|
|
156
|
-
end
|
|
157
|
-
|
|
158
|
-
it "does not load the native backend when Opal is selected" do
|
|
159
|
-
stdout, stderr, status = Open3.capture3(
|
|
160
|
-
ruby,
|
|
161
|
-
"-I",
|
|
162
|
-
lib_dir,
|
|
163
|
-
"-e",
|
|
164
|
-
<<~'RUBY',
|
|
165
|
-
Object.send(:remove_const, :RUBY_ENGINE)
|
|
166
|
-
RUBY_ENGINE = "opal"
|
|
167
|
-
|
|
168
|
-
require "moxml/native_attachment"
|
|
169
|
-
|
|
170
|
-
puts Moxml::NativeAttachment.autoload?(:Native)
|
|
171
|
-
puts Moxml::NativeAttachment.new.backend.class
|
|
172
|
-
puts $LOADED_FEATURES.grep(%r{/native_attachment/native\.rb\z}).empty?
|
|
173
|
-
RUBY
|
|
174
|
-
)
|
|
175
|
-
|
|
176
|
-
expect(status.success?).to be(true), stderr
|
|
177
|
-
expect(stdout).to eq(
|
|
178
|
-
"moxml/native_attachment/native\n" \
|
|
179
|
-
"Moxml::NativeAttachment::Opal\n" \
|
|
180
134
|
"true\n",
|
|
181
135
|
)
|
|
182
136
|
end
|
|
@@ -253,7 +253,6 @@ RSpec.describe "Moxml::Signature edge cases and defense" do
|
|
|
253
253
|
end
|
|
254
254
|
|
|
255
255
|
describe "adapter portability" do
|
|
256
|
-
# Skip on Opal — adapter switching is the whole point of moxml.
|
|
257
256
|
it "verifies a signature produced under one adapter with another", :adapter_portability do
|
|
258
257
|
skip "Only Nokogiri available in CI" unless defined?(Nokogiri)
|
|
259
258
|
|
data/spec/spec_helper.rb
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
3
|
# SimpleCov must be loaded before application code
|
|
4
|
-
if ENV.fetch("COVERAGE", nil) == "true"
|
|
4
|
+
if ENV.fetch("COVERAGE", nil) == "true"
|
|
5
5
|
require "simplecov"
|
|
6
6
|
|
|
7
7
|
SimpleCov.start do
|
|
@@ -25,25 +25,21 @@ if ENV.fetch("COVERAGE", nil) == "true" && RUBY_ENGINE != "opal"
|
|
|
25
25
|
end
|
|
26
26
|
|
|
27
27
|
require "moxml"
|
|
28
|
-
require "nokogiri"
|
|
28
|
+
require "nokogiri"
|
|
29
29
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
require f
|
|
39
|
-
end
|
|
30
|
+
# Load shared examples from new locations
|
|
31
|
+
Dir[File.expand_path("integration/shared_examples/**/*.rb",
|
|
32
|
+
__dir__)].each do |f|
|
|
33
|
+
require f
|
|
34
|
+
end
|
|
35
|
+
Dir[File.expand_path("moxml/adapter/shared_examples/**/*.rb",
|
|
36
|
+
__dir__)].each do |f|
|
|
37
|
+
require f
|
|
40
38
|
end
|
|
41
39
|
Dir[File.expand_path("support/**/*.rb", __dir__)].each { |f| require f }
|
|
42
40
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
Dir[File.expand_path("examples/*.rb", __dir__)].each { |f| require f }
|
|
46
|
-
end
|
|
41
|
+
Dir[File.expand_path("performance/*.rb", __dir__)].each { |f| require f }
|
|
42
|
+
Dir[File.expand_path("examples/*.rb", __dir__)].each { |f| require f }
|
|
47
43
|
|
|
48
44
|
# Clear XPath caches immediately to ensure fresh compilation
|
|
49
45
|
# This is critical when code changes affect compiled XPath expressions
|
|
@@ -83,19 +79,6 @@ RSpec.configure do |config|
|
|
|
83
79
|
# Configure to skip examples unless explicitly run
|
|
84
80
|
config.filter_run_excluding examples: true unless ENV["RUN_EXAMPLES"]
|
|
85
81
|
|
|
86
|
-
# Under Opal, exclude specs that require native-only adapters or filesystem
|
|
87
|
-
if RUBY_ENGINE == "opal"
|
|
88
|
-
config.filter_run_excluding(
|
|
89
|
-
:native_adapter,
|
|
90
|
-
:native_fs,
|
|
91
|
-
:subprocess,
|
|
92
|
-
:xpath_native,
|
|
93
|
-
:performance,
|
|
94
|
-
:examples,
|
|
95
|
-
:consistency,
|
|
96
|
-
)
|
|
97
|
-
end
|
|
98
|
-
|
|
99
82
|
config.order = :random
|
|
100
83
|
Kernel.srand config.seed
|
|
101
84
|
end
|
|
@@ -105,8 +88,7 @@ Moxml.configure do |config|
|
|
|
105
88
|
# reproducible regardless of whether the local environment has a
|
|
106
89
|
# leptris new enough to win the runtime-default probe. Leptris gets
|
|
107
90
|
# full coverage through its explicit adapter/integration matrices.
|
|
108
|
-
config.adapter =
|
|
91
|
+
config.adapter = Moxml::Config::FALLBACK_ADAPTER
|
|
109
92
|
config.strict_parsing = true
|
|
110
93
|
config.default_encoding = "UTF-8"
|
|
111
|
-
config.entity_load_mode = :optional if RUBY_ENGINE == "opal"
|
|
112
94
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: moxml
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.6.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
@@ -25,7 +25,6 @@ files:
|
|
|
25
25
|
- ".github/workflows/dependent-tests.yml"
|
|
26
26
|
- ".github/workflows/docs.yml"
|
|
27
27
|
- ".github/workflows/nightly-fuzz.yml"
|
|
28
|
-
- ".github/workflows/opal.yml"
|
|
29
28
|
- ".github/workflows/performance-release.yml"
|
|
30
29
|
- ".github/workflows/performance.yml"
|
|
31
30
|
- ".github/workflows/rake.yml"
|
|
@@ -33,7 +32,6 @@ files:
|
|
|
33
32
|
- ".github/workflows/round-trip.yml"
|
|
34
33
|
- ".github/workflows/windows.yml"
|
|
35
34
|
- ".gitignore"
|
|
36
|
-
- ".gitmodules"
|
|
37
35
|
- ".rspec"
|
|
38
36
|
- ".rspec-opal"
|
|
39
37
|
- ".rubocop.yml"
|
|
@@ -134,13 +132,6 @@ files:
|
|
|
134
132
|
- examples/web_scraper/README.md
|
|
135
133
|
- examples/web_scraper/example_page.html
|
|
136
134
|
- examples/web_scraper/web_scraper.rb
|
|
137
|
-
- lib/compat/opal/moxml_boot.rb
|
|
138
|
-
- lib/compat/opal/rexml/namespace.rb
|
|
139
|
-
- lib/compat/opal/rexml/parsers/baseparser.rb
|
|
140
|
-
- lib/compat/opal/rexml/source.rb
|
|
141
|
-
- lib/compat/opal/rexml/text.rb
|
|
142
|
-
- lib/compat/opal/rexml/xmltokens.rb
|
|
143
|
-
- lib/compat/opal/rexml_compat.rb
|
|
144
135
|
- lib/moxml.rb
|
|
145
136
|
- lib/moxml/adapter.rb
|
|
146
137
|
- lib/moxml/adapter/base.rb
|
|
@@ -225,7 +216,6 @@ files:
|
|
|
225
216
|
- lib/moxml/entity/restorer.rb
|
|
226
217
|
- lib/moxml/entity_reference.rb
|
|
227
218
|
- lib/moxml/entity_registry.rb
|
|
228
|
-
- lib/moxml/entity_registry_opal_data.rb
|
|
229
219
|
- lib/moxml/error.rb
|
|
230
220
|
- lib/moxml/html_fragment.rb
|
|
231
221
|
- lib/moxml/lazy_bulk_rows.rb
|
|
@@ -234,7 +224,6 @@ files:
|
|
|
234
224
|
- lib/moxml/namespace.rb
|
|
235
225
|
- lib/moxml/native_attachment.rb
|
|
236
226
|
- lib/moxml/native_attachment/native.rb
|
|
237
|
-
- lib/moxml/native_attachment/opal.rb
|
|
238
227
|
- lib/moxml/node.rb
|
|
239
228
|
- lib/moxml/node_set.rb
|
|
240
229
|
- lib/moxml/plan.rb
|
|
@@ -569,7 +558,6 @@ files:
|
|
|
569
558
|
- spec/moxml/namespace_spec.rb
|
|
570
559
|
- spec/moxml/namespace_uri_validation_spec.rb
|
|
571
560
|
- spec/moxml/native_attachment/native_spec.rb
|
|
572
|
-
- spec/moxml/native_attachment/opal_spec.rb
|
|
573
561
|
- spec/moxml/native_attachment/shared_examples.rb
|
|
574
562
|
- spec/moxml/native_attachment_spec.rb
|
|
575
563
|
- spec/moxml/node_cache_spec.rb
|
|
@@ -577,17 +565,11 @@ files:
|
|
|
577
565
|
- spec/moxml/node_set_spec.rb
|
|
578
566
|
- spec/moxml/node_spec.rb
|
|
579
567
|
- spec/moxml/node_type_map_spec.rb
|
|
580
|
-
- spec/moxml/opal_oga_adapter_spec.rb
|
|
581
|
-
- spec/moxml/opal_oga_features_spec.rb
|
|
582
|
-
- spec/moxml/opal_oga_smoke_spec.rb
|
|
583
|
-
- spec/moxml/opal_rexml_adapter_spec.rb
|
|
584
|
-
- spec/moxml/opal_smoke_spec.rb
|
|
585
568
|
- spec/moxml/plan_conformance_spec.rb
|
|
586
569
|
- spec/moxml/plan_spec.rb
|
|
587
570
|
- spec/moxml/processing_instruction_spec.rb
|
|
588
571
|
- spec/moxml/readonly_parse_spec.rb
|
|
589
572
|
- spec/moxml/recover_mode_spec.rb
|
|
590
|
-
- spec/moxml/reference_opal_spec.rb
|
|
591
573
|
- spec/moxml/reference_spec.rb
|
|
592
574
|
- spec/moxml/relax_ng_spec.rb
|
|
593
575
|
- spec/moxml/sax/namespace_splitter_spec.rb
|
|
@@ -607,7 +589,6 @@ files:
|
|
|
607
589
|
- spec/moxml/signature/key_extractor_spec.rb
|
|
608
590
|
- spec/moxml/signature/model_spec.rb
|
|
609
591
|
- spec/moxml/signature/round_trip_spec.rb
|
|
610
|
-
- spec/moxml/signature_autoload_spec.rb
|
|
611
592
|
- spec/moxml/struct_plan_spec.rb
|
|
612
593
|
- spec/moxml/struct_plan_typed_spec.rb
|
|
613
594
|
- spec/moxml/text_spec.rb
|
|
@@ -665,7 +646,6 @@ files:
|
|
|
665
646
|
- spec/support/input_generator.rb
|
|
666
647
|
- spec/support/input_taxonomy.rb
|
|
667
648
|
- spec/support/model_coverage.rb
|
|
668
|
-
- spec/support/opal.rb
|
|
669
649
|
- spec/support/w3c_namespace_helpers.rb
|
|
670
650
|
- spec/support/xml_generator.rb
|
|
671
651
|
- spec/support/xml_matchers.rb
|
data/.github/workflows/opal.yml
DELETED
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
name: opal
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
tags: [ v* ]
|
|
7
|
-
pull_request:
|
|
8
|
-
|
|
9
|
-
# One live run per workflow+event+ref: a superseded push to the
|
|
10
|
-
# same PR/branch cancels its predecessors instead of queueing
|
|
11
|
-
# behind them (the runner queue otherwise stacks generations).
|
|
12
|
-
concurrency:
|
|
13
|
-
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.ref }}
|
|
14
|
-
cancel-in-progress: true
|
|
15
|
-
|
|
16
|
-
permissions:
|
|
17
|
-
contents: read
|
|
18
|
-
|
|
19
|
-
jobs:
|
|
20
|
-
test:
|
|
21
|
-
runs-on: ubuntu-latest
|
|
22
|
-
steps:
|
|
23
|
-
- uses: actions/checkout@v6
|
|
24
|
-
with:
|
|
25
|
-
submodules: "recursive"
|
|
26
|
-
|
|
27
|
-
- name: Set up Ruby
|
|
28
|
-
uses: ruby/setup-ruby@v1
|
|
29
|
-
with:
|
|
30
|
-
ruby-version: "3.4"
|
|
31
|
-
# NOTE: bundler-cache is disabled because the path-source oga
|
|
32
|
-
# and ruby-ll forks need ragel + ruby-ll outputs generated
|
|
33
|
-
# (rake vendor:prepare) before their C extensions can compile.
|
|
34
|
-
bundler-cache: false
|
|
35
|
-
|
|
36
|
-
- name: Set up Node.js
|
|
37
|
-
uses: actions/setup-node@v4
|
|
38
|
-
with:
|
|
39
|
-
node-version: "18"
|
|
40
|
-
|
|
41
|
-
- name: Install ragel
|
|
42
|
-
run: sudo apt-get update && sudo apt-get install -y ragel
|
|
43
|
-
|
|
44
|
-
- name: Install ruby-ll (for rake vendor:prepare)
|
|
45
|
-
run: gem install ruby-ll --no-document
|
|
46
|
-
|
|
47
|
-
- name: Generate ragel / ruby-ll outputs in vendored forks
|
|
48
|
-
# Run before `bundle install`: the path-source oga/ruby-ll forks
|
|
49
|
-
# gitignore their generated .rb/.c files (parser.rb, lexer.rb,
|
|
50
|
-
# ext/c/lexer.c). bundle install compiles the C extensions via
|
|
51
|
-
# each fork's extconf.rb, which requires ext/c/lexer.c to exist.
|
|
52
|
-
run: rake vendor:prepare
|
|
53
|
-
|
|
54
|
-
- name: Install Opal dependencies
|
|
55
|
-
run: |
|
|
56
|
-
npm list -g opal-compiler || npm install -g opal-compiler
|
|
57
|
-
bundle install
|
|
58
|
-
bundle exec rake opal:generate_entity_data
|
|
59
|
-
|
|
60
|
-
- name: Run Opal tests
|
|
61
|
-
run: bundle exec rake spec:opal
|
data/.gitmodules
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
# Opal doesn't support Ruby autoload. This file explicitly requires
|
|
4
|
-
# all Moxml modules that would normally be lazy-loaded via autoload
|
|
5
|
-
# in lib/moxml.rb. Loaded by the Opal Rakefile before spec_helper.
|
|
6
|
-
|
|
7
|
-
require "moxml/version"
|
|
8
|
-
require "moxml/error"
|
|
9
|
-
require "moxml/native_attachment"
|
|
10
|
-
require "moxml/native_attachment/opal"
|
|
11
|
-
require "moxml/xml_utils"
|
|
12
|
-
require "moxml/xml_utils/encoder"
|
|
13
|
-
require "moxml/node"
|
|
14
|
-
require "moxml/node_set"
|
|
15
|
-
require "moxml/lazy_node_set"
|
|
16
|
-
require "moxml/document"
|
|
17
|
-
require "moxml/element"
|
|
18
|
-
require "moxml/attribute"
|
|
19
|
-
require "moxml/text"
|
|
20
|
-
require "moxml/cdata"
|
|
21
|
-
require "moxml/comment"
|
|
22
|
-
require "moxml/processing_instruction"
|
|
23
|
-
require "moxml/declaration"
|
|
24
|
-
require "moxml/namespace"
|
|
25
|
-
require "moxml/doctype"
|
|
26
|
-
require "moxml/entity_reference"
|
|
27
|
-
require "moxml/entity_registry"
|
|
28
|
-
require "moxml/entity_registry_opal_data"
|
|
29
|
-
require "moxml/entity"
|
|
30
|
-
require "moxml/entity/restorer"
|
|
31
|
-
require "moxml/entity/reference"
|
|
32
|
-
require "moxml/xml_emitter"
|
|
33
|
-
require "moxml/adapter"
|
|
34
|
-
require "moxml/adapter/base"
|
|
35
|
-
require "moxml/adapter/customized_rexml"
|
|
36
|
-
require "moxml/adapter/customized_rexml/entity_reference"
|
|
37
|
-
require "moxml/adapter/customized_rexml/formatter"
|
|
38
|
-
require "moxml/sax"
|
|
39
|
-
require "moxml/sax/handler"
|
|
40
|
-
require "moxml/sax/element_handler"
|
|
41
|
-
require "moxml/sax/block_handler"
|
|
42
|
-
require "moxml/sax/namespace_splitter"
|
|
43
|
-
require "moxml/adapter/rexml"
|
|
44
|
-
require "moxml/adapter/customized_oga"
|
|
45
|
-
require "moxml/adapter/customized_oga/entity_decoder"
|
|
46
|
-
require "moxml/adapter/customized_oga/raw_value_override"
|
|
47
|
-
require "moxml/adapter/customized_oga/xml_declaration"
|
|
48
|
-
require "moxml/adapter/customized_oga/xml_generator"
|
|
49
|
-
require "moxml/adapter/oga"
|
|
50
|
-
require "moxml/builder"
|
|
51
|
-
require "moxml/context"
|
|
52
|
-
require "moxml/config"
|
|
53
|
-
require "moxml/xpath"
|
|
54
|
-
require "moxml/xpath/engine"
|
|
55
|
-
require "moxml/xpath/context"
|
|
56
|
-
require "moxml/xpath/conversion"
|
|
57
|
-
require "moxml/xpath/cache"
|
|
58
|
-
require "moxml/xpath/lexer"
|
|
59
|
-
require "moxml/xpath/parser"
|
|
60
|
-
require "moxml/xpath/compiler"
|
|
61
|
-
require "moxml/xpath/errors"
|
|
62
|
-
require "moxml/xpath/ast/node"
|
|
63
|
-
require "moxml/xpath/ruby/node"
|
|
64
|
-
require "moxml/xpath/ruby/generator"
|
|
65
|
-
require "moxml/reference"
|
|
66
|
-
require "moxml/reference/parser"
|
|
67
|
-
require "moxml/reference/writer"
|
|
68
|
-
require "moxml/reference/normalizer"
|