Sha256: d8019e7f8be0fe4e21a8e0ba757fa769c20c7554c5ecd4e2e55694bac3be1af9

Contents?: true

Size: 1.37 KB

Versions: 117

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.options.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

117 entries across 117 versions & 2 rubygems

Version Path
eac_tools-0.44.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.43.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.42.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.41.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.40.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.142.4 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.39.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.142.3 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.38.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.142.2 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.37.2 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.142.1 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.37.1 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.142.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.37.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.141.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.36.1 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.140.0 lib/avm/tools/runner/launcher/publish.rb
eac_tools-0.36.0 sub/avm-tools/lib/avm/tools/runner/launcher/publish.rb
avm-tools-0.139.0 lib/avm/tools/runner/launcher/publish.rb