class Hookers::Changelog::Matchers::Matcher
Constants
- SUBPATTERN
Attributes
commit[RW]
number[RW]
type[RW]
Public Class Methods
blocks_of(commit, regexp, subpattern = nil)
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 36 def self.blocks_of(commit, regexp, subpattern = nil) results = [] commit.message.scan(/(\[(?:#{regexp}\s*)+\])/i).each do |e| if subpattern results += e[2].scan(subpattern).map { |sub| [e[1], sub[0]] } else results << e.slice(1..2) end end results end
new(commit, type, number)
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 18 def initialize(commit, type, number) self.commit = commit self.type = type self.number = number end
scan(commit)
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 10 def self.scan(commit) [] end
Public Instance Methods
identifier()
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 14 def identifier "#{type} ##{number}" end
to_affected()
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 32 def to_affected Hookers::Changelog::Affects.new(commit, type, number, uri, identifier) end
uri()
click to toggle source
# File lib/hookers/changelog/matchers.rb, line 24 def uri nil end