class Device::Runtime

Public Class Methods

adapter() click to toggle source
# File lib/device/runtime.rb, line 5
def self.adapter
  Device.adapter::Runtime
end
execute(app, json = nil) click to toggle source

Execute app in new context.

To execute the should exists a zip file cotain the app,
previously downloaded from CloudWalk.

@param app [String] App name, example “app”, should exists file app.zip @param json [String] Parameters to confifure new aplication. @return [Object] From the new runtime instance.

# 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() click to toggle source
# File lib/device/runtime.rb, line 41
def self.reload
  self.adapter.reload
end
start(app, json = nil) click to toggle source
# 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) click to toggle source
# File lib/device/runtime.rb, line 28
def self.stop(app)
  mrb_stop(app)
end
system_reload() click to toggle source

Check if any change has happen to Network, Settings or ParamsDat @return [NilClass] From the new runtime instance.

# File lib/device/runtime.rb, line 34
def self.system_reload
  Device::Setting.setup
  DaFunk::ParamsDat.setup
  Device::Network.setup
  nil
end