occi-core 4.3.4 → 4.3.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/occi/core/attributes.rb +8 -6
- data/lib/occi/version.rb +1 -1
- data/occi-core.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d538f5cdea3d97838599cb47ec683aa741511fb6
|
4
|
+
data.tar.gz: c67bbd9ec02ca318d34107f9e424a11b3a2525da
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e3906c64af02d6dce2a806d86e21779c92842a159b67c35eb1a29d92ca57bfb853180fa2bb55333b2482407433114cbfdd94520f1cc3b0018cbde20d3ff0070d
|
7
|
+
data.tar.gz: e30e89e7765a35b16981a001b8711cfea3544392ce4e4a06e227a05a612384b50e60d7f161f2bcc74b44e35ac2e0762ce9def7ff962acb874e5530c52c790930
|
data/lib/occi/core/attributes.rb
CHANGED
@@ -325,22 +325,24 @@ module Occi
|
|
325
325
|
end
|
326
326
|
|
327
327
|
def add_missing_attributes(attributes, definitions, set_defaults)
|
328
|
-
attributes ||= Occi::Core::Attributes.new
|
329
|
-
|
330
328
|
definitions.each_key do |key|
|
331
329
|
next if key =~ /^_/
|
332
330
|
|
333
331
|
if definitions[key].kind_of? Occi::Core::Attributes
|
332
|
+
attributes[key] = Occi::Core::Attributes.new if attributes[key].nil?
|
334
333
|
add_missing_attributes(attributes[key], definitions[key], set_defaults)
|
335
334
|
elsif attributes[key].nil?
|
336
|
-
|
337
335
|
if definitions[key].default.nil?
|
338
336
|
raise Occi::Errors::AttributeMissingError,
|
339
337
|
"Required attribute #{key} not specified" if definitions[key].required
|
340
|
-
|
341
|
-
attributes[key] = definitions[key]
|
338
|
+
elsif definitions[key].required || set_defaults
|
339
|
+
attributes[key] = definitions[key]
|
340
|
+
attributes[key] = definitions[key].default
|
342
341
|
end
|
343
|
-
|
342
|
+
else
|
343
|
+
old_val = attributes[key]
|
344
|
+
attributes[key] = definitions[key]
|
345
|
+
attributes[key] = old_val
|
344
346
|
end
|
345
347
|
end
|
346
348
|
end
|
data/lib/occi/version.rb
CHANGED
data/occi-core.gemspec
CHANGED
@@ -19,7 +19,7 @@ Gem::Specification.new do |gem|
|
|
19
19
|
gem.require_paths = ['lib']
|
20
20
|
|
21
21
|
gem.add_dependency 'json', '>= 1.8.1', '< 3'
|
22
|
-
gem.add_dependency 'hashie', '>= 3.3.1', '<
|
22
|
+
gem.add_dependency 'hashie', '>= 3.3.1', '< 3.5'
|
23
23
|
gem.add_dependency 'uuidtools', '>= 2.1.3', '< 3'
|
24
24
|
gem.add_dependency 'activesupport', '>= 4.0.0', '< 6'
|
25
25
|
gem.add_dependency 'settingslogic', '>= 2.0.9', '< 3'
|
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: 4.3.
|
4
|
+
version: 4.3.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Florian Feldhaus
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2017-
|
13
|
+
date: 2017-02-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
version: 3.3.1
|
42
42
|
- - "<"
|
43
43
|
- !ruby/object:Gem::Version
|
44
|
-
version: '
|
44
|
+
version: '3.5'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
47
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -51,7 +51,7 @@ dependencies:
|
|
51
51
|
version: 3.3.1
|
52
52
|
- - "<"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '
|
54
|
+
version: '3.5'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: uuidtools
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|