Skip to content

Commit

Permalink
Merge branch 'master' into sizes-and-formats
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Fenner authored May 3, 2020
2 parents 34f8b14 + 4317168 commit 4d2754d
Show file tree
Hide file tree
Showing 6 changed files with 156 additions and 12 deletions.
2 changes: 1 addition & 1 deletion Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
PATH
remote: .
specs:
bolognese (1.5.20)
bolognese (1.5.20)
activesupport (>= 4.2.5)
benchmark_methods (~> 0.7)
bibtex-ruby (>= 5.1.0)
Expand Down
4 changes: 2 additions & 2 deletions lib/bolognese/metadata.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ def initialize(input: nil, from: nil, **options)
# generate name for method to call dynamically
hsh = @from.present? ? send("get_" + @from, id: id, sandbox: options[:sandbox]) : {}
string = hsh.fetch("string", nil)

elsif input.present? && File.exist?(input)
filename = File.basename(input)
ext = File.extname(input)
Expand Down Expand Up @@ -115,7 +116,6 @@ def initialize(input: nil, from: nil, **options)
).compact

@regenerate = options[:regenerate] || read_options.present?

# generate name for method to call dynamically
@meta = @from.present? ? send("read_" + @from, { string: string, sandbox: options[:sandbox], doi: options[:doi], id: id, ra: ra }.merge(read_options)) : {}
end
Expand Down Expand Up @@ -190,7 +190,7 @@ def url
end

def version_info
@version_info ||= meta.fetch("version_info", nil)
@version_info ||= meta.fetch("version_info", nil) || meta.fetch("version", nil)
end

def publication_year
Expand Down
74 changes: 74 additions & 0 deletions spec/fixtures/datacite_software_version.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
{
"id": "https://doi.org/10.5281/zenodo.2598836",
"doi": "10.5281/ZENODO.2598836",
"url": "https://zenodo.org/record/2598836",
"types": {
"ris": "COMP",
"bibtex": "misc",
"citeproc": "article",
"schemaOrg": "SoftwareSourceCode",
"resourceTypeGeneral": "Software"
},
"creators": [
{
"name": "Lab For Exosphere And Near Space Environment Studies",
"affiliation": []
}
],
"titles": [
{
"title": "lenses-lab/LYAO_RT-2018JA026426: Original Release"
}
],
"publisher": "Zenodo",
"container": {},
"contributors": [],
"dates": [
{
"date": "2019-03-20",
"dateType": "Issued"
}
],
"publicationYear": 2019,
"identifiers": [
{
"identifier": "https://doi.org/10.5281/zenodo.2598836",
"identifierType": "DOI"
},
{
"identifier": "https://zenodo.org/record/2598836",
"identifierType": "URL"
}
],
"version": "1.0.0",
"rightsList": [
{
"rights": "Open Access",
"rightsUri": "info:eu-repo/semantics/openAccess"
}
],
"descriptions": [
{
"description": "Original executables used by Gallant et al. for JGR publication 2018JA026426.",
"descriptionType": "Abstract"
}
],
"relatedIdentifiers": [
{
"relationType": "IsSupplementTo",
"relatedIdentifier": "https://github.com/lenses-lab/LYAO_RT-2018JA026426/tree/1.0.0",
"relatedIdentifierType": "URL"
},
{
"relationType": "IsVersionOf",
"relatedIdentifier": "10.5281/zenodo.2598835",
"relatedIdentifierType": "DOI"
}
],
"schemaVersion": "http://datacite.org/schema/kernel-4",
"providerId": "cern",
"clientId": "cern.zenodo",
"agency": "DataCite",
"state": "findable"
}

Loading

0 comments on commit 4d2754d

Please sign in to comment.