Class: Device::Runtime
- Inherits:
-
Object
- Object
- Device::Runtime
- Includes:
- DaFunk::Helper
- Defined in:
- lib/device/runtime.rb
Class Method Summary collapse
- .adapter ⇒ Object
-
.execute(app, json = nil) ⇒ Object
Execute app in new context.
- .reload ⇒ Object
- .start(app, json = nil) ⇒ Object
- .stop(app) ⇒ Object
-
.system_reload ⇒ NilClass
Check if any change has happen to Network, Settings or ParamsDat.
Class Method Details
.adapter ⇒ Object
5 6 7 |
# File 'lib/device/runtime.rb', line 5 def self.adapter Device.adapter::Runtime end |
.execute(app, json = nil) ⇒ Object
Execute app in new context.
To execute the should exists a zip file cotain the app,
previously downloaded from CloudWalk.
16 17 18 19 20 21 |
# File 'lib/device/runtime.rb', line 16 def self.execute(app, json = nil) buf = "#{json.dup}" if json.is_a?(String) mrb_eval("Context.execute('#{app.dup}', '#{Device.adapter}', '#{buf}')", "#{app.dup}") ensure self.system_reload end |
.reload ⇒ Object
41 42 43 |
# File 'lib/device/runtime.rb', line 41 def self.reload self.adapter.reload end |
.start(app, json = nil) ⇒ Object
23 24 25 26 |
# File 'lib/device/runtime.rb', line 23 def self.start(app, json = nil) buf = "#{json.dup}" if json.is_a?(String) mrb_eval("Context.start('#{app.dup}', '#{Device.adapter}', '#{buf}')", "#{app.dup}") end |
.stop(app) ⇒ Object
28 29 30 |
# File 'lib/device/runtime.rb', line 28 def self.stop(app) mrb_stop(app) end |