Class: Heidi

Inherits:
Object
  • Object
show all
Defined in:
lib/heidi.rb,
lib/heidi/git.rb,
lib/heidi/web.rb,
lib/heidi/hook.rb,
lib/heidi/build.rb,
lib/heidi/shell.rb,
lib/heidi/tester.rb,
lib/heidi/builder.rb,
lib/heidi/project.rb,
lib/heidi/integrator.rb

Defined Under Namespace

Modules: Shell Classes: Build, Builder, Git, Hook, Integrator, Project, Tester, Web

Constant Summary collapse

PASSED =
"passed"
FAILED =
"failed"
DNF =
"DNF"

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(root = Dir.pwd) ⇒ Heidi

Returns a new instance of Heidi.



13
14
15
16
17
18
19
20
21
# File 'lib/heidi.rb', line 13

def initialize(root=Dir.pwd)
  @root = root
  @projects = []
  Dir[File.join(root,"projects", "*")].each do |project|
    next unless File.directory?(project)

    @projects << Heidi::Project.new(project)
  end
end

Instance Attribute Details

#projectsObject (readonly)

Returns the value of attribute projects.



11
12
13
# File 'lib/heidi.rb', line 11

def projects
  @projects
end

Instance Method Details

#[](name) ⇒ Object



23
24
25
26
27
28
# File 'lib/heidi.rb', line 23

def [](name)
  name = "#{name}"
  @projects.select do |project|
    project.name == name || File.basename(project.root) == name
  end.first
end