Class: European::BuildSystem

Inherits:
NamedCarryAllItem show all
Defined in:
lib/european/build_system.rb

Instance Attribute Summary collapse

Attributes inherited from NamedCarryAllItem

#name, #proc

Instance Method Summary collapse

Methods inherited from NamedCarryAllItem

#exec, #setup, #to_s

Constructor Details

#initialize(args) ⇒ BuildSystem

Returns a new instance of BuildSystem.



7
8
9
10
11
# File 'lib/european/build_system.rb', line 7

def initialize(args)
  super args
  @projects = {}
  @builds = {}
end

Instance Attribute Details

#project_pathObject (readonly)

Returns the value of attribute project_path.



5
6
7
# File 'lib/european/build_system.rb', line 5

def project_path
  @project_path
end

#urlObject (readonly)

Returns the value of attribute url.



5
6
7
# File 'lib/european/build_system.rb', line 5

def url
  @url
end

Instance Method Details

#add_build(build) ⇒ Object



23
24
25
# File 'lib/european/build_system.rb', line 23

def add_build(build)
  @builds[build.name] = build
end

#add_project(project) ⇒ Object



19
20
21
# File 'lib/european/build_system.rb', line 19

def add_project(project)
  @projects[project.name] = project
end

#build(args) ⇒ Object



40
41
42
43
# File 'lib/european/build_system.rb', line 40

def build(args)
  named = args[:named] || raise('named is required')
  @builds[named]
end

#buildsObject



36
37
38
# File 'lib/european/build_system.rb', line 36

def builds
  @builds.values
end

#hosts_projects_at(project_path) ⇒ Object



51
52
53
# File 'lib/european/build_system.rb', line 51

def hosts_projects_at(project_path)
  @project_path = project_path
end

#project(args) ⇒ Object



31
32
33
34
# File 'lib/european/build_system.rb', line 31

def project(args)
  named = args[:named] || raise('named is required')
  @projects[named]
end

#projectsObject



27
28
29
# File 'lib/european/build_system.rb', line 27

def projects()
  @projects.values
end

#url_for_project_named(name) ⇒ Object

Methods invoked by CarryAll



15
16
17
# File 'lib/european/build_system.rb', line 15

def url_for_project_named(name)
  eval project_path
end

#url_is(url) ⇒ Object

DSL



47
48
49
# File 'lib/european/build_system.rb', line 47

def url_is(url)
  @url = url
end