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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 47a31dddb33a9e8dfbaed934d86d0911faa656fb
4
- data.tar.gz: eaab4bbaaf8c7aa5418d1d2ac39e4904655e50b3
3
+ metadata.gz: b53dc962dc9b4a814b1311a5178533de5ad77dbc
4
+ data.tar.gz: 66551c6bd3d034b34d5ae53a0bd060b75afda60c
5
5
  SHA512:
6
- metadata.gz: f0daad1a5d383b391f2e2adece4949e7ef929f45e291988c84075b8b2dbc9bae18cc43f89339886d0d134d0f3d0854a35214aab5bd309c78a48f3d21fc3e8ca4
7
- data.tar.gz: d1287cf3a9166bc59cc064fe57468999f590a84970bcb57991ebd030816ff3395177e61bed624cbcbec99cf25788af35acfd9133e4ebfc84de5fbbccce7a20a8
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
@@ -22,5 +22,5 @@ Failing example.
22
22
  -->
23
23
  <div class="quoteblock">
24
24
  <blockquote>A person who never made a mistake <em>never</em> tried anything new.</blockquote>
25
- <span>Albert Einstein</span>
25
+ <div>Albert Einstein</div>
26
26
  </div>
@@ -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
- <span>Albert Einstein</span>
45
+ <div>Albert Einstein</div>
46
46
  </div>
47
47
 
48
48
  <!-- .with_title -->
@@ -14,6 +14,9 @@ Before do
14
14
  FileUtils.mkdir_p TEMP_DIR
15
15
  # overwrite Aruba's default temp directory location
16
16
  @dirs = [TEMP_DIR]
17
+
18
+ # Increase timeout for JRuby, that is very slooow...
19
+ @aruba_timeout_seconds = 50
17
20
  end
18
21
 
19
22
  After do
@@ -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 <span>Albert Einstein</span>
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 <span>Albert Einstein</span>
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>
@@ -2,6 +2,8 @@ require 'active_support/core_ext/array/wrap'
2
2
  require 'active_support/core_ext/object/blank'
3
3
  require 'asciidoctor'
4
4
  require 'asciidoctor/converter/template'
5
+ require 'asciidoctor/doctest/core_ext'
6
+ require 'delegate'
5
7
 
6
8
  module Asciidoctor
7
9
  module DocTest
@@ -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:, examples_path: DocTest.examples_path)
24
- @file_ext = file_ext.freeze
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
@@ -1,5 +1,5 @@
1
1
  module Asciidoctor
2
2
  module DocTest
3
- VERSION = '1.5.1.1'
3
+ VERSION = '1.5.1.2'
4
4
  end
5
5
  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.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: 2014-12-30 00:00:00.000000000 Z
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.1'
394
+ version: '2.0'
395
395
  required_rubygems_version: !ruby/object:Gem::Requirement
396
396
  requirements:
397
397
  - - ">="