Class: Vrowser::Daemon

Inherits:
Object
  • Object
show all
Defined in:
lib/vrowser/http_daemon.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) {|_self| ... } ⇒ Daemon

Returns a new instance of Daemon.

Yields:

  • (_self)

Yield Parameters:



14
15
16
17
18
# File 'lib/vrowser/http_daemon.rb', line 14

def initialize(options={})
  @config_path = options[:config_path] or raise ArgumentError("config_path")
  yield(self) if block_given?
  self
end

Class Method Details

.start(options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/vrowser/http_daemon.rb', line 7

def self.start(options={})
  self.new(options) do |instance|
    instance.start
  end
end

Instance Method Details

#daemonize!Object



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

def daemonize!
  Process.daemon
end

#startObject



20
21
22
23
# File 'lib/vrowser/http_daemon.rb', line 20

def start
  fetch_and_update @config_path
  regist_stop
end

#stopObject



29
30
# File 'lib/vrowser/http_daemon.rb', line 29

def stop
end