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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 929243886c6cef57a3d73b0afc690c992552410c1e4d91ee3f2f8bdf9663e7e2
4
- data.tar.gz: 7aba3fea4c5d343a341509ddb7b17f4d662c6d5b5ffc125f81e59e231c0d0c08
3
+ metadata.gz: adf44b3cfdbbd01683775fe3e115efd6cd8335ceb1ff7bd75a75f54a5fa81aeb
4
+ data.tar.gz: 077471321846fd689783ab87ba4b8b50e69d2b564e2e35f523a639ba4f46ad6e
5
5
  SHA512:
6
- metadata.gz: fbf25d2aca9f3c9d8df6a229b9a87de94fd94b3c76fd19c20163666fbe1f88b98e4cfbd33d3cdb11d5725a68bbfe25ff0e16e9b978b226bfe82d4a72f3a36daa
7
- data.tar.gz: 75c36cc522a1d23ad22c459b99d54195b717ed2f9106771417a75219f49115b8208c3871d4f8d948e8ed4c153410ca6ca93068db450189b215e81c97e8b80e22
6
+ metadata.gz: 12307981cd3460daacdcc9d3d17bc02401fffaaed44896e3c52aede9470ade2897d3f79aaa75835e5a3604fd03e8b3e255eec76b90a6678213b56108b9ed9365
7
+ data.tar.gz: 3f4bb94cf8315f20ddca2fbc69565850841ebf7eff192b976d322551ec7b6f202693f9abb8b0436a3e124b836338d44a9729cfcc796732d127f7216808496cce
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- bolognese (0.9.77)
4
+ bolognese (0.9.78)
5
5
  activesupport (>= 4.2.5, < 6)
6
6
  benchmark_methods (~> 0.7)
7
7
  bibtex-ruby (~> 4.1)
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Bolognese
2
- VERSION = "0.9.77"
2
+ VERSION = "0.9.78"
3
3
  end
@@ -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,7 +5,7 @@ describe Bolognese::Metadata, vcr: true do
5
5
 
6
6
  subject { Bolognese::Metadata.new(input: input, from: "citeproc") }
7
7
 
8
- context "get bibtex raw" do
8
+ context "get citeproc raw" do
9
9
  it "BlogPosting" do
10
10
  expect(subject.raw).to eq(IO.read(input).strip)
11
11
  end
@@ -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)
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.9.77
4
+ version: 0.9.78
5
5
  platform: ruby
6
6
  authors:
7
7
  - Martin Fenner