Sha256: dd6779a393c3c19f6f5f888efc70d46d586f7134f3c4ddd63c231555e93d5212

Contents?: true

Size: 651 Bytes

Versions: 9

Compression:

Stored size: 651 Bytes

Contents

# frozen_string_literal: true

require 'asciidoctor'

module Avm
  module EacAsciidoctorBase0
    class Build
      class File
        enable_console_speaker
        common_constructor :build, :subpath

        def run
          infov 'Building', subpath
          ::Asciidoctor.convert_file source_path.to_path,
                                     to_file: target_path.to_path, safe: :unsafe, mkdirs: true
        end

        def source_path
          build.project.root.join(subpath)
        end

        def target_path
          build.target_directory.join(subpath).basename_sub('.*') { |b| "#{b}.html" }
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
avm-tools-0.96.0 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.95.0 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.94.3 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.94.2 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.94.1 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.94.0 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.93.0 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.92.0 lib/avm/eac_asciidoctor_base0/build/file.rb
avm-tools-0.91.0 lib/avm/eac_asciidoctor_base0/build/file.rb