Module: UtilityPack::Win32::ShellHelpers

Includes:
CoreHelpers
Defined in:
lib/utility_pack/win32/shell_helpers.rb

Instance Method Summary collapse

Methods included from CoreHelpers

s

Instance Method Details

#cmd_prompt_here(*options) ⇒ Object



25
26
27
28
# File 'lib/utility_pack/win32/shell_helpers.rb', line 25

def cmd_prompt_here(*options)
  directory_path = ENV['dir']  || ''
  cmd_then_remain "(cd /d #{directory_path} & cls)", options  
end

#cmd_then_exit(cmd, *options) ⇒ Object



6
7
8
9
# File 'lib/utility_pack/win32/shell_helpers.rb', line 6

def cmd_then_exit(cmd, *options)
  options << "/c"
  s "cmd #{options.join(' ')} #{cmd}"
end

#cmd_then_remain(cmd, *options) ⇒ Object



11
12
13
14
# File 'lib/utility_pack/win32/shell_helpers.rb', line 11

def cmd_then_remain(cmd, *options)
  options << "/k"
  s "cmd #{options.join(' ')} #{cmd}"
end

#start_and_wait(cmd, *options) ⇒ Object



20
21
22
23
# File 'lib/utility_pack/win32/shell_helpers.rb', line 20

def start_and_wait(cmd, *options)
  options << "/wait"
  start_async(cmd, options)
end

#start_async(cmd, *options) ⇒ Object



16
17
18
# File 'lib/utility_pack/win32/shell_helpers.rb', line 16

def start_async(cmd, *options)
  s "cmd /c start \"\" #{options.join(' ')} #{cmd}"
end