Module: Avm::Launcher::Instances::Base::Publishing

Defined in:
lib/avm/launcher/instances/base/publishing.rb

Instance Method Summary collapse

Instance Method Details

#publish?(stereotype) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
# File 'lib/avm/launcher/instances/base/publishing.rb', line 8

def publish?(stereotype)
  publish_by_stereotype?(stereotype) && publish_by_application?(stereotype) &&
    publish_by_context?(stereotype)
end

#publish_by_application?(stereotype) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/avm/launcher/instances/base/publishing.rb', line 14

def publish_by_application?(stereotype)
  application.stereotype_publishable?(stereotype)
end

#publish_by_context?(stereotype) ⇒ Boolean

Returns:

  • (Boolean)


19
20
21
22
# File 'lib/avm/launcher/instances/base/publishing.rb', line 19

def publish_by_context?(stereotype)
  filter = ::Avm::Launcher::Context.current.publish_options[:stereotype]
  filter.blank? ? true : filter == stereotype.name.demodulize
end

#publish_by_stereotype?(stereotype) ⇒ Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/avm/launcher/instances/base/publishing.rb', line 25

def publish_by_stereotype?(stereotype)
  stereotype.publish_class.present?
end

#publish_checkObject



32
33
34
35
36
37
38
39
# File 'lib/avm/launcher/instances/base/publishing.rb', line 32

def publish_check
  stereotypes.each do |s|
    next unless publish?(s)

    puts "#{name.to_s.cyan}|#{s.label}|" \
         "#{s.publish_class.new(self).check}"
  end
end

#publish_runObject



41
42
43
44
45
46
47
48
# File 'lib/avm/launcher/instances/base/publishing.rb', line 41

def publish_run
  stereotypes.each do |s|
    next unless publish?(s)

    infov(name, "publishing #{s.label}")
    s.publish_class.new(self).run
  end
end

#publishable?Boolean

Returns:

  • (Boolean)


30
# File 'lib/avm/launcher/instances/base/publishing.rb', line 30

delegate :publishable?, to: :application