lib/teapot/select.rb
# Add a definition to the current context.
Add a definition to the current context.
Add a definition to the current context .
def append definition
			case definition
			when Target
				AlreadyDefinedError.check(definition, @targets)
				@targets[definition.name] = definition
			when Configuration
				if definition.public? or definition.package == @context.root_package
					AlreadyDefinedError.check(definition, @configurations)
					@configurations[definition.name] = definition
				end
			when Project
				AlreadyDefinedError.check(definition, @projects)
				@projects[definition.name] = definition
			end
		end
def append definition case definition when Target AlreadyDefinedError . check ( definition , @targets ) @targets [ definition . name ] = definition when Configuration if definition . public? or definition . package == @context . root_package AlreadyDefinedError . check ( definition , @configurations ) @configurations [ definition . name ] = definition end when Project AlreadyDefinedError . check ( definition , @projects ) @projects [ definition . name ] = definition end end
Add a definition to the current context.
Add a definition to the current context .
# We define configurations in two cases, if they are public, or if they are part of the root package of this context.
definition