Module: Mizuno::Daemonizer

Included in:
Runner
Defined in:
lib/mizuno/runner.rb

Defined Under Namespace

Modules: StubbedClassMethods, UnixClassMethods

Class Method Summary collapse

Class Method Details

.included?(base) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/mizuno/runner.rb', line 17

def self.included?(base)
    if(Config::CONFIG['host_os'] =~ /mswin|mingw/)
        base.send(:extend, StubbedClassMethods)
    else
        base.send(:extend, UnixClassMethods)
        base.send(:class_eval) do
            extend FFI::Library
            ffi_lib 'c'
            attach_function :_setuid, :setuid, [ :uint ], :int
            attach_function :_setgid, :setgid, [ :uint ], :int
        end
    end

end