omml2mathml 0.0.8 → 0.0.9
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/rake.yml +1 -11
- data/.hound.yml +3 -1
- data/.rubocop.yml +4 -6
- data/lib/omml2mathml/version.rb +1 -1
- data/omml2mathml.gemspec +1 -2
- data/spec/omml2mathml_spec.rb +12 -2
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7db85a5002512b1ed422613680da8ef895f95c3daba393b8b6b8e682674d5bae
|
4
|
+
data.tar.gz: 3142e397b1dd51c215a8aa42457bac3a1d436c9f6aeffbbedf3d3cfe7c73ac4d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bd8633b37e92860aabe8ba2f1bc4ef41a2ebfaf84f78f59ea1001fa271b5e72b8273c637ce10003dff31caae571565dc6e96cb40eb529737976e3c58b5113855
|
7
|
+
data.tar.gz: 5caa51de9334a1aa2b7a19cdadf9cff6be5898bd644f0bbc111eb297d256edcc2ce19360fe2f8fe67132cbd98546b7eac2a28b4b8ca22d69420840b31ee1a973
|
data/.github/workflows/rake.yml
CHANGED
@@ -16,19 +16,9 @@ jobs:
|
|
16
16
|
strategy:
|
17
17
|
fail-fast: false
|
18
18
|
matrix:
|
19
|
-
ruby: [ '
|
19
|
+
ruby: [ '3.0', '2.7', '2.6', '2.5' ]
|
20
20
|
os: [ ubuntu-latest, windows-latest, macos-latest ]
|
21
21
|
experimental: [ false ]
|
22
|
-
include:
|
23
|
-
- ruby: '3.0'
|
24
|
-
os: 'ubuntu-latest'
|
25
|
-
experimental: true
|
26
|
-
- ruby: '3.0'
|
27
|
-
os: 'windows-latest'
|
28
|
-
experimental: true
|
29
|
-
- ruby: '3.0'
|
30
|
-
os: 'macos-latest'
|
31
|
-
experimental: true
|
32
22
|
steps:
|
33
23
|
- uses: actions/checkout@v2
|
34
24
|
with:
|
data/.hound.yml
CHANGED
data/.rubocop.yml
CHANGED
@@ -1,12 +1,10 @@
|
|
1
|
-
#
|
2
|
-
# https://github.com/
|
3
|
-
# All project-specific additions and overrides should be specified in this file.
|
1
|
+
# Auto-generated by Cimas: Do not edit it manually!
|
2
|
+
# See https://github.com/metanorma/cimas
|
4
3
|
inherit_from:
|
5
4
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
6
5
|
|
7
6
|
# local repo-specific modifications
|
7
|
+
# ...
|
8
8
|
|
9
9
|
AllCops:
|
10
|
-
|
11
|
-
StyleGuideCopsOnly: false
|
12
|
-
TargetRubyVersion: 2.4
|
10
|
+
TargetRubyVersion: 2.5
|
data/lib/omml2mathml/version.rb
CHANGED
data/omml2mathml.gemspec
CHANGED
@@ -21,10 +21,9 @@ Gem::Specification.new do |spec|
|
|
21
21
|
spec.require_paths = ["lib"]
|
22
22
|
spec.files = `git ls-files`.split("\n")
|
23
23
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
24
|
-
spec.required_ruby_version = Gem::Requirement.new(">= 2.
|
24
|
+
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
25
25
|
|
26
26
|
spec.add_dependency "nokogiri", "~> 1.11"
|
27
|
-
|
28
27
|
spec.add_development_dependency "bundler"
|
29
28
|
spec.add_development_dependency "byebug", "~> 9.1"
|
30
29
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
data/spec/omml2mathml_spec.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
require "spec_helper"
|
2
|
+
require "nokogiri"
|
2
3
|
|
3
4
|
RSpec.describe Omml2Mathml do
|
4
5
|
it "has a version number" do
|
@@ -6,8 +7,8 @@ RSpec.describe Omml2Mathml do
|
|
6
7
|
end
|
7
8
|
|
8
9
|
it "processes a document" do
|
9
|
-
|
10
|
-
|
10
|
+
output = Omml2Mathml.convert("spec/test.html").sub(/<\?xml[^>]+>/, "").sub(/<!DOCTYPE[^>]+>/, "")
|
11
|
+
html = <<~"OUTPUT"
|
11
12
|
<html xmlns="http://www.w3.org/TR/REC-html40" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:dt="uuid:C2F41010-65B3-11d1-A29F-00AA00C14882" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml">
|
12
13
|
|
13
14
|
<head>
|
@@ -57,5 +58,14 @@ RSpec.describe Omml2Mathml do
|
|
57
58
|
</body>
|
58
59
|
</html>
|
59
60
|
OUTPUT
|
61
|
+
|
62
|
+
if Gem::Version.new(Nokogiri::VERSION) < Gem::Version.new("1.11")
|
63
|
+
output.gsub!("\n<mml:mo>></mml:mo>", "")
|
64
|
+
output.gsub!("http://www.w3.org/TR/REC-html40", "http://www.w3.org/1999/xhtml")
|
65
|
+
else
|
66
|
+
output.gsub!(%r{ xml:lang="[\w-]+"}, "")
|
67
|
+
end
|
68
|
+
|
69
|
+
expect(html).to be_equivalent_to output
|
60
70
|
end
|
61
71
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: omml2mathml
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
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-08-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -206,7 +206,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
206
206
|
requirements:
|
207
207
|
- - ">="
|
208
208
|
- !ruby/object:Gem::Version
|
209
|
-
version: 2.
|
209
|
+
version: 2.5.0
|
210
210
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
211
211
|
requirements:
|
212
212
|
- - ">="
|