Class: Hatio::Bundle
- Inherits:
-
Object
- Object
- Hatio::Bundle
- Defined in:
- lib/hatio-core/bundle/hatio_bundle.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#bootstrap_controllers ⇒ Object
Returns the value of attribute bootstrap_controllers.
-
#changes ⇒ Object
Returns the value of attribute changes.
-
#dependencies ⇒ Object
Returns the value of attribute dependencies.
-
#description ⇒ Object
Returns the value of attribute description.
-
#email ⇒ Object
Returns the value of attribute email.
-
#entities ⇒ Object
Returns the value of attribute entities.
-
#module ⇒ Object
Returns the value of attribute module.
-
#name ⇒ Object
Returns the value of attribute name.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#url ⇒ Object
Returns the value of attribute url.
-
#version ⇒ Object
Returns the value of attribute version.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(name, version) {|_self| ... } ⇒ Bundle
constructor
A new instance of Bundle.
Constructor Details
#initialize(name, version) {|_self| ... } ⇒ Bundle
Returns a new instance of Bundle.
7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 7 def initialize(name, version) self.name = name self.version = version self.module = Kernel.const_get(name.gsub('-', '_').classify) self.entities = [] self.dependencies = [] self.bootstrap_controllers = [] yield self if block_given? $HATIO_BUNDLES << self end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def @author end |
#bootstrap_controllers ⇒ Object
Returns the value of attribute bootstrap_controllers.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def bootstrap_controllers @bootstrap_controllers end |
#changes ⇒ Object
Returns the value of attribute changes.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def changes @changes end |
#dependencies ⇒ Object
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def dependencies @dependencies end |
#description ⇒ Object
Returns the value of attribute description.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def description @description end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def email @email end |
#entities ⇒ Object
Returns the value of attribute entities.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def entities @entities end |
#module ⇒ Object
Returns the value of attribute module.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def module @module end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def name @name end |
#summary ⇒ Object
Returns the value of attribute summary.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def summary @summary end |
#url ⇒ Object
Returns the value of attribute url.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def url @url end |
#version ⇒ Object
Returns the value of attribute version.
5 6 7 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 5 def version @version end |
Class Method Details
.ordered_bundle_list ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 20 def self.ordered_bundle_list ordered_list = [] $HATIO_BUNDLES.each do |bundle| ordering_bundles bundle, ordered_list end ordered_list end |
.ordering_bundles(bundle, ordered_list) ⇒ Object
28 29 30 31 32 33 34 35 |
# File 'lib/hatio-core/bundle/hatio_bundle.rb', line 28 def self.ordering_bundles bundle, ordered_list return if ordered_list.include? bundle bundle.dependencies.each do |dep| dep_bundle = $HATIO_BUNDLES.detect{|b| b.name == dep} ordering_bundles dep_bundle, ordered_list if dep_bundle end ordered_list << bundle unless ordered_list.include? bundle end |