Skip to content

Instantly share code, notes, and snippets.

@YSRKEN
Last active October 20, 2015 11:18
Show Gist options
  • Save YSRKEN/8ed7fcd4b9c1553d8e11 to your computer and use it in GitHub Desktop.
Save YSRKEN/8ed7fcd4b9c1553d8e11 to your computer and use it in GitHub Desktop.
【小ネタ】ランス・アンド・マスクスの第3話にRubyのコードが載ってた ref: http://qiita.com/YSRKEN/items/b78a23b3fa7b6b2f3e2d
def here?(uri)
(current_server.uri rescue nil) == uri
end
module_function :here?
def config
current_server.config
rescue
DRbServer.make_config
end
module_function :config
def front
current_server.front
end
if RUBY_VERSION >= '1.8'
require 'drb/invokemethod'
class InvokeMethod
include InvokeMethod18Mixin
end
else
require 'drb/invokemethod16'
class InvokeMethod
include InvokeMethod16Mixin
end
def main_loop
Thread_ata
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment