Description:
removes RUBYOPT env before calling judge scripts
Commit status:
[Not Reviewed]
References:
Comments:
0 Commit comments 0 Inline Comments
Unresolved TODOs:
There are no unresolved TODOs
Add another comment

r139:1e721a756b43 - - 1 file changed: 1 inserted, 0 deleted

@@ -91,48 +91,49
91 copy_log = load_copy_log(problem_home)
91 copy_log = load_copy_log(problem_home)
92 clear_copy_log(problem_home)
92 clear_copy_log(problem_home)
93 clear_script(copy_log,problem_home)
93 clear_script(copy_log,problem_home)
94 end
94 end
95
95
96 rescue RuntimeError => msg
96 rescue RuntimeError => msg
97 @reporter.report_error(submission, msg)
97 @reporter.report_error(submission, msg)
98
98
99 ensure
99 ensure
100 @room_maker.clean_up(submission)
100 @room_maker.clean_up(submission)
101 Dir.chdir(current_dir) # this is really important
101 Dir.chdir(current_dir) # this is really important
102 end
102 end
103 end
103 end
104
104
105 protected
105 protected
106
106
107 def talk(str)
107 def talk(str)
108 if @config.talkative
108 if @config.talkative
109 puts str
109 puts str
110 end
110 end
111 end
111 end
112
112
113 def call_judge(problem_home,language,grading_dir,fname)
113 def call_judge(problem_home,language,grading_dir,fname)
114 ENV['PROBLEM_HOME'] = problem_home
114 ENV['PROBLEM_HOME'] = problem_home
115 + ENV['RUBYOPT'] = ''
115
116
116 talk grading_dir
117 talk grading_dir
117 Dir.chdir grading_dir
118 Dir.chdir grading_dir
118 cmd = "#{problem_home}/script/judge #{language} #{fname}"
119 cmd = "#{problem_home}/script/judge #{language} #{fname}"
119 talk "CMD: #{cmd}"
120 talk "CMD: #{cmd}"
120 system(cmd)
121 system(cmd)
121 end
122 end
122
123
123 def get_std_script_dir
124 def get_std_script_dir
124 GRADER_ROOT + '/std-script'
125 GRADER_ROOT + '/std-script'
125 end
126 end
126
127
127 def copy_script(problem_home)
128 def copy_script(problem_home)
128 script_dir = "#{problem_home}/script"
129 script_dir = "#{problem_home}/script"
129 std_script_dir = get_std_script_dir
130 std_script_dir = get_std_script_dir
130
131
131 raise "std-script directory not found" if !FileTest.exist?(std_script_dir)
132 raise "std-script directory not found" if !FileTest.exist?(std_script_dir)
132
133
133 scripts = Dir[std_script_dir + '/*']
134 scripts = Dir[std_script_dir + '/*']
134
135
135 copied = []
136 copied = []
136
137
137 scripts.each do |s|
138 scripts.each do |s|
138 fname = File.basename(s)
139 fname = File.basename(s)
You need to be logged in to leave comments. Login now