bolognese 0.10.2 → 0.10.3
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/metadata.rb +1 -1
- data/lib/bolognese/metadata_utils.rb +1 -1
- data/lib/bolognese/version.rb +1 -1
- data/spec/writers/datacite_writer_spec.rb +21 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc0b25824fcc0ef740e3a84cee8d5a811481135b183f442f41b7706f29e25623
|
4
|
+
data.tar.gz: 7acdaf20087b71eaa8d49cc9649e3b701066a22c7c250801d55fcfb979d76d3a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d2c0634ea207320e387174a52ea368a066263a06c1e48a838489477d6ae58b87c308c19f864c4768c036bcce606ee017b0ca8ba97a8c1d224bda861bdf82b740
|
7
|
+
data.tar.gz: 6082d4c5f232e1650a0a3b885624aad4476a0ae6033f710f96a4c0e64c03aee010089ab8752a2d99fd309f201eb56a3876a666903a6aa2e7e7c85210b8f38b00
|
data/Gemfile.lock
CHANGED
data/lib/bolognese/metadata.rb
CHANGED
@@ -15,7 +15,7 @@ module Bolognese
|
|
15
15
|
# generate name for method to call dynamically
|
16
16
|
hsh = @from.present? ? send("get_" + @from, id: id, sandbox: options[:sandbox]) : {}
|
17
17
|
string = hsh.fetch("string", nil)
|
18
|
-
elsif File.exist?(input)
|
18
|
+
elsif input.present? && File.exist?(input)
|
19
19
|
ext = File.extname(input)
|
20
20
|
if %w(.bib .ris .xml .json).include?(ext)
|
21
21
|
string = IO.read(input)
|
data/lib/bolognese/version.rb
CHANGED
@@ -175,7 +175,18 @@ describe Bolognese::Metadata, vcr: true do
|
|
175
175
|
expect(subject.doi).to eq("10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
|
176
176
|
expect(subject.service_provider).to eq("DataCite")
|
177
177
|
expect(subject.state).to eq("not_found")
|
178
|
-
|
178
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
179
|
+
expect(datacite["identifier"]).to eq("identifierType"=>"DOI", "__content__"=>"10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
|
180
|
+
expect(datacite["xmlns"]).to eq("http://datacite.org/schema/kernel-4")
|
181
|
+
end
|
182
|
+
|
183
|
+
it "no input" do
|
184
|
+
input = nil
|
185
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", doi: "10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
|
186
|
+
expect(subject.valid?).to be false
|
187
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
188
|
+
expect(datacite["identifier"]).to eq("identifierType"=>"DOI", "__content__"=>"10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
|
189
|
+
expect(datacite["xmlns"]).to eq("http://datacite.org/schema/kernel-4")
|
179
190
|
end
|
180
191
|
end
|
181
192
|
|
@@ -208,6 +219,15 @@ describe Bolognese::Metadata, vcr: true do
|
|
208
219
|
expect(datacite.dig("descriptions", "description")).to eq("descriptionType"=>"Abstract", "__content__"=>"This is an abstract.")
|
209
220
|
end
|
210
221
|
|
222
|
+
it "change description no input" do
|
223
|
+
input = nil
|
224
|
+
subject = Bolognese::Metadata.new(input: input, from: "datacite", doi: "10.4124/05f6c379-dd68-4cdb-880d-33d3e9576d52/1")
|
225
|
+
subject.description = "This is an abstract."
|
226
|
+
expect(subject.valid?).to be false
|
227
|
+
datacite = Maremma.from_xml(subject.datacite).fetch("resource", {})
|
228
|
+
expect(datacite.dig("descriptions", "description")).to eq("descriptionType"=>"Abstract", "__content__"=>"This is an abstract.")
|
229
|
+
end
|
230
|
+
|
211
231
|
it "change license" do
|
212
232
|
input = "10.7554/eLife.01567"
|
213
233
|
subject = Bolognese::Metadata.new(input: input, from: "crossref")
|
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: 0.10.
|
4
|
+
version: 0.10.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Martin Fenner
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-05-
|
11
|
+
date: 2018-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: maremma
|