asciidoctor-doctest 1.5.1.1 → 1.5.1.2
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/CHANGELOG.adoc +6 -0
- data/LICENSE +1 -1
- data/features/fixtures/html-slim/examples/html/block_quote.html +1 -1
- data/features/generator_html.feature +1 -1
- data/features/support/env.rb +3 -0
- data/features/test_html.feature +2 -2
- data/lib/asciidoctor/doctest/asciidoc_renderer.rb +2 -0
- data/lib/asciidoctor/doctest/base_examples_suite.rb +5 -3
- data/lib/asciidoctor/doctest/core_ext.rb +15 -0
- data/lib/asciidoctor/doctest/version.rb +1 -1
- data/spec/shared_examples/base_examples_suite.rb +22 -0
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b53dc962dc9b4a814b1311a5178533de5ad77dbc
|
4
|
+
data.tar.gz: 66551c6bd3d034b34d5ae53a0bd060b75afda60c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ac106abb1cff5378e3f8884ff1b2d48dc93f28851d9411ccfa00edfa27b26443ee3f3c05548dd9fd3dcbd9d32405cc8e2e7f53a79a5e63d83a49770c2d7c85fe
|
7
|
+
data.tar.gz: b31a3fbb5fdaa396edfbba6dbf735032c3bce9bd91f11d339000b69506841e9f43567896f92f01b60881650c4a694953d769adae2cd3c12259c571e595e5489b
|
data/CHANGELOG.adoc
CHANGED
@@ -7,6 +7,12 @@ 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.2 (2015-01-03)
|
11
|
+
|
12
|
+
Improvements::
|
13
|
+
* Support for MRI 2.0.0 and JRuby 9000-dev [{commit-uri}/8908c5d[8908c5d], {commit-uri}/748d54a[748d54a]].
|
14
|
+
|
15
|
+
|
10
16
|
== 1.5.1.1 (2014-12-30)
|
11
17
|
|
12
18
|
Bug fixes::
|
data/LICENSE
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License
|
2
2
|
|
3
|
-
Copyright 2014 Jakub Jirutka <jakub@jirutka.cz> and the Asciidoctor Project.
|
3
|
+
Copyright 2014-2015 Jakub Jirutka <jakub@jirutka.cz> and the Asciidoctor Project.
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
@@ -42,7 +42,7 @@ Feature: Generating output examples for a custom HTML backend
|
|
42
42
|
-->
|
43
43
|
<div class="quoteblock">
|
44
44
|
<blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
|
45
|
-
<
|
45
|
+
<div>Albert Einstein</div>
|
46
46
|
</div>
|
47
47
|
|
48
48
|
<!-- .with_title -->
|
data/features/support/env.rb
CHANGED
data/features/test_html.feature
CHANGED
@@ -13,7 +13,7 @@ Feature: Testing a custom HTML backend
|
|
13
13
|
|
14
14
|
<div class="quoteblock">
|
15
15
|
<blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
|
16
|
-
E <
|
16
|
+
E <div>Albert Einstein</div>
|
17
17
|
A <div class="attribution">— Albert Einstein</div>
|
18
18
|
</div>
|
19
19
|
"""
|
@@ -49,7 +49,7 @@ Feature: Testing a custom HTML backend
|
|
49
49
|
|
50
50
|
<div class="quoteblock">
|
51
51
|
E <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
|
52
|
-
E <
|
52
|
+
E <div>Albert Einstein</div>
|
53
53
|
A <blockquote>A person who never made a mistake --TEMPLATE NOT FOUND-- tried anything new.</blockquote>
|
54
54
|
A <div class="attribution">— Albert Einstein</div>
|
55
55
|
</div>
|
@@ -15,13 +15,15 @@ module Asciidoctor
|
|
15
15
|
|
16
16
|
##
|
17
17
|
# @param file_ext [String] the filename extension (e.g. +.adoc+) of the
|
18
|
-
# examples group files.
|
18
|
+
# examples group files. Must not be +nil+ or blank. (required)
|
19
19
|
#
|
20
20
|
# @param examples_path [String, Array<String>] path of the directory (or
|
21
21
|
# multiple directories) where to look for the examples.
|
22
22
|
#
|
23
|
-
def initialize(file_ext
|
24
|
-
|
23
|
+
def initialize(file_ext: nil, examples_path: DocTest.examples_path)
|
24
|
+
fail ArgumentError, 'file_ext must not be blank or nil' if file_ext.blank?
|
25
|
+
|
26
|
+
@file_ext = file_ext.strip.freeze
|
25
27
|
@examples_path = Array.wrap(examples_path).freeze
|
26
28
|
@examples_cache = {}
|
27
29
|
end
|
@@ -47,3 +47,18 @@ class String
|
|
47
47
|
end
|
48
48
|
end
|
49
49
|
end
|
50
|
+
|
51
|
+
|
52
|
+
# Workarounds for JRuby.
|
53
|
+
if RUBY_ENGINE == 'jruby'
|
54
|
+
require 'delegate'
|
55
|
+
|
56
|
+
# @private
|
57
|
+
class SimpleDelegator
|
58
|
+
|
59
|
+
# https://github.com/jruby/jruby/issues/2412
|
60
|
+
def warn(*msg)
|
61
|
+
Kernel.warn(*msg)
|
62
|
+
end
|
63
|
+
end
|
64
|
+
end
|
@@ -11,6 +11,28 @@ shared_examples DocTest::BaseExamplesSuite do
|
|
11
11
|
let(:ex_path) { ['/tmp/alpha', '/tmp/beta'] }
|
12
12
|
|
13
13
|
|
14
|
+
describe '#initialize' do
|
15
|
+
|
16
|
+
subject(:init) { described_class.new(args) }
|
17
|
+
let(:args) { {} }
|
18
|
+
|
19
|
+
{'nil' => nil, 'blank' => ' '}.each do |desc, file_ext|
|
20
|
+
context "with file_ext #{desc}" do
|
21
|
+
let(:args) { {file_ext: file_ext, examples_path: ex_path} }
|
22
|
+
it { expect { init }.to raise_error ArgumentError }
|
23
|
+
end
|
24
|
+
end
|
25
|
+
|
26
|
+
context 'with examples_path string' do
|
27
|
+
let(:args) { {file_ext: '.html', examples_path: '/foo/bar'} }
|
28
|
+
|
29
|
+
it 'wraps string to array' do
|
30
|
+
is_expected.to have_attributes(examples_path: ['/foo/bar'])
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
|
14
36
|
describe '#parse' do
|
15
37
|
context 'empty file' do
|
16
38
|
subject { suite.parse '', 'block_ulist' }
|
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.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jakub Jirutka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-01-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -391,7 +391,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
391
391
|
requirements:
|
392
392
|
- - ">="
|
393
393
|
- !ruby/object:Gem::Version
|
394
|
-
version: '2.
|
394
|
+
version: '2.0'
|
395
395
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
396
396
|
requirements:
|
397
397
|
- - ">="
|