Sha256: 91ce53bde2acfc068553e6983c18a0e9a9c72b43d97478a8544fd86ff377202b

Contents?: true

Size: 786 Bytes

Versions: 1

Compression:

Stored size: 786 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 if files.nil? || files.empty?
        file = find_files do |filename|
          ProjectFiles::CodeOfConductFile.name_score(filename)
        end.first

        return unless file

        content = load_file(file)
        ProjectFiles::CodeOfConductFile.new(content, file)
      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

1 entries across 1 versions & 1 rubygems

Version Path
coconductor-0.2.0 lib/coconductor/projects/project.rb