Module: Otaku
- Defined in:
- lib/otaku.rb,
lib/otaku/client.rb,
lib/otaku/server.rb,
lib/otaku/encoder.rb,
lib/otaku/handler.rb
Defined Under Namespace
Modules: Client, Encoder, Server
Classes: DataProcessError, Handler, HandlerNotDefinedError
Constant Summary
collapse
- DEFAULTS =
{
:ruby => 'ruby',
:address => '127.0.0.1',
:port => 10999,
:log_file => '/tmp/otaku.log',
:init_wait_time => 2 * (RUBY_PLATFORM =~ /java/i ? 3 : 1)
}
Class Method Summary
collapse
Class Method Details
.config ⇒ Object
36
37
38
39
40
|
# File 'lib/otaku.rb', line 36
def config
DEFAULTS.keys.inject({}) do |memo, name|
memo.merge(name => send(name))
end
end
|
31
32
33
34
|
# File 'lib/otaku.rb', line 31
def configure(config = {}, &block)
block_given? ? yield(self) :
config.each{|name, val| send(:"#{name}=", val) }
end
|
.process(data) ⇒ Object
52
53
54
|
# File 'lib/otaku.rb', line 52
def process(data)
Client.get(data)
end
|
.start(context = {}, &handler) ⇒ Object
.stop ⇒ Object
48
49
50
|
# File 'lib/otaku.rb', line 48
def stop
Server.stop
end
|