Module: Servolux

Defined in:
lib/servolux.rb,
lib/servolux/version.rb,
lib/servolux/null_logger.rb

Defined Under Namespace

Modules: Threaded Classes: Child, Daemon, NullLogger, PidFile, Piper, Prefork, Server

Constant Summary collapse

LIBPATH =

:stopdoc:

::File.expand_path(::File.dirname(__FILE__)) + ::File::SEPARATOR
PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
Error =

Generic Servolux Error class.

Class.new(StandardError)
VERSION =
"0.13.0".freeze

Class Method Summary collapse

Class Method Details

.fork?Boolean

Returns true if the execution platform supports fork.

Returns:

  • (Boolean)


35
36
37
# File 'lib/servolux.rb', line 35

def self.fork?
  RUBY_PLATFORM != 'java' and test(?e, '/dev/null')
end

.libpath(*args) ⇒ String

Returns the library path for the module. If any arguments are given, they will be joined to the end of the library path using File.join.

Returns:

  • (String)

    absolute servolux 'lib' path



17
18
19
# File 'lib/servolux.rb', line 17

def self.libpath( *args )
  args.empty? ? LIBPATH : ::File.join(LIBPATH, args.flatten)
end

.NullLoggerObject

Syntactic sugar for getting the null logger instance.

Servolux::NullLogger()   #=> NullLogger singleton instance


16
17
18
# File 'lib/servolux/null_logger.rb', line 16

def self.NullLogger
  NullLogger.instance
end

.path(*args) ⇒ String

Returns the lpath for the module. If any arguments are given, they will be joined to the end of the servolux base path using File.join.

Returns:

  • (String)

    absolute servolux base path



27
28
29
# File 'lib/servolux.rb', line 27

def self.path( *args )
  args.empty? ? PATH : ::File.join(PATH, args.flatten)
end

.versionObject

Returns the version string for the library.



5
6
7
# File 'lib/servolux/version.rb', line 5

def self.version
  VERSION
end