Class: ChildProcess::Windows::ProcessBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/sapphire/UI/ProcessBuilder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ ProcessBuilder

Returns a new instance of ProcessBuilder.



7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 7

def initialize(args)
  @args        = args

  @inherit     = false
  @detach      = false
  @duplex      = false
  @environment = nil

  @stdout      = nil
  @stderr      = nil
  @stdin       = nil

  @flags       = 0
  @cmd_ptr     = nil
  @env_ptr     = nil
end

Instance Attribute Details

#detachObject

Returns the value of attribute detach.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def detach
  @detach
end

#duplexObject

Returns the value of attribute duplex.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def duplex
  @duplex
end

#environmentObject

Returns the value of attribute environment.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def environment
  @environment
end

#inheritObject

Returns the value of attribute inherit.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def inherit
  @inherit
end

#stderrObject

Returns the value of attribute stderr.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def stderr
  @stderr
end

#stdinObject (readonly)

Returns the value of attribute stdin.



5
6
7
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 5

def stdin
  @stdin
end

#stdoutObject

Returns the value of attribute stdout.



4
5
6
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 4

def stdout
  @stdout
end

Instance Method Details

#startObject



24
25
26
27
28
29
30
31
32
33
34
35
# File 'lib/sapphire/UI/ProcessBuilder.rb', line 24

def start
  create_command_pointer
  create_environment_pointer

  setup_detach
  setup_io

  pid = create_process
  close_handles

  pid
end