Added mock build. Part 2

This commit is contained in:
alexey
2025-03-11 23:54:19 +03:00
parent 48b648f46b
commit 103be7f402
7 changed files with 63 additions and 4 deletions

View File

@@ -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