occi 2.5.16 → 2.5.17
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.
- data/lib/occi/parser.rb +8 -6
- data/lib/occi/version.rb +1 -1
- metadata +4 -14
data/lib/occi/parser.rb
CHANGED
@@ -142,10 +142,11 @@ module OCCI
|
|
142
142
|
# @param [Class] entity_type
|
143
143
|
# @return [OCCI::Collection]
|
144
144
|
def self.text_entity(text, entity_type)
|
145
|
-
collection
|
146
|
-
entity
|
147
|
-
links
|
148
|
-
|
145
|
+
collection = OCCI::Collection.new
|
146
|
+
entity = Hashie::Mash.new
|
147
|
+
links = []
|
148
|
+
entity.links = []
|
149
|
+
categories = Hashie::Mash.new({ :kinds => [], :mixins => [], :actions => [] })
|
149
150
|
text.each_line do |line|
|
150
151
|
if line.include? 'Category'
|
151
152
|
cat = (OCCIANTLR::Parser.new(line.chomp).category)
|
@@ -164,7 +165,8 @@ module OCCI
|
|
164
165
|
cats = entity.categories.split(' ')
|
165
166
|
kind = cats.reverse!.pop
|
166
167
|
mixins = cats.categories
|
167
|
-
|
168
|
+
|
169
|
+
collection.links << OCCI::Core::Link.new(kind, mixins, entity.attributes)
|
168
170
|
elsif entity_type == OCCI::Core::Resource
|
169
171
|
links.each do |link|
|
170
172
|
if link.rel.include? 'action#'
|
@@ -178,7 +180,7 @@ module OCCI
|
|
178
180
|
|
179
181
|
link = OCCI::Core::Link.new(kind, mixins, link.attributes, link.actions, link.rel, link.target, link.source)
|
180
182
|
collection.links << link
|
181
|
-
entity.links
|
183
|
+
entity.links << link
|
182
184
|
end
|
183
185
|
end
|
184
186
|
collection.resources << OCCI::Core::Resource.new(entity.kind, entity.mixins, entity.attributes, entity.actions, entity.links)
|
data/lib/occi/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: occi
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.5.
|
4
|
+
version: 2.5.17
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-
|
13
|
+
date: 2013-08-02 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: json
|
@@ -244,19 +244,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
244
|
version: '0'
|
245
245
|
requirements: []
|
246
246
|
rubyforge_project:
|
247
|
-
rubygems_version: 1.8.
|
247
|
+
rubygems_version: 1.8.25
|
248
248
|
signing_key:
|
249
249
|
specification_version: 3
|
250
250
|
summary: OCCI toolkit
|
251
|
-
test_files:
|
252
|
-
- spec/occi/client_spec.rb
|
253
|
-
- spec/occi/collection_spec.rb
|
254
|
-
- spec/occi/log_spec.rb
|
255
|
-
- spec/occi/model_spec.rb
|
256
|
-
- spec/occi/parser_spec.rb
|
257
|
-
- spec/occi/test.json
|
258
|
-
- spec/occi/test.ova
|
259
|
-
- spec/occi/test.ovf
|
260
|
-
- spec/occiantlr/parser_spec.rb
|
261
|
-
- spec/spec_helper.rb
|
251
|
+
test_files: []
|
262
252
|
has_rdoc:
|