Class: Monoz::Project
- Inherits:
-
Object
- Object
- Monoz::Project
- Defined in:
- lib/monoz/project.rb
Instance Attribute Summary collapse
-
#dependants ⇒ Object
readonly
Returns the value of attribute dependants.
-
#dependencies ⇒ Object
readonly
Returns the value of attribute dependencies.
-
#frameworks ⇒ Object
readonly
Returns the value of attribute frameworks.
-
#gem_name ⇒ Object
readonly
Returns the value of attribute gem_name.
-
#gemspec ⇒ Object
readonly
Returns the value of attribute gemspec.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#root_path ⇒ Object
readonly
Returns the value of attribute root_path.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(root_path) ⇒ Project
constructor
A new instance of Project.
- #is_gem? ⇒ Boolean
- #text_color ⇒ Object
-
#update_dependants(collection) ⇒ Object
Update dependants of this project based on other projects in the collection.
- #valid? ⇒ Boolean
Constructor Details
#initialize(root_path) ⇒ Project
Returns a new instance of Project.
7 8 9 10 11 12 13 14 |
# File 'lib/monoz/project.rb', line 7 def initialize(root_path) @root_path = root_path parse_project_files parse_dependencies setup_instance_variables end |
Instance Attribute Details
#dependants ⇒ Object (readonly)
Returns the value of attribute dependants.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def dependants @dependants end |
#dependencies ⇒ Object (readonly)
Returns the value of attribute dependencies.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def dependencies @dependencies end |
#frameworks ⇒ Object (readonly)
Returns the value of attribute frameworks.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def frameworks @frameworks end |
#gem_name ⇒ Object (readonly)
Returns the value of attribute gem_name.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def gem_name @gem_name end |
#gemspec ⇒ Object (readonly)
Returns the value of attribute gemspec.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def gemspec @gemspec end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def name @name end |
#root_path ⇒ Object (readonly)
Returns the value of attribute root_path.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def root_path @root_path end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
5 6 7 |
# File 'lib/monoz/project.rb', line 5 def type @type end |
Instance Method Details
#is_gem? ⇒ Boolean
16 17 18 |
# File 'lib/monoz/project.rb', line 16 def is_gem? !gemspec_path.nil? end |
#text_color ⇒ Object
24 25 26 |
# File 'lib/monoz/project.rb', line 24 def text_color is_gem? ? :green : :blue end |
#update_dependants(collection) ⇒ Object
Update dependants of this project based on other projects in the collection
110 111 112 113 114 115 116 |
# File 'lib/monoz/project.rb', line 110 def update_dependants(collection) collection.each do |project| if project.dependencies.key?(name) project.dependants << self end end end |
#valid? ⇒ Boolean
20 21 22 |
# File 'lib/monoz/project.rb', line 20 def valid? @root_path != nil && gemfile_path != nil end |