Sha256: 905cb82f22b5fc7f59d08975ab864570532bf02aef6c9b42018fcd95bf9c4163

Contents?: true

Size: 704 Bytes

Versions: 32

Compression:

Stored size: 704 Bytes

Contents

# frozen_string_literal: true

require 'asciidoctor'

module Avm
  module EacAsciidoctorBase0
    module Sources
      class Build
        class File
          enable_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
end

Version data entries

32 entries across 32 versions & 2 rubygems

Version Path
avm-tools-0.116.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.115.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.114.2 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.114.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.114.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.113.6 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.113.5 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.113.4 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-eac_asciidoctor_base0-0.3.3 lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.113.3 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.113.2 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-eac_asciidoctor_base0-0.3.2 lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.110.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.109.1 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.109.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.108.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.107.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.106.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-eac_asciidoctor_base0-0.3.1 lib/avm/eac_asciidoctor_base0/sources/build/file.rb
avm-tools-0.105.0 vendor/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/build/file.rb