class Danger::FindRepoInfoFromURL
Constants
- REGEXP
- REGEXPBB
-
Regex used to extract info from Bitbucket server URLs, as they use a quite different format
Attributes
Public Class Methods
Source
# File lib/danger/ci_source/support/find_repo_info_from_url.rb, line 22 def initialize(url) @url = url end
Public Instance Methods
Source
# File lib/danger/ci_source/support/find_repo_info_from_url.rb, line 26 def call matched = url.match(REGEXPBB) if matched RepoInfo.new("#{matched[1]}/#{matched[2]}", matched[3]) else matched = url.match(REGEXP) if matched RepoInfo.new(matched[:slug], matched[:id]) end end end