Merge branch 'develop' into 'develop'

pull requet文件更新对比 正则修改



See merge request !25
This commit is contained in:
黄井泉 2016-11-25 17:54:12 +08:00
commit 3c74bc7465
1 changed files with 2 additions and 2 deletions

View File

@ -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