require 'pathname'

module Asciidoctor
  module DocTest

    BUILTIN_EXAMPLES_PATH = Pathname.new(
      '../../data/examples/asciidoc').expand_path(__dir__).to_s.freeze

    @examples_path = [ BUILTIN_EXAMPLES_PATH ]

    class << self
      # @return [Array<String>] paths of the directories where to look for the
      #   examples suites. Use +unshift+ to add your paths before the built-in
      #   reference input examples (default: +["{asciidoctor-doctest}/data/examples/asciidoc"]+).
      attr_accessor :examples_path
    end
  end
end

# Allow to use shorten module name.
DocTest = Asciidoctor::DocTest unless defined? DocTest

require 'asciidoctor/doctest/version'
require 'asciidoctor/doctest/base_example'
require 'asciidoctor/doctest/base_examples_suite'
require 'asciidoctor/doctest/generator'
require 'asciidoctor/doctest/rake_tasks'
require 'asciidoctor/doctest/test_reporter'
require 'asciidoctor/doctest/tester'
require 'asciidoctor/doctest/asciidoc/examples_suite'
require 'asciidoctor/doctest/html/examples_suite'

require 'pathname'

module Asciidoctor
  module DocTest

    @examples_path = Pathname.new(
      '../../data/examples/asciidoc').expand_path(__dir__).to_s.freeze

    # @return [Array<String>] paths of the built-in input examples. It always
    #   returns a new array.
    def self.examples_path
      [ @examples_path ]
    end
  end
end

# Allow to use shorten module name.
DocTest = Asciidoctor::DocTest unless defined? DocTest

require 'asciidoctor/doctest/version'
require 'asciidoctor/doctest/base_example'
require 'asciidoctor/doctest/base_examples_suite'
require 'asciidoctor/doctest/generator'
require 'asciidoctor/doctest/rake_tasks'
require 'asciidoctor/doctest/test_reporter'
require 'asciidoctor/doctest/tester'
require 'asciidoctor/doctest/asciidoc/examples_suite'
require 'asciidoctor/doctest/html/examples_suite'

Change DocTest.examples_path to be read-only
Change DocTest.examples_path to be read-only
