Method: Coconductor::Projects::Project#code_of_conduct_file

Defined in:
lib/coconductor/projects/project.rb

#code_of_conduct_fileObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/coconductor/projects/project.rb', line 12

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