asciidoctor-doctest 1.5.1 → 1.5.1.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
  SHA1:
3
- metadata.gz: 479daec9ac0dc0ec44479eb7675e59a7bc17889d
4
- data.tar.gz: ee45df8e137d9e67c1e042f132b4c729bd3c021d
3
+ metadata.gz: 47a31dddb33a9e8dfbaed934d86d0911faa656fb
4
+ data.tar.gz: eaab4bbaaf8c7aa5418d1d2ac39e4904655e50b3
5
5
  SHA512:
6
- metadata.gz: 6e5edb9b2d8b24065e3546422d93be5632ae76295cefad0d60b502ced846bad0e5144974e4e4f64dc35832ef08c5b222a2b7e78204424d4c73a645c98a40c3be
7
- data.tar.gz: d76d62985066c12587a7233d2546a5c923aa97a4578eb5e3895c930aa986a00ad5bcbf0f6b1c5f7addf75310f2a4ff6fddcb245572dca26e61a0c9d178a0e75d
6
+ metadata.gz: f0daad1a5d383b391f2e2adece4949e7ef929f45e291988c84075b8b2dbc9bae18cc43f89339886d0d134d0f3d0854a35214aab5bd309c78a48f3d21fc3e8ca4
7
+ data.tar.gz: d1287cf3a9166bc59cc064fe57468999f590a84970bcb57991ebd030816ff3395177e61bed624cbcbec99cf25788af35acfd9133e4ebfc84de5fbbccce7a20a8
data/CHANGELOG.adoc CHANGED
@@ -7,6 +7,14 @@ This document provides a high-level view of the changes introduced in DocTest by
7
7
  For a detailed view of what has changed, refer to the {repo-uri}/commits/master[commit history] on GitHub.
8
8
 
9
9
 
10
+ == 1.5.1.1 (2014-12-30)
11
+
12
+ Bug fixes::
13
+ * Avoid setting `backend_name` to an empty string.
14
+ When there’s an empty string and code highlighter is set to Pygments or CodeRay, then Asciidoctor doesn’t highlight listings at all. [{commit-uri}/bf5f077[bf5f077]]
15
+ * Update https://github.com/threedaymonk/htmlbeautifier[htmlbeautifier] to 0.0.11 that doesn’t modify content of `pre` element and adds newlines around block elements. {issue-uri}/3[#3] [{commit-uri}/4aaa137[4aaa137]]
16
+
17
+
10
18
  == 1.5.1 (2014-12-29)
11
19
 
12
20
  Improvements::
@@ -46,8 +46,10 @@ Feature: Generating output examples for a custom HTML backend
46
46
  </div>
47
47
 
48
48
  <!-- .with_title -->
49
- <section class="quoteblock"><h6>After landing the cloaked Klingon bird of prey in Golden Gate park:</h6>
50
- <blockquote>Everybody remember where we parked.</blockquote></section>
49
+ <section class="quoteblock">
50
+ <h6>After landing the cloaked Klingon bird of prey in Golden Gate park:</h6>
51
+ <blockquote>Everybody remember where we parked.</blockquote>
52
+ </section>
51
53
 
52
54
  """
53
55
  And the file "examples/html/document.html" should contain exactly:
@@ -106,15 +108,15 @@ Feature: Generating output examples for a custom HTML backend
106
108
  Failing example.
107
109
  -->
108
110
  <div class="quoteblock">
109
- <blockquote>A person who never made a mistake
110
- <em>never</em>
111
- tried anything new.</blockquote>
111
+ <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
112
112
  <div class="attribution">— Albert Einstein</div>
113
113
  </div>
114
114
 
115
115
  <!-- .with_title -->
116
- <section class="quoteblock"><h6>After landing the cloaked Klingon bird of prey in Golden Gate park:</h6>
117
- <blockquote>Everybody remember where we parked.</blockquote></section>
116
+ <section class="quoteblock">
117
+ <h6>After landing the cloaked Klingon bird of prey in Golden Gate park:</h6>
118
+ <blockquote>Everybody remember where we parked.</blockquote>
119
+ </section>
118
120
 
119
121
  """
120
122
  And the file "examples/html/document.html" should contain exactly:
@@ -162,9 +164,7 @@ Feature: Generating output examples for a custom HTML backend
162
164
  Failing example.
163
165
  -->
164
166
  <div class="quoteblock">
165
- <blockquote>A person who never made a mistake
166
- <em>never</em>
167
- tried anything new.</blockquote>
167
+ <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
168
168
  <div class="attribution">— Albert Einstein</div>
169
169
  </div>
170
170
 
@@ -11,9 +11,8 @@ Feature: Testing a custom HTML backend
11
11
  TestHtml :: block_quote : with_attribution:
12
12
  Failing example..
13
13
 
14
- <blockquote>A person who never made a mistake
15
- <em>never</em>
16
- tried anything new.</blockquote>
14
+ <div class="quoteblock">
15
+ <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
17
16
  E <span>Albert Einstein</span>
18
17
  A <div class="attribution">— Albert Einstein</div>
19
18
  </div>
@@ -49,9 +48,7 @@ Feature: Testing a custom HTML backend
49
48
  Failing example..
50
49
 
51
50
  <div class="quoteblock">
52
- E <blockquote>A person who never made a mistake
53
- E <em>never</em>
54
- E tried anything new.</blockquote>
51
+ E <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
55
52
  E <span>Albert Einstein</span>
56
53
  A <blockquote>A person who never made a mistake --TEMPLATE NOT FOUND-- tried anything new.</blockquote>
57
54
  A <div class="attribution">— Albert Einstein</div>
@@ -1,4 +1,5 @@
1
1
  require 'active_support/core_ext/array/wrap'
2
+ require 'active_support/core_ext/object/blank'
2
3
  require 'asciidoctor'
3
4
  require 'asciidoctor/converter/template'
4
5
 
@@ -12,7 +13,7 @@ module Asciidoctor
12
13
  attr_reader :backend_name, :converter, :template_dirs
13
14
 
14
15
  ##
15
- # @param backend_name [#to_s] the name of the tested backend.
16
+ # @param backend_name [#to_s, nil] the name of the tested backend.
16
17
  #
17
18
  # @param converter [Class, Asciidoctor::Converter::Base, nil]
18
19
  # the backend's converter class (or its instance). If not
@@ -33,10 +34,10 @@ module Asciidoctor
33
34
  # @raise [ArgumentError] if some path from the +template_dirs+ doesn't
34
35
  # exist or is not a directory.
35
36
  #
36
- def initialize(backend_name: '', converter: nil, template_dirs: [],
37
+ def initialize(backend_name: nil, converter: nil, template_dirs: [],
37
38
  templates_fallback: false)
38
39
 
39
- @backend_name = backend_name.freeze
40
+ @backend_name = backend_name.to_s.freeze.presence
40
41
  @converter = converter
41
42
  @converter ||= NoFallbackTemplateConverter unless template_dirs.empty? || templates_fallback
42
43
 
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module DocTest
3
- VERSION = '1.5.1'
3
+ VERSION = '1.5.1.1'
4
4
  end
5
5
  end
@@ -11,12 +11,17 @@ describe DocTest::AsciidocRenderer do
11
11
 
12
12
  context 'with defaults' do
13
13
  subject { described_class.new }
14
- it { is_expected.to have_attributes backend_name: '', converter: nil, template_dirs: nil }
14
+ it { is_expected.to have_attributes backend_name: nil, converter: nil, template_dirs: nil }
15
15
  end
16
16
 
17
17
  context 'with backend_name' do
18
18
  subject { described_class.new(backend_name: 'html5') }
19
19
  it { is_expected.to have_attributes backend_name: 'html5' }
20
+
21
+ context 'empty string' do
22
+ subject { described_class.new(backend_name: '') }
23
+ it { is_expected.to have_attributes backend_name: nil }
24
+ end
20
25
  end
21
26
 
22
27
  context 'with template_dirs' do
@@ -230,7 +230,7 @@ describe DocTest::HTML::ExamplesSuite do
230
230
  let(:rendered) { '<p><b>chunky</b> bacon</p>' }
231
231
 
232
232
  it 'returns content without top-level <p> tags' do
233
- expect(result.content.gsub(/\s+/, ' ')).to eq '<b>chunky</b> bacon'
233
+ expect(result.content).to eq '<b>chunky</b> bacon'
234
234
  end
235
235
 
236
236
  it 'does not add implicit include into returned example' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-doctest
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Jirutka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-29 00:00:00.000000000 Z
11
+ date: 2014-12-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport
@@ -72,14 +72,14 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.0.10
75
+ version: 0.0.11
76
76
  type: :runtime
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.0.10
82
+ version: 0.0.11
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: minitest
85
85
  requirement: !ruby/object:Gem::Requirement