Class: Cejo::Floss::ProjectInfo
- Inherits:
-
Object
- Object
- Cejo::Floss::ProjectInfo
- Defined in:
- lib/cejo/floss/project_info.rb
Overview
Provides Project Information
Instance Attribute Summary collapse
-
#folder ⇒ Object
readonly
Returns the value of attribute folder.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, language) ⇒ ProjectInfo
constructor
A new instance of ProjectInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(url, language) ⇒ ProjectInfo
Returns a new instance of ProjectInfo.
12 13 14 15 16 17 18 |
# File 'lib/cejo/floss/project_info.rb', line 12 def initialize(url, language) @url = URI.parse url @language = language @name = File.basename(@url.path.split('/').last, '.git') projects = Pathname.new(File.join(Dir.home, 'Projects')) @folder = projects.join language, name end |
Instance Attribute Details
#folder ⇒ Object (readonly)
Returns the value of attribute folder.
10 11 12 |
# File 'lib/cejo/floss/project_info.rb', line 10 def folder @folder end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/cejo/floss/project_info.rb', line 10 def name @name end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/cejo/floss/project_info.rb', line 10 def url @url end |
Instance Method Details
#to_s ⇒ Object
20 21 22 23 24 25 |
# File 'lib/cejo/floss/project_info.rb', line 20 def to_s <<~INFO repository: #{url} folder: #{folder} INFO end |