Added mock build. Part 2
This commit is contained in:
@@ -2,9 +2,9 @@ require_relative "spork"
|
||||
require_relative "runner"
|
||||
|
||||
class MockManager
|
||||
attr :path, :config, :error, :last_status, :last_pid, :prep_dir
|
||||
attr :path, :config, :error, :last_status, :last_pid, :prep_dir, :db
|
||||
|
||||
def initialize(path, config, cfg_counter_path)
|
||||
def initialize(path, config, cfg_counter_path, db)
|
||||
@error = nil
|
||||
unless File.exist? (path)
|
||||
Dir.mkdir(path)
|
||||
@@ -12,6 +12,7 @@ class MockManager
|
||||
@path = path
|
||||
@config = config
|
||||
cntr = 0
|
||||
@db = db
|
||||
|
||||
File.open(cfg_counter_path, "r+") do |f|
|
||||
f.flock(File::LOCK_EX)
|
||||
@@ -23,5 +24,6 @@ class MockManager
|
||||
end
|
||||
tmp_name = (0...10).map { ("a".."z").to_a[rand(26)] }.join
|
||||
@prep_dir = File.join(path, "#{cntr}_#{tmp_name}")
|
||||
pp @prep_dir
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user