class EacLauncher::Publish::Base

Attributes

instance[R]

Public Class Methods

new(instance) click to toggle source
# File lib/eac_launcher/publish/base.rb, line 10
def initialize(instance)
  @instance = instance
end

Public Instance Methods

check() click to toggle source
# File lib/eac_launcher/publish/base.rb, line 22
def check
  s = check_with_rescue
  ::EacLauncher::Context.current.instance_manager.publish_state_set(
    instance, stereotype.stereotype_name, s.status
  )
  s
end
run() click to toggle source
# File lib/eac_launcher/publish/base.rb, line 14
def run
  s = check
  info("Check: #{s}")
  return unless s.status == ::EacLauncher::Publish::CheckResult::STATUS_PENDING

  publish
end

Private Instance Methods

check_with_rescue() click to toggle source
# File lib/eac_launcher/publish/base.rb, line 36
def check_with_rescue
  internal_check
rescue ::EacLauncher::Instances::Error => e
  ::EacLauncher::Publish::CheckResult.blocked("Error: #{e}")
rescue ::EacLauncher::Git::Error => e
  ::EacLauncher::Publish::CheckResult.blocked("Git error: #{e}")
end
stereotype() click to toggle source
# File lib/eac_launcher/publish/base.rb, line 32
def stereotype
  self.class.name.deconstantize.constantize
end