Browse Source

Refactor slightly.

master
Ben Kurtovic 8 years ago
parent
commit
8dc447cc48
1 changed files with 8 additions and 7 deletions
  1. +8
    -7
      lib/kgrader/backend/svn.rb

+ 8
- 7
lib/kgrader/backend/svn.rb View File

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

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

unless test_okay url
print "svn: password: "
@password = STDIN.noecho(&:gets).chomp
print "svn: bad password or other network issues" unless test_okay
print "svn: bad password or other network issues" unless test_okay url
end
end

@@ -71,11 +76,7 @@ module KGrader::Backend
}
end

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


Loading…
Cancel
Save