Top Level Namespace

Defined Under Namespace

Modules: BrowserAppBase Classes: AppMainBase, MyApp, Search, WsServer

Instance Method Summary collapse

Instance Method Details

#config_json_hash(json) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/template/wsserver.rb', line 5

def config_json_hash(json)
  config = {}
  json.each do |j|
    config[j["name"]] = j["value"]
  end
  return config
end

#get_unused_portObject

空きポートを取得



14
15
16
17
18
19
# File 'lib/template/start.rb', line 14

def get_unused_port
  s = TCPServer.open(0)
  port = s.addr[1]
  s.close
  return port
end