class PrLog::ParsedChangelog

Get mentioned issues from a changelog

Public Class Methods

new(text, options = {}) click to toggle source
# File lib/pr_log/parsed_changelog.rb, line 4
def initialize(text, options = {})
  @text = text
  @github_repository = options.fetch(:github_repository)
end

Public Instance Methods

mentioned_issue_numbers() click to toggle source
# File lib/pr_log/parsed_changelog.rb, line 9
def mentioned_issue_numbers
  @text.scan(pull_request_urls_matcher).flatten.map(&:to_i)
end

Private Instance Methods

pull_request_urls_matcher() click to toggle source
# File lib/pr_log/parsed_changelog.rb, line 15
def pull_request_urls_matcher
  %r{#{repository_url_matcher}/pull/(\d+)}
end
repository_url_matcher() click to toggle source
# File lib/pr_log/parsed_changelog.rb, line 19
def repository_url_matcher
  %r{https?://github.com/#{@github_repository}}
end