Module: Horobi

Extended by:
Horobi
Included in:
Horobi
Defined in:
lib/horobi.rb,
lib/horobi/hub.rb,
lib/horobi/pub.rb,
lib/horobi/sub.rb

Defined Under Namespace

Modules: Hub, Pub, Sub

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



11
12
13
# File 'lib/horobi.rb', line 11

def config
  @config
end

#loggerObject

Returns the value of attribute logger.



10
11
12
# File 'lib/horobi.rb', line 10

def logger
  @logger
end

Instance Method Details

#close_hooks(&block) ⇒ Object



25
26
27
# File 'lib/horobi.rb', line 25

def close_hooks(&block)
  @closes << block
end

#daemonizeObject



15
16
17
18
19
20
21
22
23
# File 'lib/horobi.rb', line 15

def daemonize
  exit! if fork
  Process.setsid
  exit! if fork

  STDIN.reopen('/dev/null', 'r+')
  STDOUT.reopen('/dev/null', 'a')
  STDERR.reopen('/dev/null', 'a')
end