Sha256: acf3e6ae0bbfd9d83f611ccaefe0f405da459c0ba5c0a715fdab2820b1075caa

Contents?: true

Size: 1.37 KB

Versions: 106

Compression:

Stored size: 1.37 KB

Contents

# frozen_string_literal: true

require 'avm/launcher/instances/runner_helper'

module Avm
  module Tools
    class Runner
      class Launcher
        class Publish
          runner_with :help, ::Avm::Launcher::Instances::RunnerHelper do
            desc 'Publica projetos ou instâncias.'
            bool_opt '-d', '--dry-run', '"Dry run" publishing.'
            bool_opt '--new', 'Publish projects not published before.'
            bool_opt '--run', 'Confirm publishing.'
            arg_opt '-s', '--stereotype', 'Publish only for stereotype <stereotype>.'
            pos_arg :instance_path, repeat: true, optional: true
          end

          def run
            build_publish_options
            instances.each do |i|
              next unless i.publishable?

              i.send(instance_method)
            end
          end

          private

          def dry_run?
            parsed.dry_run?
          end

          def instance_method
            run? || dry_run? ? 'publish_run' : 'publish_check'
          end

          def build_publish_options
            ::Avm::Launcher::Context.current.publish_options = publish_options
          end

          def publish_options
            { new: parsed.new?, stereotype: parsed.stereotype?, confirm: run? }
          end

          def run?
            parsed.run? && !dry_run?
          end
        end
      end
    end
  end
end

Version data entries

106 entries across 106 versions & 2 rubygems

Version Path
avm-tools-0.162.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.94.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.161.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.5 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.160.2 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.4 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.3 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.160.1 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.2 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.1 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.160.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.86.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.85.1 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.159.1 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.85.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.84.2 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.84.1 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.84.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.83.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.159.0 lib/avm/tools/runner/launcher/publish.rb