Class: Teapot::Project
- Inherits:
-
Definition
- Object
- Definition
- Teapot::Project
- Defined in:
- lib/teapot/project.rb
Overview
A project definition.
Defined Under Namespace
Classes: Author
Instance Attribute Summary collapse
-
#authors ⇒ Object
readonly
Returns the value of attribute authors.
-
#license ⇒ Object
Returns the value of attribute license.
-
#summary ⇒ Object
Returns the value of attribute summary.
-
#title ⇒ Object
Returns the value of attribute title.
-
#version ⇒ Object
Returns the value of attribute version.
-
#website ⇒ Object
Returns the value of attribute website.
Attributes inherited from Definition
#context, #description, #package
Instance Method Summary collapse
-
#add_author(name, options = {}) ⇒ Object
Add an author to the project.
-
#freeze ⇒ Object
Make the project immutable after all packages and configurations have been loaded.
-
#initialize(context, package, name) ⇒ Project
constructor
Initialize a new project.
-
#name ⇒ Object
Get the project name as a Build::Name object.
Methods inherited from Definition
Constructor Details
#initialize(context, package, name) ⇒ Project
Initialize a new project.
17 18 19 20 21 22 |
# File 'lib/teapot/project.rb', line 17 def initialize(context, package, name) super context, package, name @version = "0.0.0" @authors = [] end |
Instance Attribute Details
#authors ⇒ Object (readonly)
Returns the value of attribute authors.
55 56 57 |
# File 'lib/teapot/project.rb', line 55 def @authors end |
#license ⇒ Object
Returns the value of attribute license.
51 52 53 |
# File 'lib/teapot/project.rb', line 51 def license @license end |
#summary ⇒ Object
Returns the value of attribute summary.
50 51 52 |
# File 'lib/teapot/project.rb', line 50 def summary @summary end |
#title ⇒ Object
Returns the value of attribute title.
49 50 51 |
# File 'lib/teapot/project.rb', line 49 def title @title end |
#version ⇒ Object
Returns the value of attribute version.
53 54 55 |
# File 'lib/teapot/project.rb', line 53 def version @version end |
#website ⇒ Object
Returns the value of attribute website.
52 53 54 |
# File 'lib/teapot/project.rb', line 52 def website @website end |
Instance Method Details
#add_author(name, options = {}) ⇒ Object
Add an author to the project.
60 61 62 |
# File 'lib/teapot/project.rb', line 60 def (name, = {}) @authors << Author.new(name, [:email], [:website]) end |
#freeze ⇒ Object
Make the project immutable after all packages and configurations have been loaded.
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/teapot/project.rb', line 37 def freeze @title.freeze @summary.freeze @license.freeze @website.freeze @version.freeze @authors.freeze super end |
#name ⇒ Object
Get the project name as a Build::Name object.
26 27 28 29 30 31 32 33 34 |
# File 'lib/teapot/project.rb', line 26 def name if @title # Prefer title, it retains case. Build::Name.new(@title) else # Otherwise, if we don't have title, use the target name. Build::Name.from_target(@name) end end |