Class: SSHKit::Command
- Inherits:
-
Object
- Object
- SSHKit::Command
- Defined in:
- lib/capistrano/background/command.rb
Instance Method Summary collapse
Instance Method Details
#in_background(&_block) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/capistrano/background/command.rb', line 5 def in_background(&_block) return yield unless [:run_in_background] pid_file = [:pid_file] if pid_file.nil? orig_in_background(&_block) else env_str = environment_string if env_str.nil? sprintf("( nohup %s > /dev/null & \\echo $! > #{pid_file})", yield) else sprintf(" && ( #{env_str} nohup %s > /dev/null & \\echo $! > #{pid_file})", yield) end end end |
#orig_in_background ⇒ Object
3 |
# File 'lib/capistrano/background/command.rb', line 3 alias_method :orig_in_background, :in_background |