Module: Avm::Launcher::Instances::Base::Publishing
- Defined in:
- lib/avm/launcher/instances/base/publishing.rb
Instance Method Summary collapse
- #publish?(stereotype) ⇒ Boolean
- #publish_by_application?(stereotype) ⇒ Boolean
- #publish_by_context?(stereotype) ⇒ Boolean
- #publish_by_stereotype?(stereotype) ⇒ Boolean
- #publish_check ⇒ Object
- #publish_run ⇒ Object
- #publishable? ⇒ Boolean
Instance Method Details
#publish?(stereotype) ⇒ 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
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
19 20 21 22 |
# File 'lib/avm/launcher/instances/base/publishing.rb', line 19 def publish_by_context?(stereotype) filter = ::Avm::Launcher::Context.current.[:stereotype] filter.blank? ? true : filter == stereotype.name.demodulize end |
#publish_by_stereotype?(stereotype) ⇒ 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_check ⇒ Object
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_run ⇒ Object
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
30 |
# File 'lib/avm/launcher/instances/base/publishing.rb', line 30 delegate :publishable?, to: :application |