occi-core 5.0.0.beta.9 → 5.0.0.beta.10
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: afd95a13c2ec93db744f907fec0ebe077a424f7b
|
4
|
+
data.tar.gz: 1526f8f20ffb41189e25455c759eb5ae79062268
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8a1d1e1b9d6d547d3035c5e9ac2928e8b18395235644158309b7e565c1fba1eecd2f4c5fba1889bae56bb02e3e7679d2d42de716374e00531186f3d15024df5b
|
7
|
+
data.tar.gz: e94eca874b8252507c247a172a45f2c16a448695a73f2785af7d70aa5ab09de10ae7dc33250d65192381a84eba60f299f7691b4cf5fd1eb75ed3a1164debd032
|
@@ -29,7 +29,7 @@ module Occi
|
|
29
29
|
logger.debug "Identified #{action.class}[#{action.identifier}]"
|
30
30
|
ai = Occi::Core::ActionInstance.new(action: action)
|
31
31
|
ep = Entity.new(model: model)
|
32
|
-
ep.set_attributes!(ai
|
32
|
+
ep.set_attributes!(ai, parsed[:attributes]) if parsed[:attributes]
|
33
33
|
|
34
34
|
logger.debug "Parsed into ActionInstance #{ai.inspect}" if logger_debug?
|
35
35
|
ai
|
@@ -70,8 +70,8 @@ module Occi
|
|
70
70
|
logger.debug "Converting #{hash.inspect} into a single instance" if logger_debug?
|
71
71
|
instance = @_ib.get hash[:kind], mixins: lookup(hash[:mixins]), actions: lookup(hash[:actions])
|
72
72
|
|
73
|
-
set_attributes! instance
|
74
|
-
set_links! instance
|
73
|
+
set_attributes! instance, hash[:attributes]
|
74
|
+
set_links! instance, hash[:links] if instance.respond_to?(:links)
|
75
75
|
set_target! instance, hash[:target] if instance.respond_to?(:target)
|
76
76
|
|
77
77
|
logger.debug "Created instance #{instance.inspect}" if logger_debug?
|
@@ -96,18 +96,19 @@ module Occi
|
|
96
96
|
|
97
97
|
# :nodoc:
|
98
98
|
def lookup(ary)
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
99
|
+
return Set.new if ary.blank?
|
100
|
+
cats = ary.map do |item|
|
101
|
+
handle(Occi::Core::Errors::ParsingError) { model.find_by_identifier!(item) }
|
102
|
+
end
|
103
|
+
Set.new cats
|
103
104
|
end
|
104
105
|
|
105
106
|
# :nodoc:
|
106
|
-
def set_attributes!(
|
107
|
+
def set_attributes!(instance, hash)
|
107
108
|
return if hash.blank?
|
108
109
|
hash.each_pair do |name, value|
|
109
110
|
logger.debug "Setting attribute #{name} to #{value.inspect}" if logger_debug?
|
110
|
-
attribute = attributes[name.to_s]
|
111
|
+
attribute = instance.attributes[name.to_s]
|
111
112
|
unless attribute
|
112
113
|
raise Occi::Core::Errors::ParsingError,
|
113
114
|
"Attribute #{name.inspect} is not allowed for this entity"
|
@@ -116,9 +117,10 @@ module Occi
|
|
116
117
|
end
|
117
118
|
end
|
118
119
|
|
119
|
-
|
120
|
+
# :nodoc:
|
121
|
+
def set_links!(instance, ary)
|
120
122
|
return if ary.blank?
|
121
|
-
ary.each { |l|
|
123
|
+
ary.each { |l| instance.add_link(json_single(l).first) }
|
122
124
|
end
|
123
125
|
|
124
126
|
# :nodoc:
|
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.10'.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.10
|
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-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|