Class: Cejo::Projects::ProjectInfo
- Inherits:
-
Object
- Object
- Cejo::Projects::ProjectInfo
- Defined in:
- lib/cejo/projects/project_info.rb
Overview
Project Information
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
-
#local_folder ⇒ Object
readonly
Returns the value of attribute local_folder.
-
#main_config ⇒ Object
readonly
Returns the value of attribute main_config.
-
#utils ⇒ Object
readonly
Returns the value of attribute utils.
Instance Method Summary collapse
- #commands ⇒ Object
- #folder ⇒ Object
-
#initialize(folders, info) ⇒ ProjectInfo
constructor
A new instance of ProjectInfo.
- #main_branch ⇒ Object
- #name ⇒ Object
- #patch ⇒ Object
-
#patches ⇒ Object
Folder with all patches available.
- #purge ⇒ Object
- #repository ⇒ Object
- #tag ⇒ Object
- #to_s ⇒ Object
- #url ⇒ Object
Constructor Details
#initialize(folders, info) ⇒ ProjectInfo
Returns a new instance of ProjectInfo.
12 13 14 15 |
# File 'lib/cejo/projects/project_info.rb', line 12 def initialize(folders, info) @main_config = folders.cejo_config @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
10 11 12 |
# File 'lib/cejo/projects/project_info.rb', line 10 def info @info end |
#local_folder ⇒ Object (readonly)
Returns the value of attribute local_folder.
10 11 12 |
# File 'lib/cejo/projects/project_info.rb', line 10 def local_folder @local_folder end |
#main_config ⇒ Object (readonly)
Returns the value of attribute main_config.
10 11 12 |
# File 'lib/cejo/projects/project_info.rb', line 10 def main_config @main_config end |
#utils ⇒ Object (readonly)
Returns the value of attribute utils.
10 11 12 |
# File 'lib/cejo/projects/project_info.rb', line 10 def utils @utils end |
Instance Method Details
#commands ⇒ Object
37 38 39 |
# File 'lib/cejo/projects/project_info.rb', line 37 def commands info[:commands] end |
#folder ⇒ Object
17 18 19 |
# File 'lib/cejo/projects/project_info.rb', line 17 def folder Pathname.new(Dir.home).join('Builds', name) end |
#main_branch ⇒ Object
45 46 47 |
# File 'lib/cejo/projects/project_info.rb', line 45 def main_branch info[:default] end |
#name ⇒ Object
21 22 23 |
# File 'lib/cejo/projects/project_info.rb', line 21 def name info[:name] end |
#patch ⇒ Object
33 34 35 |
# File 'lib/cejo/projects/project_info.rb', line 33 def patch info[:patch] end |
#patches ⇒ Object
Folder with all patches available
56 57 58 |
# File 'lib/cejo/projects/project_info.rb', line 56 def patches main_config.join('patches').join name end |
#purge ⇒ Object
41 42 43 |
# File 'lib/cejo/projects/project_info.rb', line 41 def purge info[:purge] end |
#repository ⇒ Object
49 50 51 52 53 |
# File 'lib/cejo/projects/project_info.rb', line 49 def repository require 'git' Git.open folder end |
#tag ⇒ Object
29 30 31 |
# File 'lib/cejo/projects/project_info.rb', line 29 def tag info[:tag] end |
#to_s ⇒ Object
60 61 62 63 64 65 66 67 68 69 70 71 |
# File 'lib/cejo/projects/project_info.rb', line 60 def to_s <<~INFO ❯ Building Project Name: #{name.capitalize} Url: #{url} Default: #{main_branch} Tag: #{tag} Patch: #{patch} Folder: #{folder} INFO end |
#url ⇒ Object
25 26 27 |
# File 'lib/cejo/projects/project_info.rb', line 25 def url info[:url] end |