Class: ChildProcess::Windows::ProcessBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/childprocess/windows/process_builder.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
23
24
# File 'lib/childprocess/windows/process_builder.rb', line 7

def initialize(args)
  @args        = args

  @detach      = false
  @duplex      = false
  @environment = nil
  @cwd         = nil

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

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

Instance Attribute Details

#cwdObject

Returns the value of attribute cwd.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def cwd
  @cwd
end

#detachObject

Returns the value of attribute detach.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def detach
  @detach
end

#duplexObject

Returns the value of attribute duplex.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def duplex
  @duplex
end

#environmentObject

Returns the value of attribute environment.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def environment
  @environment
end

#leaderObject

Returns the value of attribute leader.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def leader
  @leader
end

#stderrObject

Returns the value of attribute stderr.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def stderr
  @stderr
end

#stdinObject (readonly)

Returns the value of attribute stdin.



5
6
7
# File 'lib/childprocess/windows/process_builder.rb', line 5

def stdin
  @stdin
end

#stdoutObject

Returns the value of attribute stdout.



4
5
6
# File 'lib/childprocess/windows/process_builder.rb', line 4

def stdout
  @stdout
end

Instance Method Details

#startObject



26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/childprocess/windows/process_builder.rb', line 26

def start
  create_command_pointer
  create_environment_pointer
  create_cwd_pointer

  setup_flags
  setup_io

  pid = create_process
  close_handles

  pid
end