Module: UtilityPack::Win32::ShellHelpers
- Includes:
- CoreHelpers
- Defined in:
- lib/utility_pack/win32/shell_helpers.rb
Instance Method Summary collapse
- #cmd_prompt_here(*options) ⇒ Object
- #cmd_then_exit(cmd, *options) ⇒ Object
- #cmd_then_remain(cmd, *options) ⇒ Object
- #start_and_wait(cmd, *options) ⇒ Object
- #start_async(cmd, *options) ⇒ Object
Methods included from CoreHelpers
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(*) directory_path = ENV['dir'] || '' cmd_then_remain "(cd /d #{directory_path} & cls)", 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, *) << "/c" s "cmd #{.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, *) << "/k" s "cmd #{.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, *) << "/wait" start_async(cmd, ) end |
#start_async(cmd, *options) ⇒ Object
16 17 18 |
# File 'lib/utility_pack/win32/shell_helpers.rb', line 16 def start_async(cmd, *) s "cmd /c start \"\" #{.join(' ')} #{cmd}" end |