class Bake::Modernize::License::SkipList
Represents revisions to skip when analyzing authorship.
def self.for(root)
def self.for(root) full_path = File.join(root, GIT_BLAME_IGNORE_REVS) if File.exist?(full_path) skip_list = self.new skip_list.extract(full_path) return skip_list end end
def extract(path)
def extract(path) File.open(path, "r") do |file| file.each_line do |line| # Skip empty lines and comments next if line =~ /^\s*(#|$)/ # Parse line @revisions << line.strip end end end
def ignore?(commit)
def ignore?(commit) @revisions.include?(commit.oid) end
def initialize(revisions = [])
Create a new skip list with the given revisions.
def initialize(revisions = []) @revisions = Set.new(revisions) end