reverse_adoc 0.3.0 → 0.3.1

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
2
  SHA256:
3
- metadata.gz: 151922bd17ae4f65700977c109db7d8c55698e7eab9b22f7879df019b84c0923
4
- data.tar.gz: b18bfb38f7d53ba8eae5cca00798824c8d4c6726a6d9c7baf0ab3a86f69c0d9a
3
+ metadata.gz: 22407f5a4ca3839adba7a35be1c31492f2c051a2a9862b84ecb44f7992b1ece1
4
+ data.tar.gz: 55bbbb5169f22a48ed4cac0d5653a30ddf92163827d8e2cc7ba0699098ac0d70
5
5
  SHA512:
6
- metadata.gz: f8cf25df3279d0bd4b33c105be476e15dcb0c8e4aca7812e3332daf3bc5ac4ea671281266ec8c70b83c7d906fa87593ce65e24a0a0a009382eb0921e6072e669
7
- data.tar.gz: 5431dacaa7627908c4bb1e2583d56e7b982bd73f6ad44bf6a348ccc99cb632743ea701db79d53c46d5f0e263961abd676570f9c1d02417855dfc9d9b91deb3fa
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
@@ -0,0 +1,10 @@
1
+ /coverage
2
+ /Gemfile.lock
3
+
4
+ .DS_Store
5
+
6
+ # RuboCop's remote style books
7
+ .rubocop-https---*
8
+
9
+ # Some odd files created by specs
10
+ /test1
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.3
8
+ TargetRubyVersion: 2.4
9
9
  Rails:
10
- Enabled: true
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
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
- string.gsub(/(?<!\\)[*_]/, '*' => '\*', '_' => '\_')
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)
@@ -53,4 +53,4 @@ module ReverseAdoc
53
53
  end
54
54
  end
55
55
  end
56
- end
56
+ end
@@ -1,3 +1,3 @@
1
1
  module ReverseAdoc
2
- VERSION = '0.3.0'
2
+ VERSION = '0.3.1'
3
3
  end
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 -- bin/*`.split("\n").map{ |f| File.basename(f) }
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
 
@@ -4,8 +4,10 @@
4
4
 
5
5
  **two asterisks**
6
6
  ***three asterisks***
7
+ ***three *and*the* asterisc*word and asterisc**multword asterisks***
7
8
  __two underscores__
8
9
  ___three underscores___
10
+ ___three__underscores___ and another_undersocre
9
11
 
10
12
  some text...
11
13
 
@@ -2,9 +2,9 @@
2
2
 
3
3
  require 'spec_helper'
4
4
 
5
- describe 'bin/revrse_adoc' do
5
+ describe 'exe/revrse_adoc' do
6
6
  subject(:convert) do
7
- ShellUtils.execute!("./bin/reverse_adoc -e -o test1 #{input_file_path}")
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 'bin/w2a' do
5
+ describe 'exe/w2a' do
6
6
  subject(:convert) do
7
- ShellUtils.execute!("./bin/w2a -e -o test1 #{input_file_path}")
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
- Dir["#{images_folder}/*gif"]
29
- .map { |entry| File.basename(entry) }
30
- .sort
31
- end.from([]).to(['001.gif']))
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/ }
@@ -25,4 +25,3 @@ describe ReverseAdoc do
25
25
  end
26
26
 
27
27
  end
28
-
@@ -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
@@ -8,4 +8,3 @@ describe ReverseAdoc do
8
8
 
9
9
  it { is_expected.to eq("naked text 1\n\nparagraph text\n\nnaked text 2") }
10
10
  end
11
-
@@ -36,4 +36,3 @@ describe ReverseAdoc do
36
36
  it { expect { result }.to raise_error(ReverseAdoc::InvalidConfigurationError) }
37
37
  end
38
38
  end
39
-
@@ -15,4 +15,3 @@ describe ReverseAdoc::Converters::Audio do
15
15
  end
16
16
 
17
17
  end
18
-
@@ -15,4 +15,3 @@ describe ReverseAdoc::Converters::Code do
15
15
  end
16
16
 
17
17
  end
18
-
@@ -15,4 +15,3 @@ describe ReverseAdoc::Converters::Code do
15
15
  end
16
16
 
17
17
  end
18
-
@@ -10,4 +10,3 @@ describe ReverseAdoc::Converters::Figure do
10
10
 
11
11
  end
12
12
  end
13
-
@@ -25,4 +25,3 @@ describe ReverseAdoc::Converters::Img do
25
25
  end
26
26
 
27
27
  end
28
-
@@ -9,4 +9,3 @@ describe ReverseAdoc::Converters::P do
9
9
  expect(converter.convert(node)).to include "\n[[A]]\nputs foo"
10
10
  end
11
11
  end
12
-
@@ -42,4 +42,3 @@ describe ReverseAdoc::Converters::Pre do
42
42
  end
43
43
  end
44
44
  end
45
-
@@ -15,4 +15,3 @@ describe ReverseAdoc::Converters::Video do
15
15
  end
16
16
 
17
17
  end
18
-
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.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
- bindir: bin
9
+ bindir: exe
10
10
  cert_chain: []
11
- date: 2021-03-29 00:00:00.000000000 Z
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
- - bin/reverse_adoc
170
- - bin/w2a
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.1.4
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.