reverse_adoc 0.3.0 → 0.3.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/.editorconfig +15 -0
- data/.gitignore +10 -0
- data/.rubocop.yml +12 -2
- data/{bin → exe}/reverse_adoc +0 -0
- data/{bin → exe}/w2a +0 -0
- data/lib/reverse_adoc/converters/base.rb +3 -1
- data/lib/reverse_adoc/html_converter.rb +1 -1
- data/lib/reverse_adoc/version.rb +1 -1
- data/reverse_adoc.gemspec +2 -1
- data/spec/assets/escapables.html +2 -0
- data/spec/bin/reverse_adoc_spec.rb +2 -2
- data/spec/bin/w2a_spec.rb +6 -6
- data/spec/components/basic_spec.rb +1 -1
- data/spec/components/code_spec.rb +0 -1
- data/spec/components/escapables_spec.rb +8 -0
- data/spec/components/html_fragment_spec.rb +0 -1
- data/spec/components/unknown_tags_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/audio_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/code_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/div_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/figure_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/img_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/p_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/pre_spec.rb +0 -1
- data/spec/lib/reverse_adoc/converters/video_spec.rb +0 -1
- metadata +8 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 22407f5a4ca3839adba7a35be1c31492f2c051a2a9862b84ecb44f7992b1ece1
|
4
|
+
data.tar.gz: 55bbbb5169f22a48ed4cac0d5653a30ddf92163827d8e2cc7ba0699098ac0d70
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3860543e71ec3c4c372cdf9b96a51128bf1579e53e0d110879e39ccab90b4b08754f13fa28edfa96a24b4cbb2974a7aa65e23c8d6326e42e85fa7ff55b05063
|
7
|
+
data.tar.gz: 0e043787955792419c2bd521a1c2a96cf2c3a0f022ad00c2ff8e74107d5e89d3c745774c55857f5a857f394ef05c6c82123402e1d18320670f4c4cc38e6fe376
|
data/.editorconfig
ADDED
@@ -0,0 +1,15 @@
|
|
1
|
+
# EditorConfig is awesome: http://EditorConfig.org
|
2
|
+
|
3
|
+
# top-most EditorConfig file
|
4
|
+
root = true
|
5
|
+
|
6
|
+
# Unix-style newlines with a newline ending every file
|
7
|
+
[*]
|
8
|
+
charset = utf-8
|
9
|
+
end_of_line = lf
|
10
|
+
|
11
|
+
[{*.adoc,*.html,*.js,*.json,*.rake,*.rb,*.rf,*.yaml,*.yml,Rakefile,rakefile}]
|
12
|
+
indent_style = space
|
13
|
+
indent_size = 2
|
14
|
+
insert_final_newline = true
|
15
|
+
trim_trailing_whitespace = true
|
data/.gitignore
ADDED
data/.rubocop.yml
CHANGED
@@ -5,6 +5,16 @@
|
|
5
5
|
inherit_from:
|
6
6
|
- https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
|
7
7
|
AllCops:
|
8
|
-
TargetRubyVersion: 2.
|
8
|
+
TargetRubyVersion: 2.4
|
9
9
|
Rails:
|
10
|
-
Enabled:
|
10
|
+
Enabled: false
|
11
|
+
|
12
|
+
# Dependencies are ordered for purpose.
|
13
|
+
Gemspec/OrderedDependencies:
|
14
|
+
Enabled: false
|
15
|
+
|
16
|
+
# TODO Rather than disabling, change severity to "info" in Rubocop 1.9+.
|
17
|
+
Layout:
|
18
|
+
Enabled: false
|
19
|
+
Style/StringLiterals:
|
20
|
+
Enabled: false
|
data/{bin → exe}/reverse_adoc
RENAMED
File without changes
|
data/{bin → exe}/w2a
RENAMED
File without changes
|
@@ -12,7 +12,9 @@ module ReverseAdoc
|
|
12
12
|
end
|
13
13
|
|
14
14
|
def escape_keychars(string)
|
15
|
-
|
15
|
+
subs = { '*' => '\*', '_' => '\_' }
|
16
|
+
string
|
17
|
+
.gsub(/((?<=\s)[\*_]+)|[\*_]+(?=\s)/) { |n| n.chars.map { |char| subs[char] }.join }
|
16
18
|
end
|
17
19
|
|
18
20
|
def extract_title(node)
|
data/lib/reverse_adoc/version.rb
CHANGED
data/reverse_adoc.gemspec
CHANGED
@@ -15,7 +15,8 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.files = `git ls-files`.split("\n")
|
17
17
|
s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
|
18
|
-
s.executables = `git ls-files --
|
18
|
+
s.executables = `git ls-files -- exe/*`.split("\n").map{ |f| File.basename(f) }
|
19
|
+
s.bindir = "exe"
|
19
20
|
s.require_paths = ["lib"]
|
20
21
|
s.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
|
21
22
|
|
data/spec/assets/escapables.html
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe '
|
5
|
+
describe 'exe/revrse_adoc' do
|
6
6
|
subject(:convert) do
|
7
|
-
ShellUtils.execute!("./
|
7
|
+
ShellUtils.execute!("./exe/reverse_adoc -e -o test1 #{input_file_path}")
|
8
8
|
end
|
9
9
|
unless Gem.win_platform?
|
10
10
|
context 'when external images present' do
|
data/spec/bin/w2a_spec.rb
CHANGED
@@ -2,9 +2,9 @@
|
|
2
2
|
|
3
3
|
require 'spec_helper'
|
4
4
|
|
5
|
-
describe '
|
5
|
+
describe 'exe/w2a' do
|
6
6
|
subject(:convert) do
|
7
|
-
ShellUtils.execute!("./
|
7
|
+
ShellUtils.execute!("./exe/w2a -e -o test1 #{input_file_path}")
|
8
8
|
end
|
9
9
|
# TODO: fix github actions integration with libreoffice, currently it hangs
|
10
10
|
# when trying to use soffice binary
|
@@ -25,10 +25,10 @@ describe 'bin/w2a' do
|
|
25
25
|
it 'extracts images from source html' do
|
26
26
|
expect { convert }
|
27
27
|
.to(change do
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
28
|
+
Dir["#{images_folder}/*gif"]
|
29
|
+
.map { |entry| File.basename(entry) }
|
30
|
+
.size > 0
|
31
|
+
end.from(false).to(true))
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
@@ -8,7 +8,7 @@ describe ReverseAdoc do
|
|
8
8
|
|
9
9
|
it { is_expected.to match /plain text ?\n/ }
|
10
10
|
it { is_expected.to match /\n== h1\n/ }
|
11
|
-
it { is_expected.to match /\n\[\[A]\]\n== h1 with anchor\n/ }
|
11
|
+
it { is_expected.to match /\n\[\[A\]\]\n== h1 with anchor\n/ }
|
12
12
|
it { is_expected.to match /\n=== h2\n/ }
|
13
13
|
it { is_expected.to match /\n==== h3\n/ }
|
14
14
|
it { is_expected.to match /\n===== h4\n/ }
|
@@ -9,6 +9,9 @@ describe ReverseAdoc do
|
|
9
9
|
context "multiple asterisks" do
|
10
10
|
it { is_expected.to include ' \*\*two asterisks\*\* ' }
|
11
11
|
it { is_expected.to include ' \*\*\*three asterisks\*\*\* ' }
|
12
|
+
it { is_expected.to include ' \*and*the\* ' }
|
13
|
+
it { is_expected.to include ' asterisc*word ' }
|
14
|
+
it { is_expected.to include ' asterisc**multword asterisks\*\*\* ' }
|
12
15
|
end
|
13
16
|
|
14
17
|
context "multiple underscores" do
|
@@ -16,6 +19,11 @@ describe ReverseAdoc do
|
|
16
19
|
it { is_expected.to include ' \_\_\_three underscores\_\_\_ ' }
|
17
20
|
end
|
18
21
|
|
22
|
+
context "multiple underscores with undersocre inside words and new lines" do
|
23
|
+
it { is_expected.to include 'another_undersocre' }
|
24
|
+
it { is_expected.to include ' \_\_\_three__underscores\_\_\_ ' }
|
25
|
+
end
|
26
|
+
|
19
27
|
context "underscores within words in code blocks" do
|
20
28
|
it { is_expected.to include "....\n<code>var theoretical_max_infin = 1.0;</code>\n....\n" }
|
21
29
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: reverse_adoc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
|
-
bindir:
|
9
|
+
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-05-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: nokogiri
|
@@ -159,15 +159,17 @@ executables:
|
|
159
159
|
extensions: []
|
160
160
|
extra_rdoc_files: []
|
161
161
|
files:
|
162
|
+
- ".editorconfig"
|
162
163
|
- ".github/workflows/rake.yml"
|
164
|
+
- ".gitignore"
|
163
165
|
- ".hound.yml"
|
164
166
|
- ".rubocop.yml"
|
165
167
|
- Gemfile
|
166
168
|
- LICENSE.txt
|
167
169
|
- README.adoc
|
168
170
|
- Rakefile
|
169
|
-
-
|
170
|
-
-
|
171
|
+
- exe/reverse_adoc
|
172
|
+
- exe/w2a
|
171
173
|
- lib/reverse_adoc.rb
|
172
174
|
- lib/reverse_adoc/cleaner.rb
|
173
175
|
- lib/reverse_adoc/config.rb
|
@@ -279,7 +281,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
279
281
|
- !ruby/object:Gem::Version
|
280
282
|
version: '0'
|
281
283
|
requirements: []
|
282
|
-
rubygems_version: 3.
|
284
|
+
rubygems_version: 3.0.3
|
283
285
|
signing_key:
|
284
286
|
specification_version: 4
|
285
287
|
summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
|