bolognese 1.6.5 → 1.6.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 4a576209bfe96feeeb1e6495da845b4e6526eb2b45304ca136abda3e71f21540
4
- data.tar.gz: 10efc05b05f546cabdec118f38c39027ba4a0fb6c52cc03f28f75b3d5127243b
3
+ metadata.gz: 405a39bf0274cc91c5356f94b050f5e0bad7598d47601a3fac9a99aed3900eff
4
+ data.tar.gz: e32e05bbf8fdd50af362081e7dee9de0c6e64b21c12d4fadd676909808423955
5
5
  SHA512:
6
- metadata.gz: 7e0d9bc3bd09820071226ced2a898eca038282873a67b2b2be22024cc6abf205d428a57e2a01f119dc27aa8a21bee30654c0dd1cc36eab5872de78b482c5b405
7
- data.tar.gz: 0333ac4f5981ddaa39904a4729c8553f0d67add5a10395b2f32f0d64b39ad58feed240e2ce6009841dc64f514879a31a7a00a64712f3f5bfbfaf161cfde37120
6
+ metadata.gz: 1fc29ec5b40985218e1305d7e70eac714f8250d9f6c3b308b194785c6d3c8426facaf2b11c9332a5a1deb72fa6eb3084b60aaf58527fcb638b081ce08d55c322
7
+ data.tar.gz: 6a82235d1c16f6bf987c9a9ebd61337100ae7b8bc4c64d343d0de4f0037d399081f71a8bee68754937d482d0c5d7bf4f91f06a0afe55178818fe0a85e404c4f1
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (1.6.5)
4
+ bolognese (1.6.6)
5
5
  activesupport (>= 4.2.5)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (>= 5.1.0)
@@ -56,7 +56,7 @@ GEM
56
56
  namae (~> 1.0)
57
57
  csl-styles (1.0.1.10)
58
58
  csl (~> 1.0)
59
- diff-lcs (1.3)
59
+ diff-lcs (1.4.1)
60
60
  docile (1.3.2)
61
61
  ebnf (1.2.0)
62
62
  rdf (~> 3.1)
@@ -140,8 +140,14 @@ module Bolognese
140
140
  author = to_citeproc(creators)
141
141
  end
142
142
 
143
+ if types["resourceTypeGeneral"] == "Software" && version_info.present?
144
+ type = "book"
145
+ else
146
+ type = types["citeproc"]
147
+ end
148
+
143
149
  {
144
- "type" => types["citeproc"],
150
+ "type" => type,
145
151
  "id" => normalize_doi(doi),
146
152
  "categories" => Array.wrap(subjects).map { |k| parse_attributes(k, content: "subject", first: true) }.presence,
147
153
  "language" => language,
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "1.6.5"
2
+ VERSION = "1.6.6"
3
3
  end
@@ -0,0 +1,52 @@
1
+ ---
2
+ http_interactions:
3
+ - request:
4
+ method: get
5
+ uri: https://api.datacite.org/dois/10.5281/zenodo.2598836
6
+ body:
7
+ encoding: US-ASCII
8
+ string: ''
9
+ headers:
10
+ User-Agent:
11
+ - Mozilla/5.0 (compatible; Maremma/4.8; mailto:info@datacite.org)
12
+ Accept:
13
+ - text/html,application/json,application/xml;q=0.9, text/plain;q=0.8,image/png,*/*;q=0.5
14
+ response:
15
+ status:
16
+ code: 200
17
+ message: OK
18
+ headers:
19
+ Date:
20
+ - Tue, 23 Jun 2020 20:15:32 GMT
21
+ Content-Type:
22
+ - application/json; charset=utf-8
23
+ Connection:
24
+ - keep-alive
25
+ Status:
26
+ - 200 OK
27
+ X-Anonymous-Consumer:
28
+ - 'true'
29
+ Cache-Control:
30
+ - max-age=0, private, must-revalidate
31
+ Vary:
32
+ - Accept-Encoding, Origin
33
+ X-Request-Id:
34
+ - c3c8d01b-f2f5-47b3-94be-708f587f12ad
35
+ Etag:
36
+ - W/"eef90050e859855e481905772350de2a"
37
+ X-Runtime:
38
+ - '0.254035'
39
+ X-Powered-By:
40
+ - Phusion Passenger 6.0.5
41
+ Server:
42
+ - nginx/1.14.0 + Phusion Passenger 6.0.5
43
+ body:
44
+ encoding: ASCII-8BIT
45
+ string: '{"data":{"id":"10.5281/zenodo.2598836","type":"dois","attributes":{"doi":"10.5281/zenodo.2598836","prefix":"10.5281","suffix":"zenodo.2598836","identifiers":[{"identifier":"https://doi.org/10.5281/zenodo.2598836","identifierType":"DOI"},{"identifier":"https://zenodo.org/record/2598836","identifierType":"URL"}],"alternateIdentifiers":[{"alternateIdentifierType":"URL","alternateIdentifier":"https://zenodo.org/record/2598836"}],"creators":[{"name":"Lab
46
+ For Exosphere And Near Space Environment Studies","affiliation":[]}],"titles":[{"title":"lenses-lab/LYAO_RT-2018JA026426:
47
+ Original Release"}],"publisher":"Zenodo","container":{},"publicationYear":2019,"subjects":[],"contributors":[],"dates":[{"date":"2019-03-20","dateType":"Issued"}],"language":null,"types":{"ris":"COMP","bibtex":"misc","citeproc":"article","schemaOrg":"SoftwareSourceCode","resourceTypeGeneral":"Software"},"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"}],"sizes":[],"formats":[],"version":"1.0.0","rightsList":[{"rights":"Open
48
+ Access","rightsUri":"info:eu-repo/semantics/openAccess"}],"descriptions":[{"description":"Original
49
+ executables used by Gallant et al. for JGR publication 2018JA026426.","descriptionType":"Abstract"}],"geoLocations":[],"fundingReferences":[],"xml":"PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPHJlc291cmNlIHhtbG5zOnhzaT0iaHR0cDovL3d3dy53My5vcmcvMjAwMS9YTUxTY2hlbWEtaW5zdGFuY2UiIHhtbG5zPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCIgeHNpOnNjaGVtYUxvY2F0aW9uPSJodHRwOi8vZGF0YWNpdGUub3JnL3NjaGVtYS9rZXJuZWwtNCBodHRwOi8vc2NoZW1hLmRhdGFjaXRlLm9yZy9tZXRhL2tlcm5l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L2dpdGh1Yi5jb20vbGVuc2VzLWxhYi9MWUFPX1JULTIwMThKQTAyNjQyNi90cmVlLzEuMC4wPC9yZWxhdGVkSWRlbnRpZmllcj4KICAgIDxyZWxhdGVkSWRlbnRpZmllciByZWxhdGVkSWRlbnRpZmllclR5cGU9IkRPSSIgcmVsYXRpb25UeXBlPSJJc1ZlcnNpb25PZiI+MTAuNTI4MS96ZW5vZG8uMjU5ODgzNTwvcmVsYXRlZElkZW50aWZpZXI+CiAgPC9yZWxhdGVkSWRlbnRpZmllcnM+CiAgPHZlcnNpb24+MS4wLjA8L3ZlcnNpb24+CiAgPHJpZ2h0c0xpc3Q+CiAgICA8cmlnaHRzIHJpZ2h0c1VSST0iaW5mbzpldS1yZXBvL3NlbWFudGljcy9vcGVuQWNjZXNzIj5PcGVuIEFjY2VzczwvcmlnaHRzPgogIDwvcmlnaHRzTGlzdD4KICA8ZGVzY3JpcHRpb25zPgogICAgPGRlc2NyaXB0aW9uIGRlc2NyaXB0aW9uVHlwZT0iQWJzdHJhY3QiPiZsdDtwJmd0O09yaWdpbmFsIGV4ZWN1dGFibGVzIHVzZWQgYnkgR2FsbGFudCBldCBhbC4gZm9yIEpHUiBwdWJsaWNhdGlvbiAyMDE4SkEwMjY0MjYuJmx0Oy9wJmd0OzwvZGVzY3JpcHRpb24+CiAgPC9kZXNjcmlwdGlvbnM+CjwvcmVzb3VyY2U+","url":"https://zenodo.org/record/2598836","contentUrl":null,"metadataVersion":0,"schemaVersion":"http://datacite.org/schema/kernel-4","source":"mds","isActive":true,"state":"findable","reason":null,"viewCount":0,"viewsOverTime":[],"downloadCount":0,"downloadsOverTime":[],"referenceCount":0,"citationCount":0,"citationsOverTime":[],"partCount":0,"partOfCount":0,"versionCount":0,"versionOfCount":0,"created":"2019-03-20T02:32:02.000Z","registered":"2019-03-20T02:32:02.000Z","published":"2019","updated":"2019-08-02T22:04:29.000Z"},"relationships":{"client":{"data":{"id":"cern.zenodo","type":"clients"}},"media":{"data":{"id":"10.5281/zenodo.2598836","type":"media"}},"references":{"data":[]},"citations":{"data":[]},"parts":{"data":[]},"partOf":{"data":[]},"versions":{"data":[]},"versionOf":{"data":[]}}}}'
50
+ http_version:
51
+ recorded_at: Tue, 23 Jun 2020 20:15:32 GMT
52
+ recorded_with: VCR 3.0.3
@@ -32,5 +32,13 @@ describe Bolognese::Metadata, vcr: true do
32
32
  subject = Bolognese::Metadata.new(input: input, from: "crossref")
33
33
  expect(subject.citation).to eq("Alexander Kohls, &amp; Salvatore Mele. (2018). Converting the Literature of a Scientific Field to Open Access through Global Collaboration: The Experience of SCOAP3 in Particle Physics. <i>Publications</i>, <i>6</i>(2), 15. https://doi.org/10.3390/publications6020015")
34
34
  end
35
+
36
+ it "software w/version" do
37
+ input = "https://doi.org/10.5281/zenodo.2598836"
38
+ subject = Bolognese::Metadata.new(input: input, from: "datacite")
39
+ expect(subject.style).to eq("apa")
40
+ expect(subject.locale).to eq("en-US")
41
+ expect(subject.citation).to eq("Lab For Exosphere And Near Space Environment Studies. (2019). <i>lenses-lab/LYAO_RT-2018JA026426: Original Release</i> (Version 1.0.0) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.2598836")
42
+ end
35
43
  end
36
44
  end
@@ -101,7 +101,7 @@ describe Bolognese::Metadata, vcr: true do
101
101
  input = "https://doi.org/10.5281/zenodo.2598836"
102
102
  subject = Bolognese::Metadata.new(input: input, from: "datacite")
103
103
  json = JSON.parse(subject.citeproc)
104
- expect(json["type"]).to eq("article")
104
+ expect(json["type"]).to eq("book")
105
105
  expect(json["DOI"]).to eq("10.5281/zenodo.2598836")
106
106
  expect(json["version"]).to eq("1.0.0")
107
107
  expect(json["copyright"]).to eq("Open Access")
@@ -111,7 +111,7 @@ describe Bolognese::Metadata, vcr: true do
111
111
  input = fixture_path + "datacite_software_version.json"
112
112
  subject = Bolognese::Metadata.new(input: input, from: "datacite_json")
113
113
  json = JSON.parse(subject.citeproc)
114
- expect(json["type"]).to eq("article")
114
+ expect(json["type"]).to eq("book")
115
115
  expect(json["DOI"]).to eq("10.5281/ZENODO.2598836")
116
116
  expect(json["version"]).to eq("1.0.0")
117
117
  expect(json["copyright"]).to eq("Open Access")
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.5
4
+ version: 1.6.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-06-19 00:00:00.000000000 Z
11
+ date: 2020-06-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: maremma
@@ -1135,6 +1135,7 @@ files:
1135
1135
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Dataset.yml
1136
1136
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Journal_article.yml
1137
1137
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/Missing_author.yml
1138
+ - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citation/software_w/version.yml
1138
1139
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting.yml
1139
1140
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/BlogPosting_schema_org.yml
1140
1141
  - spec/fixtures/vcr_cassettes/Bolognese_Metadata/write_metadata_as_citeproc/Dataset.yml