Class: Builtins::Background

Inherits:
Builtin
  • Object
show all
Defined in:
lib/builtins/background.rb

Constant Summary collapse

DEFAULT_SHELL =
"bash"
DEFAULT_LOG_FILE_PREFIX =
"/tmp/ops_bglog_"

Instance Attribute Summary

Attributes inherited from Builtin

#args, #config

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Builtin

class_for, #initialize

Constructor Details

This class inherits a constructor from Builtin

Class Method Details

.descriptionObject



11
12
13
# File 'lib/builtins/background.rb', line 11

def description
	"runs the given command in a background session"
end

.log_filenameObject



15
16
17
# File 'lib/builtins/background.rb', line 15

def log_filename
	"#{log_filename_prefix}#{Ops.project_name}"
end

Instance Method Details

#runObject



26
27
28
29
30
31
32
# File 'lib/builtins/background.rb', line 26

def run
	subprocess = fork do
		run_ops(args)
	end

	Process.detach(subprocess)
end