datacite-mapping 0.1.13 → 0.1.14

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: a8781a8ea9333f3202323eab45df470e26e913e2
4
- data.tar.gz: 59e9910f4613280d441f5e9ddddecc20d52ce96e
3
+ metadata.gz: aff43fbc3d2ced53be18c3c3f8351af84d25a102
4
+ data.tar.gz: 3d8b932af5c5b8429e9f9bde9b95867adae9a4d1
5
5
  SHA512:
6
- metadata.gz: 0425ceacf4ca420bb2285a46e70d576b36fdc9021fe8db16143a5f97e75780624b5bb7a82ac3e1cc2f9b751e776e050ce20b24538779a82f08c406f3472308f5
7
- data.tar.gz: 51cd66923ab219b649f099d1b2ca72ddbd07810eda31f156cf0729fd16ca5934e428a00292aa6ec673fe33f6d7cb2d1ebe71f64fbe66554d77f10d8cdc591793
6
+ metadata.gz: 76eb23b7af667ab5d53d8546785f1d2ec7381bcf9e78d998c1c4e20a18db6954c9a835372e93d612f188703458bb3585b192f6e27efe1c443493b7b3b7b70ce3
7
+ data.tar.gz: c475108f5497cf866b835f3ed0d8f9b72ed18ed837ad817dbb9a77b647a45b87c2b39f5a78158d82ff90827f23deec0876c28322fa8134d710906245bc0cd6be
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ['lib']
26
26
 
27
27
  spec.add_dependency 'typesafe_enum', '~> 0.1', '>= 0.1.7'
28
- spec.add_dependency 'xml-mapping_extensions', '~> 0.3', '>= 0.3.6'
28
+ spec.add_dependency 'xml-mapping_extensions', '~> 0.4'
29
29
 
30
30
  spec.add_development_dependency 'bundler', '~> 1.7'
31
31
  spec.add_development_dependency 'equivalent-xml', '~> 0.6.0'
@@ -4,7 +4,7 @@ module Datacite
4
4
  NAME = 'datacite-mapping'
5
5
 
6
6
  # The version of this gem
7
- VERSION = '0.1.13'
7
+ VERSION = '0.1.14'
8
8
 
9
9
  # The copyright notice for this gem
10
10
  COPYRIGHT = 'Copyright (c) 2016 The Regents of the University of California'
@@ -15,9 +15,9 @@ module Datacite
15
15
  # of a resource for citation and retrieval purposes, along with recommended use instructions.
16
16
  # The resource that is being identified can be of any kind, but it is typically a dataset.
17
17
  class Resource
18
- include XML::Mapping
18
+ include XML::MappingExtensions::Namespaced
19
19
 
20
- NAMESPACE = XML::MappingExtensions::Namespace.new(
20
+ namespace XML::MappingExtensions::Namespace.new(
21
21
  uri: 'http://datacite.org/schema/kernel-3',
22
22
  schema_location: 'http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd'
23
23
  )
@@ -44,7 +44,6 @@ module Datacite
44
44
  # @param descriptions [Array<Description>] all additional information that does not fit in any of the other categories.
45
45
  # @param geo_locations [Array<GeoLocations>] spatial region or named place where the data was gathered or about which the data is focused.
46
46
  def initialize(identifier:, creators:, titles:, publisher:, publication_year:, subjects: [], contributors: [], dates: [], language: 'en', resource_type: nil, alternate_identifiers: [], related_identifiers: [], sizes: [], formats: [], version: nil, rights_list: [], descriptions: [], geo_locations: []) # rubocop:disable Metrics/MethodLength, Metrics/ParameterLists, Metrics/AbcSize
47
- self.namespace = NAMESPACE
48
47
  self.identifier = identifier
49
48
  self.creators = creators
50
49
  self.titles = titles
@@ -65,20 +64,12 @@ module Datacite
65
64
  self.geo_locations = geo_locations
66
65
  end
67
66
 
68
- # Overrides `Class.allocate`, used by `XML::Mapping` on read, to make sure
69
- # the namespace gets set even when we don't call the initializer
70
- def self.allocate
71
- res = super
72
- res.namespace = NAMESPACE
73
- res
74
- end
75
-
76
67
  # Sets the namespace prefix to be used when writing out XML (defaults to nil)
77
68
  # @param prefix [String, nil] The new prefix, or nil to use the default,
78
69
  # unprefixed namespace
79
- def namespace_prefix=(prefix)
70
+ def self.namespace_prefix=(prefix)
80
71
  old_namespace = namespace
81
- self.namespace = ::XML::MappingExtensions::Namespace.new(uri: old_namespace.uri, schema_location: old_namespace.schema_location, prefix: prefix)
72
+ self.namespace ::XML::MappingExtensions::Namespace.new(uri: old_namespace.uri, schema_location: old_namespace.schema_location, prefix: prefix)
82
73
  end
83
74
 
84
75
  def language
@@ -778,8 +778,8 @@ module Datacite
778
778
  publisher: @publisher,
779
779
  publication_year: @pub_year
780
780
  )
781
- resource.namespace_prefix = 'dcs'
782
- expect(resource.namespace.prefix).to eq('dcs')
781
+ Resource.namespace_prefix = 'dcs'
782
+ expect(Resource.namespace.prefix).to eq('dcs')
783
783
 
784
784
  expected = '<dcs:resource xmlns:dcs="http://datacite.org/schema/kernel-3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://datacite.org/schema/kernel-3 http://schema.datacite.org/meta/kernel-3/metadata.xsd">
785
785
  <dcs:identifier identifierType="DOI">10.14749/1407399495</dcs:identifier>
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: datacite-mapping
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.13
4
+ version: 0.1.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-05-03 00:00:00.000000000 Z
11
+ date: 2016-05-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: typesafe_enum
@@ -36,20 +36,14 @@ dependencies:
36
36
  requirements:
37
37
  - - "~>"
38
38
  - !ruby/object:Gem::Version
39
- version: '0.3'
40
- - - ">="
41
- - !ruby/object:Gem::Version
42
- version: 0.3.6
39
+ version: '0.4'
43
40
  type: :runtime
44
41
  prerelease: false
45
42
  version_requirements: !ruby/object:Gem::Requirement
46
43
  requirements:
47
44
  - - "~>"
48
45
  - !ruby/object:Gem::Version
49
- version: '0.3'
50
- - - ">="
51
- - !ruby/object:Gem::Version
52
- version: 0.3.6
46
+ version: '0.4'
53
47
  - !ruby/object:Gem::Dependency
54
48
  name: bundler
55
49
  requirement: !ruby/object:Gem::Requirement