Sha256: 424ddc46134ba81e9fc35ddc5138314fa8b75c77bb305053e9c6927b1ec69a17
Contents?: true
Size: 773 Bytes
Versions: 2
Compression:
Stored size: 773 Bytes
Contents
module Coconductor module ProjectFiles class CodeOfConductFile < Coconductor::ProjectFiles::ProjectFile include Licensee::ContentHelper EXTENSIONS = %w[md markdown txt].freeze EXT_REGEX = /\.#{Regexp.union(EXTENSIONS)}/i.freeze BASENAME_REGEX = /(citizen[_-])?code[_-]of[_-]conduct/i.freeze # LANG_REGEX must contain extension to avoid matching .md as the lang LANG_REGEX = /(\.(?<lang>[a-z]{2}(-[a-z]{2})?)#{EXT_REGEX})?/i.freeze FILENAME_REGEX = /#{BASENAME_REGEX}#{LANG_REGEX}#{EXT_REGEX}?/i.freeze def self.name_score(filename) filename =~ /\A#{FILENAME_REGEX}/ ? 1.0 : 0.0 end def possible_matchers [Matchers::Exact, Matchers::Dice, Matchers::FieldAware] end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
coconductor-0.9.4 | lib/coconductor/project_files/code_of_conduct_file.rb |
coconductor-0.9.3 | lib/coconductor/project_files/code_of_conduct_file.rb |