Selaa lähdekoodia

Various tweaks.

master
Ben Kurtovic 8 vuotta sitten
vanhempi
commit
3dcd234d01
4 muutettua tiedostoa jossa 14 lisäystä ja 10 poistoa
  1. +11
    -7
      lib/kgrader/backend/svn.rb
  2. +1
    -1
      lib/kgrader/jail.rb
  3. +1
    -1
      lib/kgrader/runtime.rb
  4. +1
    -1
      spec/cs241h

+ 11
- 7
lib/kgrader/backend/svn.rb Näytä tiedosto

@@ -14,15 +14,10 @@ module KGrader::Backend

def prepare(semester, assignment)
return unless @config['verify']
url = @config['verify'] % {
:semester => semester,
:assignment => assignment
}

status = run('list', '--non-interactive', url)[1]
if status.exited? && status.exitstatus != 0
unless test_okay
print "svn: password: "
@password = STDIN.noecho(&:gets).chomp
print "svn: bad password or other network issues" unless test_okay
end
end

@@ -75,5 +70,14 @@ module KGrader::Backend
:student => student
}
end

def test_okay
url = @config['verify'] % {
:semester => semester,
:assignment => assignment
}
status = run('list', '--non-interactive', url)[1]
status.exited? && status.exitstatus == 0
end
end
end

+ 1
- 1
lib/kgrader/jail.rb Näytä tiedosto

@@ -52,7 +52,7 @@ module KGrader
Dir.chdir @root
options = {
:in => :close, :out => fp, :err => fp, :close_others => true,
:rlimit_nproc => 32
:rlimit_nproc => 64
}
yield options if block_given?
Process.exec *command, options


+ 1
- 1
lib/kgrader/runtime.rb Näytä tiedosto

@@ -15,7 +15,6 @@ module KGrader
grade 0
end

puts "no grade received?"
comment "autograde error (no grade reported); please contact staff"
grade 0
end
@@ -27,6 +26,7 @@ module KGrader
end

def comment(text)
puts "comment: #{text}"
IO.new(4).write text + "\n"
end



+ 1
- 1
spec/cs241h

@@ -1 +1 @@
Subproject commit 22fd6cb688fcce712b4b68235533b59753aeaed7
Subproject commit 840fb087ef3a9644a4f1ebb01a6baf555a7aa496

Ladataan…
Peruuta
Tallenna