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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ef3bec6a27472b5def730a62aede3fcff0cc84d194d74a4cd4a07db91921b299
4
- data.tar.gz: 8d000e63a1acbc6922da105b93ddc25dcb46390913bbea441514bd1452ecdbb7
3
+ metadata.gz: 50d320268d3b7d5ac7921efff0700d0c4fb666c9dd62724f65a829ccd02cd9dc
4
+ data.tar.gz: 9dca889cc62f25bc6e2d00590ac9ae13e8a62aee5b9f26d07f8aa36ba8951a52
5
5
  SHA512:
6
- metadata.gz: 1d4bceb34b58d3349bd4bf3038f8cc9aa10f1c4ca22f147af578fbd8658f36d057cf3b10fc40796bd7646833e08339f44841cb594245631bc1afbfdaa2511643
7
- data.tar.gz: 6beea3ed7a680eea8b36278dbff1f45371ebac5150d06b57637dbbab06bb3be289c1474a9d1900e264c359c5ab7a5112dedc8ff540239be0a20b51899e0a1756
6
+ metadata.gz: 5384eb318db31190116ea19bba99959c01f96fd1b1e6a23cd6b86d03dca0d2fe22fe44f98e573e31e0bb9d561be7e6a23ea15402d1542837dacd839e55e4b917
7
+ data.tar.gz: aa318789e835e411ce7f22a89bc3fae1f700b09aa1575fa5e17ffad24d3810355be54a63b4e34eab46127da1534519d7e45ea27e3adfdf638ef64d8eb6656340
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.11.5)
4
+ bolognese (0.11.6)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -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 Maremma.from_xml(string).to_h.dig("resource", "xmlns").to_s.start_with?("http://datacite.org/schema/kernel")
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"
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.11.5"
2
+ VERSION = "0.11.6"
3
3
  end
@@ -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")
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bolognese
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.5
4
+ version: 0.11.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner