summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/edoors/spin.rb16
-rw-r--r--spec/spin_spec.rb3
2 files changed, 15 insertions, 4 deletions
diff --git a/lib/edoors/spin.rb b/lib/edoors/spin.rb
index 9894409..9f62b47 100644
--- a/lib/edoors/spin.rb
+++ b/lib/edoors/spin.rb
@@ -38,9 +38,17 @@ module Edoors
@debug_routing = o[:debug_routing]||o['debug_routing']||false
#
if not o.empty?
- o['iotas'].each do |name,iota|
- Edoors::Room.json_create(iota.merge!('parent'=>self))
- end if o['iotas']
+ room = o['inner_room']
+ if room
+ room['iotas'].each do |name,iota|
+ eval( iota['kls'] ).json_create(iota.merge!('parent'=>self))
+ end
+ room['links'].each do |src,links|
+ links.each do |link|
+ add_link Edoors::Link.json_create(link)
+ end
+ end
+ end
o['app_fifo'].each do |particle|
@app_fifo << Edoors::Particle.json_create(particle.merge!('spin'=>self))
end if o['app_fifo']
@@ -58,7 +66,7 @@ module Edoors
'timestamp' => Time.now,
'name' => @name,
'hibernation' => @hibernation,
- 'iotas' => @iotas,
+ 'inner_room' => { :iotas=>@iotas, :links=>@links },
'sys_fifo' => @sys_fifo,
'app_fifo' => @app_fifo,
'debug_errors' => @debug_errors,
diff --git a/spec/spin_spec.rb b/spec/spin_spec.rb
index 93ddf27..9d73b90 100644
--- a/spec/spin_spec.rb
+++ b/spec/spin_spec.rb
@@ -117,6 +117,9 @@ describe Edoors::Spin do
spin = Edoors::Spin.new 'dom0'
p0 = spin.require_p Edoors::Particle
p0.add_dst Edoors::SYS_ACT_HIBERNATE
+ Edoors::Room.new 'input', spin
+ Edoors::Room.new 'output', spin
+ spin.add_link Edoors::Link.new('input', 'output', nil, nil, nil)
spin.send_sys_p p0
spin.spin!
dom0 = Edoors::Spin.resume! spin.hibernate_path