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