stash-wrapper 0.1.6 → 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b47fcabaef7739a10f5bfd3bfb6739ef6f5bf2c0
4
- data.tar.gz: 505ea0b2ae8634662e3c4804370436c81b57563c
3
+ metadata.gz: cb6dd5df6c45afae4bed1654fe7ee2dee9406f65
4
+ data.tar.gz: 7af4155eae092621706b7186a55e1d43647d7b7d
5
5
  SHA512:
6
- metadata.gz: 16dbdc7400afcb229bdd7f530227a9f8e705295550fd2a0952122f9fff46bc3b17d22cc5861e934b1de8d30b2917576a9c92f3c8cbc0c3028f5ef9bb7e76fb19
7
- data.tar.gz: fbb69e10abfeb28e68d1425fd0ad5829cd24cd74ee16b13f02d6f5bbf58dd619de0b5013b77d2a1e975f3a1b84fb07edf7118f8511f4dc36a7cb7b4aa7a593c4
6
+ metadata.gz: 107b4c38067d994db9e8fc24320f07f478243438b7225594534826e1a36d776cdca6076ed09a2992079cb276d51229de2275755da862581bbee7e2fe4d327f44
7
+ data.tar.gz: e1ff98e05c2abc70c21d686022154437c6093f560c6f03bcce64ed2d1adbf9c02f10791ed3bc54d9d4353261ea05adecb09005e89484a0455441911ec9e00833
data/CHANGES.md CHANGED
@@ -1,3 +1,7 @@
1
+ # 0.1.7 (2 May 2016)
2
+
3
+ - Ensure namespace gets set on read as well as write
4
+
1
5
  # 0.1.6 (2 May 2016)
2
6
 
3
7
  - Update to XML::MappingExtensions 0.3.6 and remove now-unnecessary namespace hacks
@@ -5,7 +5,7 @@ module Stash
5
5
  NAME = 'stash-wrapper'
6
6
 
7
7
  # The version of this gem
8
- VERSION = '0.1.6'
8
+ VERSION = '0.1.7'
9
9
 
10
10
  # The copyright notice for this gem
11
11
  COPYRIGHT = 'Copyright (c) 2016 The Regents of the University of California'
@@ -16,6 +16,14 @@ module Stash
16
16
  schema_location: 'http://dash.cdlib.org/stash_wrapper/ http://dash.cdlib.org/stash_wrapper/stash_wrapper.xsd'
17
17
  )
18
18
 
19
+ # Overrides `Class.allocate`, used by `XML::Mapping` on read, to make sure
20
+ # the namespace gets set even when we don't call the initializer
21
+ def self.allocate
22
+ res = super
23
+ res.namespace = NAMESPACE
24
+ res
25
+ end
26
+
19
27
  root_element_name 'stash_wrapper'
20
28
 
21
29
  object_node :identifier, 'identifier', class: Identifier
@@ -36,6 +44,7 @@ module Stash
36
44
  # @param descriptive_elements [Array<REXML::Element>] the encapsulated
37
45
  # XML metadata
38
46
  def initialize(identifier:, version:, license:, embargo: nil, inventory: nil, descriptive_elements:) # rubocop:disable Metrics/ParameterLists
47
+ self.namespace = NAMESPACE
39
48
  self.identifier = identifier
40
49
  self.stash_administrative = StashAdministrative.new(
41
50
  version: version,
@@ -44,7 +53,6 @@ module Stash
44
53
  inventory: inventory
45
54
  )
46
55
  self.stash_descriptive = descriptive_elements
47
- self.namespace = NAMESPACE
48
56
  end
49
57
 
50
58
  def id_value
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: stash-wrapper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Moles