6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
|
# File 'lib/bolognese/writers/codemeta_writer.rb', line 6
def codemeta
return nil unless valid?
hsh = {
"@context" => id.present? ? "https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld" : nil,
"@type" => type,
"@id" => identifier,
"identifier" => identifier,
"codeRepository" => b_url,
"title" => title,
"agents" => author,
"description" => parse_attributes(description, content: "text", first: true),
"version" => b_version,
"tags" => keywords.to_s.split(", ").presence,
"dateCreated" => date_created,
"datePublished" => date_published,
"dateModified" => date_modified,
"publisher" => publisher
}.compact
JSON.pretty_generate hsh.presence
end
|