Module: Servolux
- Defined in:
- lib/servolux.rb
Defined Under Namespace
Modules: Threaded Classes: Child, Daemon, Piper, Prefork, Server
Constant Summary collapse
- LIBPATH =
:stopdoc:
::File.(::File.dirname(__FILE__)) + ::File::SEPARATOR
- PATH =
::File.dirname(LIBPATH) + ::File::SEPARATOR
- Error =
Generic Servolux Error class.
Class.new(StandardError)
Class Method Summary collapse
-
.fork? ⇒ Boolean
Returns
true
if the execution platform supports fork. -
.libpath(*args) ⇒ String
Returns the library path for the module.
-
.path(*args) ⇒ String
Returns the lpath for the module.
-
.version ⇒ String
Returns the version string for the library.
Class Method Details
.fork? ⇒ Boolean
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 |
.libpath(*args) ⇒ String
Returns the library path for the module. If any arguments are given, they will be joined to the end of the libray 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 |
.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
.
36 37 38 |
# File 'lib/servolux.rb', line 36 def self.path( *args ) args.empty? ? PATH : ::File.join(PATH, args.flatten) end |
.version ⇒ String
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 |