Module: Avm::Launcher::Instances::Base
- Defined in:
- lib/avm/launcher/instances/base.rb,
lib/avm/launcher/instances/base/cache.rb
Defined Under Namespace
Modules: Cache
Instance Attribute Summary collapse
-
#parent ⇒ Object
Returns the value of attribute parent.
Class Method Summary collapse
Instance Method Summary collapse
- #included? ⇒ Boolean
- #name ⇒ Object
- #project? ⇒ Boolean
- #project_name ⇒ Object
- #publish_check ⇒ Object
- #publish_run ⇒ Object
- #stereotype?(stereotype) ⇒ Boolean
- #to_h ⇒ Object
- #to_parent_path ⇒ Object
Instance Attribute Details
#parent ⇒ Object
Returns the value of attribute parent.
30 31 32 |
# File 'lib/avm/launcher/instances/base.rb', line 30 def parent @parent end |
Class Method Details
.extend_object(object) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/avm/launcher/instances/base.rb', line 12 def extend_object(object) object.extend ::EacRubyUtils::SimpleCache object.extend ::EacRubyUtils::Speaker::Sender object.extend ::Avm::Launcher::Instances::Base::Cache super end |
.instanciate(path, parent) ⇒ Object
19 20 21 22 23 24 25 26 27 |
# File 'lib/avm/launcher/instances/base.rb', line 19 def instanciate(path, parent) unless path.is_a?(::Avm::Launcher::Instances::Base) raise ::Avm::Launcher::Errors::NonProject, path unless path.project? path.extend(::Avm::Launcher::Instances::Base) path.parent = parent end path end |
Instance Method Details
#included? ⇒ Boolean
72 73 74 |
# File 'lib/avm/launcher/instances/base.rb', line 72 def included? !::Avm::Launcher::Context.current.settings.excluded_projects.include?(project_name) end |
#name ⇒ Object
32 33 34 |
# File 'lib/avm/launcher/instances/base.rb', line 32 def name logical end |
#project? ⇒ Boolean
46 47 48 |
# File 'lib/avm/launcher/instances/base.rb', line 46 def project? stereotypes.any? end |
#project_name ⇒ Object
68 69 70 |
# File 'lib/avm/launcher/instances/base.rb', line 68 def project_name ::File.basename(logical) end |
#publish_check ⇒ Object
59 60 61 62 63 64 65 66 |
# File 'lib/avm/launcher/instances/base.rb', line 59 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
50 51 52 53 54 55 56 57 |
# File 'lib/avm/launcher/instances/base.rb', line 50 def publish_run stereotypes.each do |s| next unless publish?(s) infov(name, "publishing #{s.label}") s.publish_class.new(self).run end end |
#stereotype?(stereotype) ⇒ Boolean
36 37 38 |
# File 'lib/avm/launcher/instances/base.rb', line 36 def stereotype?(stereotype) stereotypes.include?(stereotype) end |
#to_h ⇒ Object
76 77 78 |
# File 'lib/avm/launcher/instances/base.rb', line 76 def to_h super.to_h.merge(parent: parent ? parent.logical : nil) end |
#to_parent_path ⇒ Object
40 41 42 43 44 |
# File 'lib/avm/launcher/instances/base.rb', line 40 def to_parent_path return self unless @parent logical.gsub(/\A#{Regexp.quote(@parent.logical)}/, '') end |