asciidoctor-interdoc-reftext 0.1.1 → 0.2.0

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: 5bf118d27282774a79f9de747c40893c28869eeee5bef9a410a96831c3d4df09
4
- data.tar.gz: 2a2ea538d8a78c72cd29acb2000dca3675283b4676dff9628744ceecde691ab2
3
+ metadata.gz: c198842d29c3f2d5ec0a2e10465885cd5172d698224f2cc05c2e0d72beda2d73
4
+ data.tar.gz: 2241e3587eaf4097ccc9d3a8305f8ce957d88d0d052cc7522401795b1d8d933c
5
5
  SHA512:
6
- metadata.gz: 4a65935a73ea23bbbc009209ff5677d3f6b61cb96bfd2af65c2296c87d3a6469e557d9aa7e3eb530d176fc8295a4c4e3a054500dc2e143b5f35fafb854a431ab
7
- data.tar.gz: 408672fd9341f1f0bcedb455c63fb625508cde6c9fe9843d53845ed41caaee91ca12b8fd94e772e66fd8fc0ad3f732bed54ad20f104e48bcbbb944171dbe25c1
6
+ metadata.gz: 662b5938301f727bba05fd130ad25cd5c101b3cfe43fbc75299f7f5f6fc9e0a5400f9d28997e005885ed04883ab0f68abe522623469c6d102f252998a186a614
7
+ data.tar.gz: 1cd4739d61b4d8279b4e24775b702f34425c4f09be3610f3f81885dc7415b3017c105c10be1bea99e1fd0d38ebafb2b28fec2c6d8de78ffca065f1279a94dff4
@@ -9,13 +9,21 @@ module Asciidoctor::InterdocReftext
9
9
 
10
10
  # @param document [Asciidoctor::Document] the document associated with this resolver.
11
11
  # @param asciidoc_exts [Array<String>] AsciiDoc file extensions (e.g. `.adoc`).
12
- # @param logger [Logger] the logger to use for logging warning and errors.
12
+ # @param logger [Logger, nil] the logger to use for logging warning and errors.
13
+ # Defaults to `Asciidoctor::LoggerManager.logger` if using Asciidoctor 1.5.7+,
14
+ # or `Logger.new(STDERR)` otherwise.
13
15
  # @param raise_exceptions [Boolean] whether to raise exceptions, or just log them.
14
16
  def initialize(document,
15
17
  asciidoc_exts: ['.adoc', '.asciidoc', '.ad'],
16
- logger: ::Logger.new(STDERR),
18
+ logger: nil,
17
19
  raise_exceptions: true)
18
20
 
21
+ logger ||= if defined? ::Asciidoctor::LoggerManager
22
+ ::Asciidoctor::LoggerManager.logger
23
+ else
24
+ ::Logger.new(STDERR)
25
+ end
26
+
19
27
  @document = document
20
28
  @asciidoc_exts = asciidoc_exts.dup.freeze
21
29
  @logger = logger
@@ -3,6 +3,6 @@
3
3
  module Asciidoctor
4
4
  module InterdocReftext
5
5
  # Version of the asciidoctor-interdoc-reftext gem.
6
- VERSION = '0.1.1'.freeze
6
+ VERSION = '0.2.0'.freeze
7
7
  end
8
8
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asciidoctor-interdoc-reftext
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jakub Jirutka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-03 00:00:00.000000000 Z
11
+ date: 2018-05-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: asciidoctor