bolognese 0.9.77 → 0.9.78
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/bolognese/utils.rb +4 -0
- data/lib/bolognese/version.rb +1 -1
- data/spec/readers/bibtex_reader_spec.rb +12 -0
- data/spec/readers/citeproc_reader_spec.rb +1 -1
- data/spec/readers/ris_reader_spec.rb +12 -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: adf44b3cfdbbd01683775fe3e115efd6cd8335ceb1ff7bd75a75f54a5fa81aeb
|
4
|
+
data.tar.gz: 077471321846fd689783ab87ba4b8b50e69d2b564e2e35f523a639ba4f46ad6e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 12307981cd3460daacdcc9d3d17bc02401fffaaed44896e3c52aede9470ade2897d3f79aaa75835e5a3604fd03e8b3e255eec76b90a6678213b56108b9ed9365
|
7
|
+
data.tar.gz: 3f4bb94cf8315f20ddca2fbc69565850841ebf7eff192b976d322551ec7b6f202693f9abb8b0436a3e124b836338d44a9729cfcc796732d127f7216808496cce
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/utils.rb
CHANGED
@@ -311,6 +311,10 @@ module Bolognese
|
|
311
311
|
"schema_org"
|
312
312
|
elsif Maremma.from_json(string).to_h.dig("@context") == ("https://raw.githubusercontent.com/codemeta/codemeta/master/codemeta.jsonld")
|
313
313
|
"codemeta"
|
314
|
+
elsif string.start_with?("TY - ")
|
315
|
+
"ris"
|
316
|
+
elsif BibTeX.parse(string).first
|
317
|
+
"bibtex"
|
314
318
|
end
|
315
319
|
end
|
316
320
|
|
data/lib/bolognese/version.rb
CHANGED
@@ -5,6 +5,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
5
5
|
|
6
6
|
subject { Bolognese::Metadata.new(input: input) }
|
7
7
|
|
8
|
+
context "detect format" do
|
9
|
+
it "extension" do
|
10
|
+
expect(subject.valid?).to be true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "string" do
|
14
|
+
Bolognese::Metadata.new(input: IO.read(input).strip)
|
15
|
+
expect(subject.valid?).to be true
|
16
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
8
20
|
context "get bibtex raw" do
|
9
21
|
it "Crossref DOI" do
|
10
22
|
expect(subject.raw).to eq(IO.read(input).strip)
|
@@ -5,6 +5,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
5
5
|
|
6
6
|
subject { Bolognese::Metadata.new(input: input) }
|
7
7
|
|
8
|
+
context "detect format" do
|
9
|
+
it "extension" do
|
10
|
+
expect(subject.valid?).to be true
|
11
|
+
end
|
12
|
+
|
13
|
+
it "string" do
|
14
|
+
Bolognese::Metadata.new(input: IO.read(input).strip)
|
15
|
+
expect(subject.valid?).to be true
|
16
|
+
expect(subject.id).to eq("https://doi.org/10.7554/elife.01567")
|
17
|
+
end
|
18
|
+
end
|
19
|
+
|
8
20
|
context "get ris raw" do
|
9
21
|
it "Crossref DOI" do
|
10
22
|
expect(subject.raw).to eq(IO.read(input).strip)
|