Sha256: 8da187ecc582cb4640a0f8d4372a060abd7119ec4dd9592d3bb6b85d693d49a3
Contents?: true
Size: 455 Bytes
Versions: 12
Compression:
Stored size: 455 Bytes
Contents
require "danger/ci_source/support/repo_info" module Danger class FindRepoInfoFromURL REGEXP = %r{ ://[^/]+/ (?<slug>[^/]+(/[^/]+){1,2}) (/(pull|merge_requests|pull-requests)/) (?<id>\d+) }x def initialize(url) @url = url end def call matched = url.match(REGEXP) if matched RepoInfo.new(matched[:slug], matched[:id]) end end private attr_reader :url end end
Version data entries
12 entries across 12 versions & 1 rubygems