mathml2asciimath 0.0.1 → 0.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
- SHA1:
3
- metadata.gz: d8737530a0a13306fbbae39a18d7eb464905fa9d
4
- data.tar.gz: fcdcd915ff8319b98cb1dedbb7b3d5b57e8668ad
2
+ SHA256:
3
+ metadata.gz: 72e7672e7aa4939e18436565944b1c05da4e39595b893b1f44c1836474705d5c
4
+ data.tar.gz: bde406c06b363f5eaf3c68699be04d8f7546be2fa4a7a5d3d51119c79c66304e
5
5
  SHA512:
6
- metadata.gz: '08e516b489e48eb8fb9387d42980db48a838cb33c7efb66c3763550bf8b4c62948a3c8135c20b591bad50adb9f79e64bd3fb578849800809f147406f00a90d38'
7
- data.tar.gz: 0b5b8f8d1cfb0a44d1e98aff1b44368d67a79947311d40cf97387bb3ca2a88ea15ae06e7d465d6e2f6ccc5e14ab3a65ebeaeec071272b9ad30f52235ffcf22b6
6
+ metadata.gz: d0168b546c475b55c5f6d08647803a15674b5c746887002d5c541465bcdb100df7c910b713fece94fd10a2b53bbf7599b7d2ba68d7f0f2f4139bfd7ac7134e3a
7
+ data.tar.gz: 741c0647c43298de8e70c7b0b78dd59a27d72fd92fff90b279b7231c2ea6669ccabc10329d396be31cbe40d6876cfeebdcfacc5b4ef57877e4ff461eaf12bb9a
data/Gemfile ADDED
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ # Specify your gem's dependencies in ruby-vobject.gemspec
4
+ gemspec
5
+
data/README.adoc CHANGED
@@ -1,5 +1,9 @@
1
1
  = mathml2asciimath
2
2
 
3
+ image:https://img.shields.io/gem/v/mathml2asciimath.svg["Gem Version", link="https://rubygems.org/gems/mathml2asciimath"]
4
+ image:https://img.shields.io/travis/riboseinc/mathml2asciimath/master.svg["Build Status", link="https://travis-ci.org/riboseinc/mathml2asciimath"]
5
+ image:https://codeclimate.com/github/riboseinc/mathml2asciimath/badges/gpa.svg["Code Climate", link="https://codeclimate.com/github/riboseinc/mathml2asciimath"]
6
+
3
7
  Ruby gem to convert MathML into AsciiMath
4
8
 
5
9
  Ignores style and MathML attributes (other than `mfenced/@open`, `mfenced/@close`, `mo/@fence`).
@@ -63,6 +63,7 @@ module MathML2AsciiMath
63
63
  gsub(/\u00f7/, "-:").
64
64
  gsub(/\u2218/, "@").
65
65
  gsub(/\u2295/, "o+").
66
+ gsub(/\u2a01/, "o+").
66
67
  gsub(/\u2297/, "ox").
67
68
  gsub(/\u2299/, "o.").
68
69
  gsub(/\u2211/, "sum").
@@ -105,7 +106,9 @@ module MathML2AsciiMath
105
106
  gsub(/\u2329/, "(:").
106
107
  gsub(/\u232a/, ":)").
107
108
  gsub(/\u2329/, "<<").
109
+ gsub(/\u27e8/, "<<").
108
110
  gsub(/\u232a/, ">>").
111
+ gsub(/\u27e9/, ">>").
109
112
  gsub(/\u222e/, "oint").
110
113
  gsub(/\u2202/, "del").
111
114
  gsub(/\u2207/, "grad").
@@ -1,4 +1,4 @@
1
1
  module MathML2AsciiMath
2
- VERSION = "0.0.1".freeze
2
+ VERSION = "0.0.2".freeze
3
3
  end
4
4
 
@@ -24,14 +24,14 @@ Gem::Specification.new do |spec|
24
24
  spec.require_paths = ["lib"]
25
25
  spec.files = `git ls-files`.split("\n")
26
26
  spec.test_files = `git ls-files -- {spec}/*`.split("\n")
27
- spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
27
+ spec.required_ruby_version = Gem::Requirement.new(">= 2.3.0")
28
28
 
29
29
  spec.add_dependency "htmlentities", "~> 4.3.4"
30
30
  spec.add_dependency "nokogiri"
31
31
 
32
32
  spec.add_development_dependency "bundler", "~> 1.15"
33
33
  spec.add_development_dependency "byebug", "~> 9.1"
34
- spec.add_development_dependency "equivalent-xml", "~> 0.6"
34
+ spec.add_development_dependency "rspec-match_fuzzy", "~> 0.1.3"
35
35
  spec.add_development_dependency "guard", "~> 2.14"
36
36
  spec.add_development_dependency "guard-rspec", "~> 4.7"
37
37
  spec.add_development_dependency "rake", "~> 12.0"
@@ -0,0 +1,17 @@
1
+ require "spec_helper"
2
+
3
+ RSpec.describe MathML2AsciiMath do
4
+ it "processes some MathML" do
5
+ expect(MathML2AsciiMath.m2a(<<~INPUT)).to match_fuzzy <<~OUTPUT
6
+ <math xmlns="http://www.w3.org/1998/Math/MathML">
7
+ <mrow>
8
+ <mi>a</mi> <mo>⋄</mo> <msup><mi>x</mi><mn>2</mn></msup>
9
+ <mo>+</mo><mi>b</mi><mo>×</mo><mi>x</mi>
10
+ <mo>+</mo><mi>c</mi>
11
+ </mrow>
12
+ </math>
13
+ INPUT
14
+ a diamond x^2\n + b xx x\n + c
15
+ OUTPUT
16
+ end
17
+ end
@@ -0,0 +1,12 @@
1
+ require 'simplecov'
2
+
3
+ SimpleCov.profiles.define 'gem' do
4
+ add_filter '/spec/'
5
+ add_filter '/autotest/'
6
+ add_group 'Libraries', '/lib/'
7
+ end
8
+ SimpleCov.start 'gem'
9
+
10
+ require "rspec/match_fuzzy"
11
+ require "mathml2asciimath"
12
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mathml2asciimath
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-04-17 00:00:00.000000000 Z
11
+ date: 2018-07-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -67,19 +67,19 @@ dependencies:
67
67
  - !ruby/object:Gem::Version
68
68
  version: '9.1'
69
69
  - !ruby/object:Gem::Dependency
70
- name: equivalent-xml
70
+ name: rspec-match_fuzzy
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '0.6'
75
+ version: 0.1.3
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '0.6'
82
+ version: 0.1.3
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: guard
85
85
  requirement: !ruby/object:Gem::Requirement
@@ -188,6 +188,7 @@ executables: []
188
188
  extensions: []
189
189
  extra_rdoc_files: []
190
190
  files:
191
+ - Gemfile
191
192
  - LICENSE
192
193
  - README.adoc
193
194
  - bin/m2a.rb
@@ -196,6 +197,8 @@ files:
196
197
  - lib/mathml2asciimath/m2a.rb
197
198
  - lib/mathml2asciimath/version.rb
198
199
  - mathml2asciimath.gemspec
200
+ - spec/mathml_spec.rb
201
+ - spec/spec_helper.rb
199
202
  homepage: https://github.com/riboseinc/mathml2asciimath
200
203
  licenses:
201
204
  - MIT
@@ -208,7 +211,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
208
211
  requirements:
209
212
  - - ">="
210
213
  - !ruby/object:Gem::Version
211
- version: 2.4.0
214
+ version: 2.3.0
212
215
  required_rubygems_version: !ruby/object:Gem::Requirement
213
216
  requirements:
214
217
  - - ">="
@@ -216,7 +219,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
216
219
  version: '0'
217
220
  requirements: []
218
221
  rubyforge_project:
219
- rubygems_version: 2.6.12
222
+ rubygems_version: 2.7.6
220
223
  signing_key:
221
224
  specification_version: 4
222
225
  summary: Convert MathML to AsciiMath