bolognese 0.11.5 → 0.11.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 +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/find_from_format_spec.rb +5 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 50d320268d3b7d5ac7921efff0700d0c4fb666c9dd62724f65a829ccd02cd9dc
|
4
|
+
data.tar.gz: 9dca889cc62f25bc6e2d00590ac9ae13e8a62aee5b9f26d07f8aa36ba8951a52
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5384eb318db31190116ea19bba99959c01f96fd1b1e6a23cd6b86d03dca0d2fe22fe44f98e573e31e0bb9d561be7e6a23ea15402d1542837dacd839e55e4b917
|
7
|
+
data.tar.gz: aa318789e835e411ce7f22a89bc3fae1f700b09aa1575fa5e17ffad24d3810355be54a63b4e34eab46127da1534519d7e45ea27e3adfdf638ef64d8eb6656340
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
@@ -372,7 +372,7 @@ module Bolognese
|
|
372
372
|
def find_from_format_by_string(string)
|
373
373
|
if Maremma.from_xml(string).to_h.dig("doi_records", "doi_record", "crossref").present?
|
374
374
|
"crossref"
|
375
|
-
elsif
|
375
|
+
elsif Nokogiri::XML(string, nil, 'UTF-8', &:noblanks).collect_namespaces.find { |k, v| v.start_with?("http://datacite.org/schema/kernel") }
|
376
376
|
"datacite"
|
377
377
|
elsif Maremma.from_json(string).to_h.dig("ris_type").present?
|
378
378
|
"crosscite"
|
data/lib/bolognese/version.rb
CHANGED
@@ -45,6 +45,11 @@ describe Bolognese::CLI do
|
|
45
45
|
expect(subject.find_from_format_by_string(string)).to eq("datacite")
|
46
46
|
end
|
47
47
|
|
48
|
+
it "datacite namespaced" do
|
49
|
+
string = IO.read(fixture_path + 'ns0.xml').strip
|
50
|
+
expect(subject.find_from_format_by_string(string)).to eq("datacite")
|
51
|
+
end
|
52
|
+
|
48
53
|
it "codemeta" do
|
49
54
|
string = IO.read(fixture_path + 'codemeta.json').strip
|
50
55
|
expect(subject.find_from_format_by_string(string)).to eq("codemeta")
|