From f178923c10e0b6ee04f8dde876e6b09a0b69ed1b Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 27 Dec 2019 21:53:19 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=8A=A5=E9=94=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/hack_user_lastest_codes_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 976317107..d2632ce8c 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -152,7 +152,7 @@ class HackUserLastestCodesController < ApplicationController when 'Java' content.scan(/.java.\d+/).map{|s| s.match(/\d+/)[0].to_i}.min when 'C', 'C++' - content.scan(/\d:\d+: error/).map{|s| s.match(/\d+/)[0]}.min + content.scan(/\d:\d+:/).map{|s| s.match(/\d+/)[0]}.min when 'Python' content.scan(/line \d+/).map{|s| s.match(/\d+/)[0].to_i}.min end From 20dca4eb387251c5cab3591dec3c7c05a5454912 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 27 Dec 2019 21:56:33 +0800 Subject: [PATCH 2/2] 1 --- app/controllers/hack_user_lastest_codes_controller.rb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index d2632ce8c..fe21663b6 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -148,6 +148,7 @@ class HackUserLastestCodesController < ApplicationController # 正则错误行数 def regular_match_error_line content, language content = Base64.decode64(content).force_encoding("utf-8") + logger.info("######content: #{content}") case language when 'Java' content.scan(/.java.\d+/).map{|s| s.match(/\d+/)[0].to_i}.min