Sha256: cb5a0a6281a2173f02efcc6d345a264021beb4394afef6818b1105a0c706b653

Contents?: true

Size: 938 Bytes

Versions: 57

Compression:

Stored size: 938 Bytes

Contents

# frozen_string_literal: true

require 'avm/launcher/errors/base'
require 'eac_ruby_utils/core_ext'

module Avm
  module Launcher
    module Publish
      class Base
        common_constructor :instance

        def run
          s = check
          info("Check: #{s}")
          return unless s.status == ::Avm::Launcher::Publish::CheckResult::STATUS_PENDING

          publish
        end

        def check
          s = check_with_rescue
          ::Avm::Launcher::Context.current.instance_manager.publish_state_set(
            instance, stereotype.stereotype_name, s.status
          )
          s
        end

        private

        def stereotype
          self.class.name.deconstantize.constantize
        end

        def check_with_rescue
          internal_check
        rescue ::Avm::Launcher::Errors::Base => e
          ::Avm::Launcher::Publish::CheckResult.blocked("Error: #{e}")
        end
      end
    end
  end
end

Version data entries

57 entries across 57 versions & 2 rubygems

Version Path
eac_tools-0.57.0 sub/avm/lib/avm/launcher/publish/base.rb
eac_tools-0.56.1 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.66.0 lib/avm/launcher/publish/base.rb
eac_tools-0.56.0 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.65.0 lib/avm/launcher/publish/base.rb
eac_tools-0.55.7 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.64.2 lib/avm/launcher/publish/base.rb
eac_tools-0.55.6 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.64.1 lib/avm/launcher/publish/base.rb
eac_tools-0.55.5 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.64.0 lib/avm/launcher/publish/base.rb
eac_tools-0.55.4 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.63.0 lib/avm/launcher/publish/base.rb
eac_tools-0.55.3 sub/avm/lib/avm/launcher/publish/base.rb
eac_tools-0.55.2 sub/avm/lib/avm/launcher/publish/base.rb
eac_tools-0.55.1 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.62.0 lib/avm/launcher/publish/base.rb
eac_tools-0.55.0 sub/avm/lib/avm/launcher/publish/base.rb
avm-0.61.0 lib/avm/launcher/publish/base.rb
eac_tools-0.54.0 sub/avm/lib/avm/launcher/publish/base.rb