Module: Servolux

Defined in:
lib/servolux.rb

Defined Under Namespace

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

Constant Summary

LIBPATH =

:stopdoc:

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

Generic Servolux Error class.

Class.new(StandardError)

Class Method Summary (collapse)

Class Method Details

+ (Boolean) fork?

Returns true if the execution platform supports fork.



44
45
46
# File 'lib/servolux.rb', line 44

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

+ (String) libpath(*args)

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.



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

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

+ (String) path(*args)

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.



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

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

+ (String) version

Returns the version string for the library.



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

def self.version
  @version ||= File.read(path('version.txt')).strip
end