Method: Heidi::Build#initialize

Defined in:
lib/heidi/build.rb

#initialize(project, commit = project.commit) ⇒ Build

Returns a new instance of Build.



14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/heidi/build.rb', line 14

def initialize(project, commit=project.commit)
  @project = project
  @commit  = commit

  @root       = File.join(project.root, "logs", commit)
  @log_root   = File.join(@root, "logs")
  @build_root = File.join(@root, "build")

  if !File.exists? @root
    SimpleShell.new(project.root).mkdir %W(-p #{@root})
  end
  @shell = SimpleShell.new(@root)

  @shell.mkdir %W(-p #{@log_root}) unless File.exists?(@log_root)
  @logs = Logs.new(@log_root)
end