Sha256: 87ef446ec0ee7297fab222f0277c158fbb68ad595b1fafdbe9c4004c5a7a748f

Contents?: true

Size: 508 Bytes

Versions: 20

Compression:

Stored size: 508 Bytes

Contents

module Stf
  class Demonizer
    def initialize(dante, opts = {})
      @dante = dante

      @pid_path = opts[:pid_path].to_s.empty? ? '/tmp/stf-client.pid' : opts[:pid_path]
      @log_path = opts[:log_path].to_s.empty? ? '/tmp/stf-client.log' : opts[:log_path]
    end

    def run
      @dante.execute(daemonize: true,
                     pid_path: @pid_path,
                     log_path: @log_path) {yield}
    end

    def kill
      @dante.execute(kill: true, pid_path: @pid_path)
    end
  end
end

Version data entries

20 entries across 20 versions & 2 rubygems

Version Path
smartdust-client-1.2.0 lib/stf/system/demonizer.rb
smartdust-client-1.1.0 lib/stf/system/demonizer.rb
stf-client-0.3.0 lib/stf/system/demonizer.rb
stf-client-0.3.0.pre.rc.12 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc10 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc9 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc8 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc7 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc6 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc5 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc4 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc3 lib/stf/system/demonizer.rb
stf-client-0.3.0.rc2 lib/stf/system/demonizer.rb
stf-client-0.2.6 lib/stf/system/demonizer.rb
stf-client-0.2.5 lib/stf/system/demonizer.rb
stf-client-0.2.4 lib/stf/system/demonizer.rb
stf-client-0.2.3 lib/stf/system/demonizer.rb
stf-client-0.2.2 lib/stf/system/demonizer.rb
stf-client-0.2.1 lib/stf/system/demonizer.rb
stf-client-0.2.0 lib/stf/system/demonizer.rb