def notice_contents
      Dir.glob(dir_path.join("*"))
         .grep(LEGAL_FILES_PATTERN)
         .select { |path| File.file?(path) }
         .sort # sorted by the path
         .map { |path| { "sources" => normalize_source_path(path), "text" => File.read(path).rstrip } }
         .select { |notice| notice["text"].length > 0 } # files with content only
    end
def notice_contents
      Dir.glob(dir_path.join("*"))
         .grep(LEGAL_FILES_PATTERN)
         .select { |path| File.file?(path) }
         .sort # sorted by the path
         .map { |path| { "sources" => normalize_source_path(path), "text" => File.read(path).rstrip } }
         .select { |notice| notice["text"].length > 0 } # files with content only
    end
Returns legal notices found at the dependency path