Sha256: 63ae55dd3f4eda9f7289e7da711b1789432bc2ff28ac22dce62dc6f11e76d1fc
Contents?: true
Size: 656 Bytes
Versions: 172
Compression:
Stored size: 656 Bytes
Contents
require "danger/ci_source/support/repo_info" module Danger class FindRepoInfoFromLogs def initialize(github_host, remote_logs) @github_host = github_host @remote_logs = remote_logs end def call matched = remote.match(regexp) if matched RepoInfo.new(matched["repo_slug"], nil) end end private attr_reader :remote_logs, :github_host def remote remote_logs.lines.grep(/Fetch URL/)[0].split(": ".freeze, 2)[1] end def regexp %r{ #{Regexp.escape(github_host)} (:|/|(:/)) (?<repo_slug>[^/]+/.+?) (?:\.git)?$ }x end end end
Version data entries
172 entries across 172 versions & 2 rubygems