lib/onebox/engine/github_pullrequest_onebox.rb in onebox-1.3.8 vs lib/onebox/engine/github_pullrequest_onebox.rb in onebox-1.3.9
- old
+ new
@@ -3,17 +3,10 @@
class GithubPullRequestOnebox
include Engine
include LayoutSupport
include JSON
- matches do
- http
- maybe("www.")
- domain("github")
- tld("com")
- anything
- with("/pull/")
- end
+ matches_regexp Regexp.new("^http(?:s)?://(?:www\\.)?(?:(?:\\w)+\\.)?(github)\\.com(?:/)?(?:.)*/pull/")
def url
"https://api.github.com/repos/#{match[:owner]}/#{match[:repository]}/pulls/#{match[:number]}"
end