datacite_doi_ify 1.0.0 → 1.1.0

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
  SHA1:
3
- metadata.gz: dd01ed9332d1f62fe3ae36fad4cbec2aa5ad514c
4
- data.tar.gz: 426f292c8bbe2598497f70e81b800576741ce38b
3
+ metadata.gz: cc392ae430588c70d946f43d17a4d5865aff8f76
4
+ data.tar.gz: 9539b6e43f69fef2973225ac13d010319704878c
5
5
  SHA512:
6
- metadata.gz: 71c4d58d0ae9397935532294d9eadaae4e56bedf37c742682b1afefa58770b4e9f9228cf490e0304a2cdd2ae6ccb811e7549eb5d5aa9515b8408605b8f19f262
7
- data.tar.gz: c05c155f2a1ad4ee5b8730df478e1422d10d4d0781317a7e0dbcaa1407e4a15b93268ab587ebeac66f05f97fdd3d508d22b59d5a3c7054fb0fa3f35e49b2011e
6
+ metadata.gz: 7ce3ee5b5f4290f4457a6a6fff73a80f6c45ba7f6fbc474c82f2a7f3a1e58fa1621c34891c1844b281f1288cd89a2c3ca5965de7260924bd92b272f3e7d2f2b5
7
+ data.tar.gz: bb4cb4e580146f4cf19adfc7d2fc973800e5dc357757f86254269156a70c7dbb52c00361b4fd6113cfa2f7e794eecb93f76f8b695f8609206849328eae978e84
@@ -0,0 +1,5 @@
1
+ Metrics/LineLength:
2
+ Max: 119
3
+
4
+ Documentation:
5
+ Enabled: false
@@ -1 +1 @@
1
- ruby-2.1.5
1
+ ruby-2.1.6
data/Gemfile CHANGED
@@ -1,4 +1,4 @@
1
- source "http://rubygems.org"
1
+ source 'http://rubygems.org'
2
2
 
3
3
  # Specify your gem's dependencies in datacite_doi_ify.gemspec
4
4
  gemspec
data/Guardfile CHANGED
@@ -8,4 +8,4 @@ guard 'rspec' do
8
8
  watch(%r{^spec/(.+).rb$}) do |m|
9
9
  "spec/#{m[1]}.rb"
10
10
  end
11
- end
11
+ end
data/LICENSE CHANGED
@@ -1,7 +1,6 @@
1
1
  Copyright (c) 2014, University of Manchester and HITS gGmbH
2
2
  All rights reserved.
3
3
 
4
-
5
4
  Redistribution and use in source and binary forms, with or without modification,
6
5
  are permitted provided that the following conditions are met:
7
6
 
data/Rakefile CHANGED
@@ -4,7 +4,7 @@ require 'bundler/gem_tasks'
4
4
  # Default directory to look in is `/specs`
5
5
  # Run with `rake spec`
6
6
  RSpec::Core::RakeTask.new(:spec) do |task|
7
- task.rspec_opts = ['--color', '--format', 'nested']
7
+ task.rspec_opts = ['--color']
8
8
  end
9
9
 
10
- task :default => :spec
10
+ task default: :spec
@@ -1,35 +1,40 @@
1
1
  # -*- encoding: utf-8 -*-
2
- $:.push File.expand_path("../lib", __FILE__)
3
- require "datacite_doi_ify/version"
2
+ $LOAD_PATH.push File.expand_path('../lib', __FILE__)
3
+ require 'datacite_doi_ify/version'
4
4
 
5
5
  Gem::Specification.new do |s|
6
- s.name = "datacite_doi_ify"
6
+ s.name = 'datacite_doi_ify'
7
7
  s.version = DataciteDoiIfy::VERSION
8
- s.authors = ["quyen nguyen"]
9
- s.email = ["thucquyendn@gmail.com"]
10
- s.homepage = "https://seek.sysmo-db.org/people/372"
11
- s.summary = "A ruby gem for working with the DataCite doi restful web service"
12
- s.description = "Mint a DOI and resolve a DOI using the Datacite restful web service"
8
+ s.authors = ['Quyen Nguyen', 'Finn Bacall']
9
+ s.email = ['thucquyendn@gmail.com', 'finn.bacall@manchester.ac.uk']
10
+ s.homepage = 'https://github.com/FAIRdom/datacite_doi_ify'
11
+ s.summary = 'A ruby gem for working with the DataCite doi restful ' \
12
+ 'web service'
13
+ s.description = 'Mint a DOI and resolve a DOI using the Datacite restful ' \
14
+ 'web service'
15
+ s.license = 'BSD'
13
16
 
14
- s.rubyforge_project = "datacite_doi_ify"
17
+ s.rubyforge_project = 'datacite_doi_ify'
15
18
 
16
19
  s.files = `git ls-files`.split("\n")
17
20
  s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
18
- s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
19
- s.require_paths = ["lib"]
21
+ s.executables = `git ls-files -- bin/*`.split("\n").map do |f|
22
+ File.basename(f)
23
+ end
24
+ s.require_paths = ['lib']
20
25
 
21
26
  # specify any dependencies here; for example:
22
27
  # s.add_development_dependency "rspec"
23
- s.add_runtime_dependency "rest-client", "~> 1.7"
24
-
25
- s.add_development_dependency "rspec", "~> 3.1"
26
- s.add_development_dependency "rspec-nc", "~> 0.2"
27
- s.add_development_dependency "guard", "~> 2.8"
28
- s.add_development_dependency "guard-rspec", "~> 4.3"
29
- s.add_development_dependency "pry", "~> 0.10"
30
- s.add_development_dependency "pry-remote", "~> 0.1"
31
- s.add_development_dependency "pry-nav", "~> 0.2"
32
- s.add_development_dependency "coveralls", "~> 0.7"
33
- s.add_development_dependency "webmock", "~> 1.20"
34
- s.add_development_dependency "vcr", "~> 2.9"
28
+ s.add_runtime_dependency 'rest-client', '~> 1.7'
29
+
30
+ s.add_development_dependency 'rspec', '~> 3.1'
31
+ s.add_development_dependency 'rspec-nc', '~> 0.2'
32
+ s.add_development_dependency 'guard', '~> 2.8'
33
+ s.add_development_dependency 'guard-rspec', '~> 4.3'
34
+ s.add_development_dependency 'pry', '~> 0.10'
35
+ s.add_development_dependency 'pry-remote', '~> 0.1'
36
+ s.add_development_dependency 'pry-nav', '~> 0.2'
37
+ s.add_development_dependency 'coveralls', '~> 0.7'
38
+ s.add_development_dependency 'webmock', '~> 1.20'
39
+ s.add_development_dependency 'vcr', '~> 2.9'
35
40
  end
@@ -1,2 +1,2 @@
1
- require "datacite_doi_ify/version"
2
- require "datacite_doi_ify/datacite"
1
+ require 'datacite_doi_ify/version'
2
+ require 'datacite_doi_ify/datacite'
@@ -2,41 +2,26 @@ require 'rest-client'
2
2
 
3
3
  class Datacite
4
4
  ENDPOINT = 'https://mds.datacite.org'
5
+ TEST_ENDPOINT = 'https://test.datacite.org/mds'
5
6
 
6
- def initialize(user_name, password, endpoint=nil)
7
+ def initialize(user_name, password, endpoint = nil)
7
8
  endpoint ||= ENDPOINT
8
9
  @endpoint = RestClient::Resource.new(endpoint, user_name, password)
9
10
  end
10
11
 
11
- def resolve doi
12
- begin
13
- response = @endpoint["doi/#{doi}"].get
14
- rescue Exception => e
15
- e.message
16
- end
12
+ def resolve(doi)
13
+ @endpoint["doi/#{doi}"].get
17
14
  end
18
15
 
19
- def mint doi, url
20
- begin
21
- response = @endpoint['doi'].post "doi=#{doi}\nurl=#{url}", content_type: "text/plain;charset=UTF-8"
22
- rescue Exception => e
23
- e.message
24
- end
16
+ def mint(doi, url)
17
+ @endpoint['doi'].post("doi=#{doi}\nurl=#{url}", content_type: 'text/plain;charset=UTF-8')
25
18
  end
26
19
 
27
- def upload_metadata metadata
28
- begin
29
- response = @endpoint['metadata'].post(metadata,content_type: 'application/xml;charset=UTF-8')
30
- rescue Exception => e
31
- e.message
32
- end
20
+ def upload_metadata(metadata)
21
+ @endpoint['metadata'].post(metadata, content_type: 'application/xml;charset=UTF-8')
33
22
  end
34
23
 
35
- def metadata doi
36
- begin
37
- response = @endpoint["metadata/#{doi}"].get
38
- rescue Exception => e
39
- e.message
40
- end
24
+ def metadata(doi)
25
+ @endpoint["metadata/#{doi}"].get
41
26
  end
42
27
  end
@@ -1,3 +1,3 @@
1
1
  module DataciteDoiIfy
2
- VERSION = "1.0.0"
2
+ VERSION = '1.1.0'
3
3
  end
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://test:test@mds.datacite.org/doi
5
+ uri: https://test:test@test.datacite.org/mds/doi
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |-
@@ -34,7 +34,7 @@ http_interactions:
34
34
  - no-cache
35
35
  - no-store
36
36
  Location:
37
- - https://mds.datacite.org/doi/10.5072/MY_TEST
37
+ - https://test.datacite.org/mds/doi/10.5072/MY_TEST
38
38
  Content-Type:
39
39
  - application/xml;charset=UTF-8
40
40
  Content-Length:
@@ -46,7 +46,7 @@ http_interactions:
46
46
  recorded_at: Tue, 04 Nov 2014 13:58:39 GMT
47
47
  - request:
48
48
  method: get
49
- uri: https://test:test@mds.datacite.org/doi/10.5072/MY_TEST
49
+ uri: https://test:test@test.datacite.org/mds/doi/10.5072/MY_TEST
50
50
  body:
51
51
  encoding: US-ASCII
52
52
  string: ''
@@ -82,7 +82,7 @@ http_interactions:
82
82
  recorded_at: Tue, 04 Nov 2014 13:33:26 GMT
83
83
  - request:
84
84
  method: post
85
- uri: https://test:test@mds.datacite.org/metadata
85
+ uri: https://test:test@test.datacite.org/mds/metadata
86
86
  body:
87
87
  encoding: UTF-8
88
88
  string: |
@@ -138,7 +138,7 @@ http_interactions:
138
138
  - no-cache
139
139
  - no-store
140
140
  Location:
141
- - https://mds.datacite.org/metadata/10.5072/my_test
141
+ - https://test.datacite.org/mds/metadata/10.5072/my_test
142
142
  Content-Type:
143
143
  - application/xml;charset=UTF-8
144
144
  Content-Length:
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://test:test@mds.datacite.org/doi
5
+ uri: https://test:test@test.datacite.org/mds/doi
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |-
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://test:test@mds.datacite.org/metadata
5
+ uri: https://test:test@test.datacite.org/mds/metadata
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |
@@ -61,7 +61,7 @@ http_interactions:
61
61
  - no-cache
62
62
  - no-store
63
63
  Location:
64
- - https://mds.datacite.org/metadata/10.5072/test_doi
64
+ - https://test.datacite.org/mds/metadata/10.5072/test_doi
65
65
  Content-Type:
66
66
  - application/xml;charset=UTF-8
67
67
  Content-Length:
@@ -73,7 +73,7 @@ http_interactions:
73
73
  recorded_at: Tue, 04 Nov 2014 15:06:57 GMT
74
74
  - request:
75
75
  method: post
76
- uri: https://test:test@mds.datacite.org/doi
76
+ uri: https://test:test@test.datacite.org/mds/doi
77
77
  body:
78
78
  encoding: UTF-8
79
79
  string: |-
@@ -105,7 +105,7 @@ http_interactions:
105
105
  - no-cache
106
106
  - no-store
107
107
  Location:
108
- - https://mds.datacite.org/doi/10.5072/TEST_DOI
108
+ - https://test.datacite.org/mds/doi/10.5072/TEST_DOI
109
109
  Content-Type:
110
110
  - application/xml;charset=UTF-8
111
111
  Content-Length:
@@ -117,7 +117,7 @@ http_interactions:
117
117
  recorded_at: Tue, 04 Nov 2014 15:15:03 GMT
118
118
  - request:
119
119
  method: get
120
- uri: https://test:test@mds.datacite.org/doi/10.5072/test_doi
120
+ uri: https://test:test@test.datacite.org/mds/doi/10.5072/test_doi
121
121
  body:
122
122
  encoding: US-ASCII
123
123
  string: ''
@@ -153,7 +153,7 @@ http_interactions:
153
153
  recorded_at: Tue, 04 Nov 2014 15:16:41 GMT
154
154
  - request:
155
155
  method: post
156
- uri: https://test:test@mds.datacite.org/doi
156
+ uri: https://test:test@test.datacite.org/mds/doi
157
157
  body:
158
158
  encoding: UTF-8
159
159
  string: |-
@@ -185,7 +185,7 @@ http_interactions:
185
185
  - no-cache
186
186
  - no-store
187
187
  Location:
188
- - https://mds.datacite.org/doi/10.5072/TEST_DOI
188
+ - https://test.datacite.org/mds/doi/10.5072/TEST_DOI
189
189
  Content-Type:
190
190
  - application/xml;charset=UTF-8
191
191
  Content-Length:
@@ -197,7 +197,7 @@ http_interactions:
197
197
  recorded_at: Tue, 04 Nov 2014 15:01:57 GMT
198
198
  - request:
199
199
  method: get
200
- uri: https://test:test@mds.datacite.org/doi/10.5072/test_doi
200
+ uri: https://test:test@test.datacite.org/mds/doi/10.5072/test_doi
201
201
  body:
202
202
  encoding: US-ASCII
203
203
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://invalid:invalid@mds.datacite.org/doi/10.5072/MY_TEST
5
+ uri: https://invalid:invalid@test.datacite.org/mds/doi/10.5072/MY_TEST
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -25,7 +25,7 @@ http_interactions:
25
25
  Expires:
26
26
  - Thu, 01 Jan 1970 00:00:00 UTC
27
27
  Www-Authenticate:
28
- - Basic realm="mds.datacite.org"
28
+ - Basic realm="test.datacite.org/mds"
29
29
  Content-Length:
30
30
  - '15'
31
31
  Content-Type:
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://test:test@mds.datacite.org/doi/non-existing
5
+ uri: https://test:test@test.datacite.org/mds/doi/non-existing
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://test:test@mds.datacite.org/doi/10.5072/MY_TEST
5
+ uri: https://test:test@test.datacite.org/mds/doi/10.5072/MY_TEST
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://test:test@mds.datacite.org/metadata/non-existing
5
+ uri: https://test:test@test.datacite.org/mds/metadata/non-existing
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: get
5
- uri: https://test:test@mds.datacite.org/metadata/10.5072/MY_TEST
5
+ uri: https://test:test@test.datacite.org/mds/metadata/10.5072/MY_TEST
6
6
  body:
7
7
  encoding: US-ASCII
8
8
  string: ''
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://test:test@mds.datacite.org/metadata
5
+ uri: https://test:test@test.datacite.org/mds/metadata
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |
@@ -58,7 +58,7 @@ http_interactions:
58
58
  - no-cache
59
59
  - no-store
60
60
  Location:
61
- - https://mds.datacite.org/metadata/10.5072/my_test
61
+ - https://test.datacite.org/mds/metadata/10.5072/my_test
62
62
  Content-Type:
63
63
  - application/xml;charset=UTF-8
64
64
  Content-Length:
@@ -2,7 +2,7 @@
2
2
  http_interactions:
3
3
  - request:
4
4
  method: post
5
- uri: https://test:test@mds.datacite.org/metadata
5
+ uri: https://test:test@test.datacite.org/mds/metadata
6
6
  body:
7
7
  encoding: UTF-8
8
8
  string: |-
@@ -1,48 +1,52 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe DataciteDoiIfy do
4
-
5
- let(:endpoint) { Datacite.new('test', 'test') }
4
+ let(:endpoint) { Datacite.new('test', 'test', Datacite::TEST_ENDPOINT) }
6
5
  let(:doi) { '10.5072/MY_TEST' }
7
6
  let(:url) { 'https://seek.sysmo-db.org' }
8
7
 
9
- describe 'resolve a DOI', :vcr => {:cassette_name => "resolve_a_DOI/returns_a_url_associated_with_a_given_DOI"} do
8
+ describe 'resolve a DOI',
9
+ vcr: { cassette_name: 'resolve_a_DOI/returns_a_url_associated_with_a_given_DOI' } do
10
10
  it 'returns a url associated with a given DOI' do
11
11
  expect(endpoint.resolve(doi)).to eq(url)
12
12
  end
13
13
 
14
- it 'returns a 401 for un-authorized account', :vcr => {:cassette_name => "resolve_a_DOI/returns_a_401_for_un-authorized_account"} do
14
+ it 'returns a 401 for un-authorized account',
15
+ vcr: { cassette_name: 'resolve_a_DOI/returns_a_401_for_un-authorized_account' } do
15
16
  invalid_user = 'invalid'
16
17
  invalid_password = 'invalid'
17
- endpoint = Datacite.new(invalid_user, invalid_password)
18
- expect(endpoint.resolve(doi)[0..2]).to eq('401')
18
+ endpoint = Datacite.new(invalid_user, invalid_password, Datacite::TEST_ENDPOINT)
19
+ expect { endpoint.resolve(doi) }.to raise_error(RestClient::Unauthorized)
19
20
  end
20
21
 
21
- it 'returns a 404 for not-found DOI', :vcr => {:cassette_name => "resolve_a_DOI/returns_a_404_for_not-found_DOI"} do
22
+ it 'returns a 404 for not-found DOI',
23
+ vcr: { cassette_name: 'resolve_a_DOI/returns_a_404_for_not-found_DOI' } do
22
24
  doi = 'non-existing'
23
- expect(endpoint.resolve(doi)[0..2]).to eq('404')
25
+ expect { endpoint.resolve(doi) }.to raise_error(RestClient::ResourceNotFound)
24
26
  end
25
27
  end
26
28
 
27
29
  describe 'mint a DOI' do
28
30
  context 'DOI does not exist' do
29
- it 'mints a new DOI', :vcr => {:cassette_name => "mint_a_DOI/mints_a_new_DOI"} do
31
+ it 'mints a new DOI', vcr: { cassette_name: 'mint_a_DOI/mints_a_new_DOI' } do
30
32
  metadata = open_test_metadata('my_test.xml')
31
33
  expect(endpoint.upload_metadata(metadata)).to eq('OK (10.5072/my_test)')
32
34
  expect(endpoint.mint(doi, url)).to eq('OK')
33
35
  expect(endpoint.resolve(doi)).to eq(url)
34
36
  end
35
37
 
36
- it 'returns 412 if metadata has not been uploaded', :vcr => {:cassette_name => "mint_a_DOI/returns_412_if_metadata_has_not_been_uploaded"} do
37
- new_doi = "10.5072/new_doi"
38
- #412 Precondition failed
39
- expect(endpoint.mint(new_doi, url)[0..2]).to eq('412')
38
+ it 'returns 412 if metadata has not been uploaded',
39
+ vcr: { cassette_name: 'mint_a_DOI/returns_412_if_metadata_has_not_been_uploaded' } do
40
+ new_doi = '10.5072/new_doi'
41
+ # 412 Precondition failed
42
+ expect { endpoint.mint(new_doi, url) }.to raise_error(RestClient::PreconditionFailed)
40
43
  end
41
44
  end
42
45
 
43
46
  context 'DOI exists' do
44
- it 'updates the URL if different', :vcr => {:cassette_name => "mint_a_DOI/updates_the_URL_if_different"} do
45
- #use test_doi.xml so that it does not update the url of my_test.xml
47
+ it 'updates the URL if different',
48
+ vcr: { cassette_name: 'mint_a_DOI/updates_the_URL_if_different' } do
49
+ # use test_doi.xml so that it does not update the url of my_test.xml
46
50
  metadata = open_test_metadata('test_doi.xml')
47
51
  doi = '10.5072/test_doi'
48
52
  expect(endpoint.upload_metadata(metadata)).to eq('OK (10.5072/test_doi)')
@@ -57,27 +61,31 @@ describe DataciteDoiIfy do
57
61
  end
58
62
 
59
63
  describe 'retrieve metadata' do
60
- it 'returns metadata associated with a given DOI', :vcr => {:cassette_name => "retrieve_metadata/returns_metadata_associated_with_a_given_DOI"} do
64
+ it 'returns metadata associated with a given DOI',
65
+ vcr: { cassette_name: 'retrieve_metadata/returns_metadata_associated_with_a_given_DOI' } do
61
66
  metadata = open_test_metadata('my_test.xml')
62
67
  expect(endpoint.metadata(doi)).to eq(metadata)
63
68
  end
64
69
 
65
- it 'returns 404 for not found DOI', :vcr => {:cassette_name => "retrieve_metadata/returns_404_for_not_found_DOI"} do
70
+ it 'returns 404 for not found DOI',
71
+ vcr: { cassette_name: 'retrieve_metadata/returns_404_for_not_found_DOI' } do
66
72
  doi = 'non-existing'
67
- expect(endpoint.metadata(doi)[0..2]).to eq('404')
73
+ expect { endpoint.metadata(doi) }.to raise_error(RestClient::ResourceNotFound)
68
74
  end
69
75
  end
70
76
 
71
77
  describe 'upload metadata' do
72
- it 'creates new version of metadata', :vcr => {:cassette_name => "upload_metadata/creates_new_version_of_metadata"} do
78
+ it 'creates new version of metadata',
79
+ vcr: { cassette_name: 'upload_metadata/creates_new_version_of_metadata' } do
73
80
  metadata = open_test_metadata('my_test.xml')
74
81
  expect(endpoint.upload_metadata(metadata)).to eq('OK (10.5072/my_test)')
75
82
  end
76
83
 
77
- it 'returns 400 for an invalid xml', :vcr => {:cassette_name => "upload_metadata/returns_400_for_an_invalid_xml"} do
84
+ it 'returns 400 for an invalid xml',
85
+ vcr: { cassette_name: 'upload_metadata/returns_400_for_an_invalid_xml' } do
78
86
  # metadata without a DOI => Bad request
79
87
  metadata = open_test_metadata('invalid_doi.xml')
80
- expect(endpoint.upload_metadata(metadata)[0..2]).to eq('400')
88
+ expect { endpoint.upload_metadata(metadata) }.to raise_error(RestClient::BadRequest)
81
89
  end
82
90
  end
83
91
 
@@ -91,10 +99,11 @@ describe DataciteDoiIfy do
91
99
  end
92
100
  end
93
101
 
94
- def open_test_metadata filename
95
- file = File.join "spec/","/metadata_files/", filename
102
+ private
103
+
104
+ def open_test_metadata(filename)
105
+ file = File.join 'spec/', '/metadata_files/', filename
96
106
  open(file).read
97
107
  end
98
-
99
- #TODO: Media API
100
- end
108
+ # TODO: Media API
109
+ end
@@ -6,14 +6,9 @@ require 'pry'
6
6
  require 'datacite_doi_ify'
7
7
  require 'webmock/rspec'
8
8
 
9
-
10
9
  VCR.configure do |c|
11
10
  c.cassette_library_dir = 'spec/cassettes'
12
11
  c.hook_into :webmock
13
- c.default_cassette_options = { :record => :none }
12
+ c.default_cassette_options = { record: :none }
14
13
  c.configure_rspec_metadata!
15
14
  end
16
-
17
- RSpec.configure do |c|
18
-
19
- end
metadata CHANGED
@@ -1,14 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacite_doi_ify
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
- - quyen nguyen
7
+ - Quyen Nguyen
8
+ - Finn Bacall
8
9
  autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
12
+ date: 2015-07-15 00:00:00.000000000 Z
12
13
  dependencies:
13
14
  - !ruby/object:Gem::Dependency
14
15
  name: rest-client
@@ -167,12 +168,14 @@ dependencies:
167
168
  description: Mint a DOI and resolve a DOI using the Datacite restful web service
168
169
  email:
169
170
  - thucquyendn@gmail.com
171
+ - finn.bacall@manchester.ac.uk
170
172
  executables: []
171
173
  extensions: []
172
174
  extra_rdoc_files: []
173
175
  files:
174
176
  - ".coveralls.yml"
175
177
  - ".gitignore"
178
+ - ".rubocop.yml"
176
179
  - ".ruby-gemset"
177
180
  - ".ruby-version"
178
181
  - ".travis.yml"
@@ -200,8 +203,9 @@ files:
200
203
  - spec/metadata_files/my_test.xml
201
204
  - spec/metadata_files/test_doi.xml
202
205
  - spec/spec_helper.rb
203
- homepage: https://seek.sysmo-db.org/people/372
204
- licenses: []
206
+ homepage: https://github.com/FAIRdom/datacite_doi_ify
207
+ licenses:
208
+ - BSD
205
209
  metadata: {}
206
210
  post_install_message:
207
211
  rdoc_options: []
@@ -219,23 +223,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
219
223
  version: '0'
220
224
  requirements: []
221
225
  rubyforge_project: datacite_doi_ify
222
- rubygems_version: 2.2.2
226
+ rubygems_version: 2.4.8
223
227
  signing_key:
224
228
  specification_version: 4
225
229
  summary: A ruby gem for working with the DataCite doi restful web service
226
- test_files:
227
- - spec/cassettes/mint_a_DOI/mints_a_new_DOI.yml
228
- - spec/cassettes/mint_a_DOI/returns_412_if_metadata_has_not_been_uploaded.yml
229
- - spec/cassettes/mint_a_DOI/updates_the_URL_if_different.yml
230
- - spec/cassettes/resolve_a_DOI/returns_a_401_for_un-authorized_account.yml
231
- - spec/cassettes/resolve_a_DOI/returns_a_404_for_not-found_DOI.yml
232
- - spec/cassettes/resolve_a_DOI/returns_a_url_associated_with_a_given_DOI.yml
233
- - spec/cassettes/retrieve_metadata/returns_404_for_not_found_DOI.yml
234
- - spec/cassettes/retrieve_metadata/returns_metadata_associated_with_a_given_DOI.yml
235
- - spec/cassettes/upload_metadata/creates_new_version_of_metadata.yml
236
- - spec/cassettes/upload_metadata/returns_400_for_an_invalid_xml.yml
237
- - spec/datacite_doi_ify_spec.rb
238
- - spec/metadata_files/invalid_doi.xml
239
- - spec/metadata_files/my_test.xml
240
- - spec/metadata_files/test_doi.xml
241
- - spec/spec_helper.rb
230
+ test_files: []