reverse_adoc 0.3.4 → 0.3.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 36f817d275ce6148cc1013a3b50e313b481d44121babe05d13fc07d49e221c2d
4
- data.tar.gz: 6885e6d6810fb0c0113ff2108c50e7326eb74479501607b4825fe9581ab7b03f
3
+ metadata.gz: 5ada0c5000d417b1fa73962833f53144ae8ef29d4089ec49cd5aa8cfe87f0a99
4
+ data.tar.gz: d56d80b96a0c52b7ad1d1c0e0133821ba9711f277388f59727fc6c904a2cad12
5
5
  SHA512:
6
- metadata.gz: a38b5a9afc809ff511606abfd62a2cd3bf75e3c632bd60319be2477e8879626ba20151ba1dd31b9114adc28492ebf864f9dc189e175bfb47b91b551ed0f8e701
7
- data.tar.gz: b9ce3a1c1123166c2ecf2f5bdde273ecb003505071b8863196fe99e3d7a4d6225ea1d362c010ec034f8f60df8cf920ca7ef63ed0bc1f05b7ec3f51a7b66f687e
6
+ metadata.gz: 2cde0734e47f95bb24664dade9a3a11266bf4d109b15211b45e3385d71b6cc5748d7faa238aca2861d31f01045c09975f5e516a251b7c555ad31d48199fc8a90
7
+ data.tar.gz: 3f318a46c99954e5d69b12b03aaaca6e75b0238740fbdded85ae8dc2c1d147bdb1b5c2e4e9207f34406664150359a92bb6237cfe38622996cd24f89899af8323
@@ -10,23 +10,6 @@ on:
10
10
 
11
11
  jobs:
12
12
  rake:
13
- name: Test on Ruby ${{ matrix.ruby }} ${{ matrix.os }}
14
- runs-on: ${{ matrix.os }}
15
- continue-on-error: ${{ matrix.experimental }}
16
- strategy:
17
- fail-fast: false
18
- matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
- os: [ ubuntu-latest, windows-latest, macos-latest ]
21
- experimental: [ false ]
22
- steps:
23
- - uses: actions/checkout@master
24
-
25
- - uses: ruby/setup-ruby@v1
26
- with:
27
- ruby-version: ${{ matrix.ruby }}
28
- bundler-cache: true
29
-
30
- - uses: metanorma/metanorma-build-scripts/libreoffice-setup-action@master
31
-
32
- - run: bundle exec rake
13
+ uses: metanorma/ci/.github/workflows/libreoffice-rake.yml@main
14
+ secrets:
15
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -15,31 +15,10 @@ on:
15
15
 
16
16
  jobs:
17
17
  release:
18
- runs-on: ubuntu-latest
19
- steps:
20
- - uses: actions/checkout@v2
18
+ uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.METANORMA_CI_RUBYGEMS_API_KEY }}
23
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
21
24
 
22
- - uses: ruby/setup-ruby@v1
23
- with:
24
- ruby-version: '2.6'
25
- bundler-cache: true
26
-
27
- - run: gem install gem-release
28
-
29
- - if: ${{ github.event_name == 'workflow_dispatch' }} && ${{ github.event.inputs.next_version != 'skip' }}
30
- run: |
31
- git config user.name github-actions
32
- git config user.email github-actions@github.com
33
- gem bump --version ${{ github.event.inputs.next_version }} --tag --push
34
-
35
- - name: publish to rubygems.org
36
- env:
37
- RUBYGEMS_API_KEY: ${{secrets.METANORMA_CI_RUBYGEMS_API_KEY}}
38
- run: |
39
- gem install gem-release
40
- envsubst << 'EOF' > ~/.gem/credentials
41
- ---
42
- :rubygems_api_key: ${RUBYGEMS_API_KEY}
43
- EOF
44
- chmod 0600 ~/.gem/credentials
45
- gem release
data/Gemfile CHANGED
@@ -4,5 +4,3 @@ git_source(:github) {|repo_name| "https://github.com/#{repo_name}" }
4
4
 
5
5
  # Specify your gem's dependencies in reverse_adoc.gemspec
6
6
  gemspec
7
-
8
- gem "byebug"
@@ -16,7 +16,11 @@ module ReverseAdoc
16
16
  private
17
17
 
18
18
  def treat(node, state)
19
- node.to_s
19
+ return "\n" if node.name == "br"
20
+
21
+ prefix = postfix = "\n\n" if node.name == "p"
22
+
23
+ "#{prefix}#{node.text}#{postfix}"
20
24
  end
21
25
 
22
26
  def language(node)
@@ -1,3 +1,3 @@
1
1
  module ReverseAdoc
2
- VERSION = "0.3.4".freeze
2
+ VERSION = "0.3.6".freeze
3
3
  end
@@ -7,19 +7,19 @@ describe ReverseAdoc do
7
7
  subject { ReverseAdoc.convert(input) }
8
8
 
9
9
  it { is_expected.to match /inline `code` block/ }
10
- it { is_expected.to match /\n<code>var this\;\nthis\.is/ }
10
+ it { is_expected.to match /\nvar this;\nthis\.is/ }
11
11
  it { is_expected.to match /block"\)\nconsole/ }
12
12
 
13
13
  context "with github style code blocks" do
14
14
  subject { ReverseAdoc.convert(input) }
15
15
  it { is_expected.to match /inline `code` block/ }
16
- it { is_expected.to match /\n\.\.\.\.\n<code>var this\;\nthis/ }
17
- it { is_expected.to match /it is"\) ?\n <\/code>\n\.\.\.\./ }
16
+ it { is_expected.to match /\n\.\.\.\.\nvar this;\nthis/ }
17
+ it { is_expected.to match /it is"\) ?\n \n\.\.\.\./ }
18
18
  end
19
19
 
20
20
  context "code with indentation" do
21
21
  subject { ReverseAdoc.convert(input) }
22
- it { is_expected.to match(/^<code>tell application "Foo"\n/) }
22
+ it { is_expected.to match(/^tell application "Foo"\n/) }
23
23
  it { is_expected.to match(/^ beep\n/) }
24
24
  it { is_expected.to match(/^end tell\n/) }
25
25
  end
@@ -25,7 +25,8 @@ describe ReverseAdoc do
25
25
  end
26
26
 
27
27
  context "underscores within words in code blocks" do
28
- it { is_expected.to include "....\n<code>var theoretical_max_infin = 1.0;</code>\n....\n" }
28
+ let(:expected_output) { "....\nvar theoretical_max_infin = 1.0;\n....\n" }
29
+ it { is_expected.to include expected_output }
29
30
  end
30
31
 
31
32
  end
@@ -8,7 +8,7 @@ describe ReverseAdoc do
8
8
 
9
9
  it { is_expected.not_to start_with "\n\n" }
10
10
  it { is_expected.to start_with "First content\n\nSecond content\n\n" }
11
- it { is_expected.to include "\n\n_Complex_\n\n\.\.\.\.\n\n <code>Content</code>\n" }
11
+ it { is_expected.to include "\n\n_Complex_\n\n\.\.\.\.\n\n Content\n" }
12
12
  it { is_expected.to include "*Trailing whitespace:*" }
13
13
  it { is_expected.to include "*Trailing non-breaking space:&nbsp;*" }
14
14
  it { is_expected.to include "*_Combination:&nbsp;_*" }
@@ -6,7 +6,7 @@ describe ReverseAdoc do
6
6
  let(:document) { Nokogiri::HTML(input) }
7
7
  subject { ReverseAdoc.convert(input) }
8
8
 
9
- it { is_expected.to match /\n <code>Block of code<\/code>$/ }
9
+ it { is_expected.to match /\n Block of code$/ }
10
10
  it { is_expected.to include "\n____\nFirst quoted paragraph\n\nSecond quoted paragraph\n____\n" }
11
11
 
12
12
  end
@@ -21,7 +21,7 @@ describe ReverseAdoc::Converters::Pre do
21
21
 
22
22
  it 'preserves xml' do
23
23
  node = node_for("<pre><code>x</code><br/><p>hello</p></pre>")
24
- expect(converter.convert(node)).to include "....\n<code>x</code><br><p>hello</p>\n....\n"
24
+ expect(converter.convert(node)).to include "....\nx\n\n\nhello\n\n\n....\n"
25
25
  end
26
26
 
27
27
  context 'syntax highlighting' do
data/spec/spec_helper.rb CHANGED
@@ -1,5 +1,4 @@
1
1
  require 'simplecov'
2
- # require 'byebug'
3
2
 
4
3
  SimpleCov.profiles.define 'gem' do
5
4
  add_filter '/spec/'
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
4
+ version: 0.3.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-10-25 00:00:00.000000000 Z
11
+ date: 2022-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: marcel
@@ -267,7 +267,7 @@ homepage: http://github.com/metanorma/reverse_adoc
267
267
  licenses:
268
268
  - BSD-2-Clause
269
269
  metadata: {}
270
- post_install_message:
270
+ post_install_message:
271
271
  rdoc_options: []
272
272
  require_paths:
273
273
  - lib
@@ -282,58 +282,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
282
282
  - !ruby/object:Gem::Version
283
283
  version: '0'
284
284
  requirements: []
285
- rubygems_version: 3.2.22
286
- signing_key:
285
+ rubygems_version: 3.1.6
286
+ signing_key:
287
287
  specification_version: 4
288
288
  summary: Generate AsciiDoc from HTML and Microsoft Word via CLI or library.
289
- test_files:
290
- - spec/assets/anchors.html
291
- - spec/assets/basic.html
292
- - spec/assets/code.html
293
- - spec/assets/escapables.html
294
- - spec/assets/external_images.docx
295
- - spec/assets/external_images.html
296
- - spec/assets/from_the_wild.html
297
- - spec/assets/full_example.html
298
- - spec/assets/html_fragment.html
299
- - spec/assets/lists.html
300
- - spec/assets/minimum.html
301
- - spec/assets/paragraphs.html
302
- - spec/assets/quotation.html
303
- - spec/assets/tables.html
304
- - spec/assets/unknown_tags.html
305
- - spec/bin/reverse_adoc_spec.rb
306
- - spec/bin/w2a_spec.rb
307
- - spec/components/anchors_spec.rb
308
- - spec/components/basic_spec.rb
309
- - spec/components/code_spec.rb
310
- - spec/components/escapables_spec.rb
311
- - spec/components/from_the_wild_spec.rb
312
- - spec/components/html_fragment_spec.rb
313
- - spec/components/lists_spec.rb
314
- - spec/components/paragraphs_spec.rb
315
- - spec/components/quotation_spec.rb
316
- - spec/components/tables_spec.rb
317
- - spec/components/unknown_tags_spec.rb
318
- - spec/lib/reverse_adoc.rb
319
- - spec/lib/reverse_adoc/cleaner_spec.rb
320
- - spec/lib/reverse_adoc/config_spec.rb
321
- - spec/lib/reverse_adoc/converters/aside_spec.rb
322
- - spec/lib/reverse_adoc/converters/audio_spec.rb
323
- - spec/lib/reverse_adoc/converters/blockquote_spec.rb
324
- - spec/lib/reverse_adoc/converters/br_spec.rb
325
- - spec/lib/reverse_adoc/converters/code_spec.rb
326
- - spec/lib/reverse_adoc/converters/div_spec.rb
327
- - spec/lib/reverse_adoc/converters/figure_spec.rb
328
- - spec/lib/reverse_adoc/converters/img_spec.rb
329
- - spec/lib/reverse_adoc/converters/li_spec.rb
330
- - spec/lib/reverse_adoc/converters/mark_spec.rb
331
- - spec/lib/reverse_adoc/converters/p_spec.rb
332
- - spec/lib/reverse_adoc/converters/pre_spec.rb
333
- - spec/lib/reverse_adoc/converters/q_spec.rb
334
- - spec/lib/reverse_adoc/converters/strong_spec.rb
335
- - spec/lib/reverse_adoc/converters/text_spec.rb
336
- - spec/lib/reverse_adoc/converters/video_spec.rb
337
- - spec/lib/reverse_adoc/converters_spec.rb
338
- - spec/spec_helper.rb
339
- - spec/support/shell_helpers.rb
289
+ test_files: []