Top Level Namespace
Defined Under Namespace
Modules: BrowserAppBase, Output Classes: AppMainBase, MyApp, Search, WsServer
Instance Method Summary collapse
- #config_json_hash(json) ⇒ Object
-
#get_os_type ⇒ Object
get os type.
-
#get_unused_port ⇒ Object
空きポートを取得.
Instance Method Details
#config_json_hash(json) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/template/wsserver.rb', line 8 def config_json_hash(json) config = {} json["setting_list"].each do |j| config[j["name"]] = j["value"] end return config end |
#get_os_type ⇒ Object
get os type
5 6 7 8 9 10 11 12 13 |
# File 'lib/template/common.rb', line 5 def get_os_type if RUBY_PLATFORM =~ /win32|mingw|cygwin/ "windows" elsif RUBY_PLATFORM =~ /linux/ "linux" else "unknown" end end |
#get_unused_port ⇒ Object
空きポートを取得
67 68 69 70 71 72 |
# File 'lib/template/start.rb', line 67 def get_unused_port s = TCPServer.open(0) port = s.addr[1] s.close return port end |