Class: Sanford::RestartCmd
- Inherits:
-
Object
- Object
- Sanford::RestartCmd
- Defined in:
- lib/sanford/process.rb
Instance Attribute Summary collapse
-
#argv ⇒ Object
readonly
Returns the value of attribute argv.
-
#dir ⇒ Object
readonly
Returns the value of attribute dir.
Instance Method Summary collapse
-
#initialize ⇒ RestartCmd
constructor
A new instance of RestartCmd.
- #run(server) ⇒ Object
Constructor Details
#initialize ⇒ RestartCmd
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
#argv ⇒ Object (readonly)
Returns the value of attribute argv.
132 133 134 |
# File 'lib/sanford/process.rb', line 132 def argv @argv end |
#dir ⇒ Object (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 |