codeowners-checker
codeowners-checker copied to clipboard
Refactor `Line`
Rationale
Right now descendant's of Line use parse in initialize (mostly Pattern) and the initialize method always takes a raw line as param. Because of this we can not initialize the Pattern with pattern, *owners and always need to parse.
Possible solution
Move the parse to be class method so in Line.build would call return klass.parse(line) if klass.match?(line) and for patterns Pattern.parse would call Pattern.new(pattern, *owners) and now Pattern.new becomes available for building pattern lines.