class Danger::FindRepoInfoFromLogs
Attributes
Public Class Methods
Source
# File lib/danger/ci_source/support/find_repo_info_from_logs.rb, line 5 def initialize(github_host, remote_logs) @github_host = github_host @remote_logs = remote_logs end
Public Instance Methods
Source
# File lib/danger/ci_source/support/find_repo_info_from_logs.rb, line 10 def call matched = remote.match(regexp) if matched RepoInfo.new(matched["repo_slug"], nil) end end
Private Instance Methods
Source
# File lib/danger/ci_source/support/find_repo_info_from_logs.rb, line 26 def regexp %r{ #{Regexp.escape(github_host)} (:|/|(:/)) (?<repo_slug>[^/]+/.+?) (?:\.git)?$ }x end
Source
# File lib/danger/ci_source/support/find_repo_info_from_logs.rb, line 22 def remote remote_logs.lines.grep(/Fetch URL/)[0].split(": ".freeze, 2)[1] end