From 9c12e774d174c20eb2b982c3a25ac49eedd6c376 Mon Sep 17 00:00:00 2001 From: huang Date: Fri, 25 Nov 2016 17:50:37 +0800 Subject: [PATCH] =?UTF-8?q?pull=20request=20=E6=96=87=E4=BB=B6=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E6=AD=A3=E5=88=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/pull_requests_helper.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/pull_requests_helper.rb b/app/helpers/pull_requests_helper.rb index c89a3be0f..983ab848c 100644 --- a/app/helpers/pull_requests_helper.rb +++ b/app/helpers/pull_requests_helper.rb @@ -2,12 +2,12 @@ module PullRequestsHelper # 获取diff内容行号 def diff_line_num content - content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i + result = content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.nil? ? "" : content.scan(/@@ -(\d+),\d+ \+\d+,\d+ @@/).first.join("").to_i end # 处理内容 def diff_content content - content.gsub!(/.*@@ -\d+,\d+ \+\d+,\d+ @@\n/m,'') + result = content.gsub!(/.*@@.*@@\n/m,'') end def get_user_name user_id