Description:
[grader] remove DRY for import_problem
git-svn-id: http://theory.cpe.ku.ac.th/grader/judge/trunk/scripts@177 6386c4cd-e34a-4fa8-8920-d93eb39b512e
Commit status:
[Not Reviewed]
References:
Diff options:
Comments:
0 Commit comments
0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
r47:a27841662750 - - 1 file changed: 2 inserted, 1 deleted
@@ -41,7 +41,7 | |||||
|
41 | if (ARGV.length < 4) or (ARGV[3][0,1]=="-") |
|
41 | if (ARGV.length < 4) or (ARGV[3][0,1]=="-") |
|
42 | puts <<USAGE |
|
42 | puts <<USAGE |
|
43 | using: import_problem name dir num check [options] |
|
43 | using: import_problem name dir num check [options] |
|
44 |
- where: name = problem_name |
|
44 | + where: name = problem_name (put '-' (dash) to use dir name) |
|
45 | dir = importing testcase directory |
|
45 | dir = importing testcase directory |
|
46 | num = number of testcases |
|
46 | num = number of testcases |
|
47 | check = check script, which can be |
|
47 | check = check script, which can be |
@@ -65,6 +65,7 | |||||
|
65 | # processing arguments |
|
65 | # processing arguments |
|
66 | problem = ARGV[0] |
|
66 | problem = ARGV[0] |
|
67 | testcase_dir = ARGV[1] |
|
67 | testcase_dir = ARGV[1] |
|
|
68 | + problem = File.basename(testcase_dir) if problem=="-" | ||
|
68 | num_testcases = ARGV[2].to_i |
|
69 | num_testcases = ARGV[2].to_i |
|
69 | check_script = ARGV[3] |
|
70 | check_script = ARGV[3] |
|
70 | options = {:time_limit => 1, :mem_limit => 16} |
|
71 | options = {:time_limit => 1, :mem_limit => 16} |
You need to be logged in to leave comments.
Login now