Sha256: bfd73383ff4434eb1eae874bd430ccf186302c35c4429060635a6ffc176002e8

Contents?: true

Size: 1023 Bytes

Versions: 13

Compression:

Stored size: 1023 Bytes

Contents

# frozen_string_literal: true

require 'os'
require 'eac_cli/core_ext'

module Avm
  module EacAsciidoctorBase0
    module Sources
      module Runners
        class Document
          class Build
            runner_with :help do
              bool_opt '-O', '--open'
            end

            def run
              %w[build open ending].each { |p| send("run_#{p}") }
            end

            private

            def build_document_uncached
              document.build_document
            end

            def run_build
              build_document.perform_self
            end

            def run_ending
              success 'Done'
            end

            def run_open
              return unless parsed.open?

              infov 'Opening', build_document.body_target_path
              ::EacRubyUtils::Envs.local.command(OS.open_file_command,
                                                 build_document.body_target_path).system!
            end
          end
        end
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 2 rubygems

Version Path
avm-eac_asciidoctor_base0-0.24.0 lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.96.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
avm-eac_asciidoctor_base0-0.23.0 lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.88.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.87.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
avm-eac_asciidoctor_base0-0.22.1 lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.86.13 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
avm-eac_asciidoctor_base0-0.22.0 lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.85.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.84.2 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.84.1 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
avm-eac_asciidoctor_base0-0.21.0 lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb
eac_tools-0.84.0 sub/avm-eac_asciidoctor_base0/lib/avm/eac_asciidoctor_base0/sources/runners/document/build.rb