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.



91
92
93
94
95
# File 'lib/sanford/process.rb', line 91

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.



89
90
91
# File 'lib/sanford/process.rb', line 89

def argv
  @argv
end

#dirObject (readonly)

Returns the value of attribute dir.



89
90
91
# File 'lib/sanford/process.rb', line 89

def dir
  @dir
end

Instance Method Details

#runObject



97
98
99
100
# File 'lib/sanford/process.rb', line 97

def run
  Dir.chdir self.dir
  Kernel.exec(*self.argv)
end