Class: Sanford::RestartCmd

Inherits:
Object
  • Object
show all
Defined in:
lib/sanford/process.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeRestartCmd

Returns a new instance of RestartCmd.



134
135
136
137
138
# File 'lib/sanford/process.rb', line 134

def initialize
  require 'rubygems'
  @dir  = get_pwd
  @argv = [Gem.ruby, $0, ARGV.dup].flatten
end

Instance Attribute Details

#argvObject (readonly)

Returns the value of attribute argv.



132
133
134
# File 'lib/sanford/process.rb', line 132

def argv
  @argv
end

#dirObject (readonly)

Returns the value of attribute dir.



132
133
134
# File 'lib/sanford/process.rb', line 132

def dir
  @dir
end

Instance Method Details

#run(server) ⇒ Object



142
143
144
145
146
147
148
# File 'lib/sanford/process.rb', line 142

def run(server)
  ENV['SANFORD_SERVER_FD']      = server.file_descriptor.to_s
  ENV['SANFORD_CLIENT_FDS']     = server.client_file_descriptors.join(',')
  ENV['SANFORD_SKIP_DAEMONIZE'] = 'yes'
  Dir.chdir self.dir
  Kernel.exec(*self.argv)
end