latex-decode 0.4.0 → 0.4.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.
- checksums.yaml +4 -4
- data/.github/workflows/ci.yml +6 -12
- data/.gitignore +1 -0
- data/latex-decode.gemspec +2 -1
- data/lib/latex/decode/base.rb +4 -0
- data/lib/latex/decode/version.rb +1 -1
- data/lib/latex/decode.rb +15 -8
- metadata +6 -10
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0ba2e090021db4b420e211c407dcd5f488b4febdaf1b622bfa3b95401b34a09a
|
|
4
|
+
data.tar.gz: 2df17e4f620af962d1540f5d90984470f606764510f2a1924cee8d6bb20ed19c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: dfdf5d3eca1175d7808ebe581abf25cb01c1165115772743e438f3b3e04125cad0865c6c69a79a6bc7510a8a2b3f3cea306aa7d6a861464e26f67efad124768d
|
|
7
|
+
data.tar.gz: 22f11a0224dc3179de7406ce14b6ad874359cc7a75418ce8220542117bfcf71467a6362fd154f3cd3fe431c5a96c9f183bf2a354107bdd8e50405de362ca6fc0
|
data/.github/workflows/ci.yml
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
name: ci
|
|
2
|
-
|
|
3
2
|
on:
|
|
4
3
|
push:
|
|
5
4
|
branches: [ main ]
|
|
6
5
|
pull_request:
|
|
7
6
|
branches: [ main ]
|
|
8
|
-
|
|
9
7
|
jobs:
|
|
10
8
|
build:
|
|
11
9
|
environment: CI
|
|
@@ -14,27 +12,23 @@ jobs:
|
|
|
14
12
|
strategy:
|
|
15
13
|
matrix:
|
|
16
14
|
ruby-version:
|
|
17
|
-
- '
|
|
18
|
-
- '3.
|
|
19
|
-
- '3.
|
|
15
|
+
- '3.4'
|
|
16
|
+
- '3.3'
|
|
17
|
+
- '3.2'
|
|
20
18
|
- 'jruby'
|
|
21
|
-
|
|
22
19
|
steps:
|
|
23
20
|
- name: Git checkout
|
|
24
|
-
uses: actions/checkout@
|
|
25
|
-
|
|
21
|
+
uses: actions/checkout@v4
|
|
26
22
|
- name: Setup Ruby
|
|
27
23
|
uses: ruby/setup-ruby@v1
|
|
28
24
|
with:
|
|
29
25
|
ruby-version: ${{ matrix.ruby-version }}
|
|
30
26
|
bundler-cache: true
|
|
31
|
-
|
|
32
27
|
- name: Run tests
|
|
33
28
|
run: bundle exec rake
|
|
34
|
-
|
|
35
29
|
- name: Upload coverage results
|
|
36
|
-
if: matrix.ruby-version == '3.
|
|
30
|
+
if: matrix.ruby-version == '3.3'
|
|
37
31
|
continue-on-error: true
|
|
38
|
-
uses: coverallsapp/github-action@
|
|
32
|
+
uses: coverallsapp/github-action@v2
|
|
39
33
|
with:
|
|
40
34
|
github-token: ${{ github.token }}
|
data/.gitignore
CHANGED
data/latex-decode.gemspec
CHANGED
|
@@ -11,8 +11,9 @@ Gem::Specification.new do |s|
|
|
|
11
11
|
s.homepage = 'http://github.com/inukshuk/latex-decode'
|
|
12
12
|
s.summary = 'Decodes LaTeX to Unicode.'
|
|
13
13
|
s.description = 'Decodes strings formatted in LaTeX to equivalent Unicode strings.'
|
|
14
|
-
s.license = 'GPL-3.0'
|
|
14
|
+
s.license = 'GPL-3.0-or-later'
|
|
15
15
|
s.platform = 'ruby'
|
|
16
|
+
s.required_ruby_version = '>= 1.8'
|
|
16
17
|
|
|
17
18
|
s.files = `git ls-files`.split("\n")
|
|
18
19
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
data/lib/latex/decode/base.rb
CHANGED
data/lib/latex/decode/version.rb
CHANGED
data/lib/latex/decode.rb
CHANGED
|
@@ -30,21 +30,28 @@ require 'latex/decode/greek'
|
|
|
30
30
|
|
|
31
31
|
module LaTeX
|
|
32
32
|
|
|
33
|
+
@decoders = [
|
|
34
|
+
Decode::Maths,
|
|
35
|
+
Decode::Accents,
|
|
36
|
+
Decode::Diacritics,
|
|
37
|
+
Decode::Punctuation,
|
|
38
|
+
Decode::Symbols,
|
|
39
|
+
Decode::Greek
|
|
40
|
+
]
|
|
41
|
+
|
|
33
42
|
class << self
|
|
34
|
-
|
|
43
|
+
attr_reader :decoders
|
|
44
|
+
|
|
45
|
+
def decode(string, options = {})
|
|
35
46
|
return string unless string.respond_to?(:to_s)
|
|
36
47
|
|
|
37
48
|
string = string.is_a?(String) ? string.dup : string.to_s
|
|
38
49
|
|
|
39
50
|
Decode::Base.normalize(string)
|
|
40
51
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
Decode::Diacritics.decode!(string)
|
|
45
|
-
Decode::Punctuation.decode!(string)
|
|
46
|
-
Decode::Symbols.decode!(string)
|
|
47
|
-
Decode::Greek.decode!(string)
|
|
52
|
+
decoders.each do |d|
|
|
53
|
+
d.decode! string unless options[d.id] == false
|
|
54
|
+
end
|
|
48
55
|
|
|
49
56
|
Decode::Base.strip_braces(string)
|
|
50
57
|
|
metadata
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: latex-decode
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.4.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Sylvester Keil
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: bin
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies: []
|
|
13
12
|
description: Decodes strings formatted in LaTeX to equivalent Unicode strings.
|
|
14
|
-
email:
|
|
15
13
|
executables: []
|
|
16
14
|
extensions: []
|
|
17
15
|
extra_rdoc_files:
|
|
18
|
-
- README.md
|
|
19
16
|
- LICENSE
|
|
17
|
+
- README.md
|
|
20
18
|
files:
|
|
21
19
|
- ".github/workflows/ci.yml"
|
|
22
20
|
- ".gitignore"
|
|
@@ -51,9 +49,8 @@ files:
|
|
|
51
49
|
- lib/latex/decode/version.rb
|
|
52
50
|
homepage: http://github.com/inukshuk/latex-decode
|
|
53
51
|
licenses:
|
|
54
|
-
- GPL-3.0
|
|
52
|
+
- GPL-3.0-or-later
|
|
55
53
|
metadata: {}
|
|
56
|
-
post_install_message:
|
|
57
54
|
rdoc_options:
|
|
58
55
|
- "--line-numbers"
|
|
59
56
|
- "--inline-source"
|
|
@@ -68,15 +65,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
|
68
65
|
requirements:
|
|
69
66
|
- - ">="
|
|
70
67
|
- !ruby/object:Gem::Version
|
|
71
|
-
version: '
|
|
68
|
+
version: '1.8'
|
|
72
69
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
73
70
|
requirements:
|
|
74
71
|
- - ">="
|
|
75
72
|
- !ruby/object:Gem::Version
|
|
76
73
|
version: '0'
|
|
77
74
|
requirements: []
|
|
78
|
-
rubygems_version:
|
|
79
|
-
signing_key:
|
|
75
|
+
rubygems_version: 4.0.3
|
|
80
76
|
specification_version: 4
|
|
81
77
|
summary: Decodes LaTeX to Unicode.
|
|
82
78
|
test_files:
|