Sha256: 0726ba6ae00c600bcc8077ecb95512e50618256fcfa59cd2ffd9c5c3865ea4f9
Contents?: true
Size: 916 Bytes
Versions: 23
Compression:
Stored size: 916 Bytes
Contents
module Coconductor module Projects module Project DIRS = ['./', './docs/', './.github/'].freeze def code_of_conduct code_of_conduct_file.code_of_conduct if code_of_conduct_file end def code_of_conduct_file return @code_of_conduct_file if defined? @code_of_conduct_file return if files.nil? || files.empty? file = find_files do |filename| ProjectFiles::CodeOfConductFile.name_score(filename) end.first return unless file content = load_file(file) @code_of_conduct_file = begin ProjectFiles::CodeOfConductFile.new(content, file) end end private def path_relative_to_root(path) return path if is_a?(GitProject) || path.nil? root = Pathname.new(@dir) path = Pathname.new(path) path.relative_path_from(root).to_s end end end end
Version data entries
23 entries across 23 versions & 1 rubygems