File: raemon.rb

package info (click to toggle)
ruby-raemon 0.3.0%2Bgit.2012.05.18.b78eaae57c-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 220 kB
  • ctags: 104
  • sloc: ruby: 901; makefile: 4
file content (46 lines) | stat: -rw-r--r-- 964 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
require 'fcntl'
require 'tmpdir'
require 'logger'

module Raemon
  autoload :Configuration,   'raemon/configuration'
  autoload :Master,          'raemon/master'
  autoload :Worker,          'raemon/worker'
  autoload :Server,          'raemon/server'
  autoload :Util,            'raemon/util'
  autoload :Instrumentation, 'raemon/instrumentation'

  # @return [Logger] the logger used by this library
  def self.logger
    Configuration.logger
  end

  # @yield [Raemon::Configuration] a block that allows for convenient configuration
  #
  # @example
  #   Raemon.config do |c|
  #     c.server_name = 'My Server'
  #   end
  #
  # @see Raemon::Configuration
  def self.config
    block_given? and yield Configuration or Configuration
  end

  def self.env
    config.env
  end

  def self.env=(env)
    config.env = env
  end

  # @see Raemon::Configuration.root
  def self.root
    config.root
  end
  
  def self.root=(root)
    config.root = root
  end
end