Method: Jtest::Commands::New#create_workspace

Defined in:
lib/jtest/commands/new.rb

#create_workspaceObject



31
32
33
34
35
36
37
38
39
40
41
42
43
# File 'lib/jtest/commands/new.rb', line 31

def create_workspace
  say_status :working, "Creating workspace for #{@problem.title}", :yellow

  empty_directory @problem.dirname

  @problem.samples.each_with_index do |sample, index|
    create_file "#{@problem.dirname}/sample#{index+1}.dat", sample[0]
    create_file "#{@problem.dirname}/sample#{index+1}.out", sample[1]
  end

  template "../templates/main.tt", "#{@problem.dirname}/main.cc"
  template "../templates/Makefile.tt", "#{@problem.dirname}/Makefile"
end