Class: MiniYard::Folder
- Inherits:
-
Object
- Object
- MiniYard::Folder
- Defined in:
- lib/miniyard/folder.rb
Instance Attribute Summary collapse
-
#ci ⇒ Object
readonly
Returns the value of attribute ci.
-
#cov ⇒ Object
readonly
Returns the value of attribute cov.
-
#doc ⇒ Object
readonly
Returns the value of attribute doc.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #get_ci_url ⇒ Object
-
#initialize(path) ⇒ Folder
constructor
A new instance of Folder.
Constructor Details
#initialize(path) ⇒ Folder
Returns a new instance of Folder.
5 6 7 8 9 10 11 |
# File 'lib/miniyard/folder.rb', line 5 def initialize(path) @path = path @name = File.basename(path) @doc = File.directory?(File.join(path, 'doc')) ? "yes" : "no" @cov = File.directory?(File.join(path, 'cov')) ? "yes" : "no" @ci = get_ci_url end |
Instance Attribute Details
#ci ⇒ Object (readonly)
Returns the value of attribute ci.
3 4 5 |
# File 'lib/miniyard/folder.rb', line 3 def ci @ci end |
#cov ⇒ Object (readonly)
Returns the value of attribute cov.
3 4 5 |
# File 'lib/miniyard/folder.rb', line 3 def cov @cov end |
#doc ⇒ Object (readonly)
Returns the value of attribute doc.
3 4 5 |
# File 'lib/miniyard/folder.rb', line 3 def doc @doc end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/miniyard/folder.rb', line 3 def name @name end |
Instance Method Details
#get_ci_url ⇒ Object
13 14 15 16 17 18 19 20 |
# File 'lib/miniyard/folder.rb', line 13 def get_ci_url ci_file = File.join(@path, 'ci.url') if File.file?(ci_file) File.open(ci_file, 'r'){|f| @ci_file = f.read.chop.strip } else "no" end end |