lib/agig/session.rb in agig-0.1.2 vs lib/agig/session.rb in agig-0.1.3
- old
+ new
@@ -87,10 +87,12 @@
def reachable_url_for(latest_comment_url)
repos_owner = latest_comment_url.match(/repos\/(.+?\/.+?)\//)[1]
if issue_match = latest_comment_url.match(/(?:issues|pulls)\/(\d+?)$/)
issue_id = issue_match[1]
latest_comment = client.issue_comments(repos_owner, issue_id).last
- latest_comment ? latest_comment['html_url'] : latest_comment_url.sub(/api\./, '').sub(/repos\//, '')
+ latest_comment ?
+ latest_comment['html_url'] :
+ latest_comment_url.sub(/api\./, '').sub(/repos\//, '').sub(/pulls\//, 'pull/')
elsif comment_match = latest_comment_url.match(/comments\/(\d+?)$/)
comment_id = comment_match[1]
client.issue_comment(repos_owner, comment_id)['html_url']
else
nil