瀏覽代碼

Refactor slightly.

master
Ben Kurtovic 8 年之前
父節點
當前提交
8dc447cc48
共有 1 個檔案被更改,包括 8 行新增7 行删除
  1. +8
    -7
      lib/kgrader/backend/svn.rb

+ 8
- 7
lib/kgrader/backend/svn.rb 查看文件

@@ -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…
取消
儲存