occi-core 5.0.0.beta.6 → 5.0.0.beta.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 +4 -4
- data/lib/occi/core/helpers/hash_dereferencer.rb +6 -3
- data/lib/occi/core/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1645f66b7dfc09fb86c8aad566dbc5ce22f674a1
|
4
|
+
data.tar.gz: 8090d0663be19753429b213a39b23ab21b8f0c6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6a670675c314346521bf3f4e0ff8a00b3287e3f273344bd075456fc48e0473f6ce66e8e71d7a26ca2b44c642e03633f0690456be8c9adf4f188534fb7c3468c6
|
7
|
+
data.tar.gz: b0202c952fb37d2177d1fa4bb00e55de035c588713009df030741d244c556e2e6c540d95656caecc96eb68a26fd0a3ec967a545229920a958647d9336556f826
|
@@ -59,6 +59,8 @@ module Occi
|
|
59
59
|
new_attributes = {}
|
60
60
|
self[:attributes].each do |attribute|
|
61
61
|
new_attributes[attribute] = dereference_via_hash(attribute, attribute_definitions)
|
62
|
+
next unless fetch(:attribute_defaults, {})[attribute]
|
63
|
+
new_attributes[attribute].default = self[:attribute_defaults][attribute]
|
62
64
|
end
|
63
65
|
self[:attributes] = new_attributes
|
64
66
|
|
@@ -132,14 +134,15 @@ module Occi
|
|
132
134
|
end
|
133
135
|
|
134
136
|
# Looks up the given attribute definition in the hash. Raises error if no
|
135
|
-
# such attribute definition is found.
|
137
|
+
# such attribute definition is found. The prevent future changes from affecting
|
138
|
+
# new lookups, located definitions are cloned before they are returned.
|
136
139
|
#
|
137
140
|
# @param identifier [String] attribute identifier (name)
|
138
141
|
# @param hash [Hash] hash with known attribute definitions for dereferencing
|
139
|
-
# @return [Occi::Core::AttributeDefinition] definition located in the hash
|
142
|
+
# @return [Occi::Core::AttributeDefinition] definition located in the hash, cloned
|
140
143
|
def dereference_via_hash(identifier, hash)
|
141
144
|
raise "Attribute definition #{identifier.inspect} not found in the hash" unless hash[identifier]
|
142
|
-
hash[identifier]
|
145
|
+
hash[identifier].clone
|
143
146
|
end
|
144
147
|
|
145
148
|
private :dereference_via_hash, :dereference_via_model
|
data/lib/occi/core/version.rb
CHANGED
@@ -3,7 +3,7 @@ module Occi
|
|
3
3
|
MAJOR_VERSION = 5 # Major update constant
|
4
4
|
MINOR_VERSION = 0 # Minor update constant
|
5
5
|
PATCH_VERSION = 0 # Patch/Fix version constant
|
6
|
-
STAGE_VERSION = 'beta.
|
6
|
+
STAGE_VERSION = 'beta.7'.freeze # use `nil` for production releases
|
7
7
|
|
8
8
|
unless defined?(::Occi::Core::VERSION)
|
9
9
|
VERSION = [
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi-core
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.0.beta.
|
4
|
+
version: 5.0.0.beta.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Boris Parak
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-07-
|
13
|
+
date: 2017-07-20 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|