TeapotSourceTeapotProject

class Project

A project definition.

Definitions

def initialize(context, package, name)

Initialize a new project.

Signature

parameter context Context

The project context.

parameter package Package

The package.

parameter name String

The project name.

Implementation

def initialize(context, package, name)
	super context, package, name
	
	@version = "0.0.0"
	@authors = []
end

def name

Get the project name as a Build::Name object.

Signature

returns Build::Name

The project name.

Implementation

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

def freeze

Make the project immutable after all packages and configurations have been loaded.

Implementation

def freeze
	@title.freeze
	@summary.freeze
	@license.freeze
	@website.freeze
	@version.freeze
	
	@authors.freeze
	
	super
end

def add_author(name, options = {})

Add an author to the project.

Signature

parameter name String

The author name.

parameter options Hash

Author options (email, website).

Implementation

def add_author(name, options = {})
	@authors << Author.new(name, options[:email], options[:website])
end