Class: Launchy::Detect::Runner::Windows
- Inherits:
-
Launchy::Detect::Runner
- Object
- Launchy::Detect::Runner
- Launchy::Detect::Runner::Windows
- Defined in:
- lib/launchy/detect/runner.rb
Overview
The list of known runners
Instance Method Summary collapse
- #all_args(cmd, *args) ⇒ Object
- #dry_run(cmd, *args) ⇒ Object
-
#shell_commands(cmd, *args) ⇒ Object
escape the reserved shell characters in windows command shell technet.microsoft.com/en-us/library/cc723564.aspx.
- #wet_run(cmd, *args) ⇒ Object
Methods inherited from Launchy::Detect::Runner
#commandline_normalize, detect, #run
Methods included from Launchy::DescendantTracker
#children, #find_child, #inherited
Instance Method Details
#all_args(cmd, *args) ⇒ Object
73 74 75 76 77 |
# File 'lib/launchy/detect/runner.rb', line 73 def all_args( cmd, *args ) args = [ 'cmd', '/c', *shell_commands( cmd, *args ) ] Launchy.log "Windows: all_args => #{args.inspect}" return args end |
#dry_run(cmd, *args) ⇒ Object
79 80 81 |
# File 'lib/launchy/detect/runner.rb', line 79 def dry_run( cmd, *args ) all_args( cmd, *args ).join(" ") end |
#shell_commands(cmd, *args) ⇒ Object
escape the reserved shell characters in windows command shell technet.microsoft.com/en-us/library/cc723564.aspx
85 86 87 88 89 |
# File 'lib/launchy/detect/runner.rb', line 85 def shell_commands( cmd, *args ) cmdline = [ cmd.shellsplit ] cmdline << args.flatten.collect { |a| a.to_s.gsub(/([&|()<>^])/, "^\\1") } return commandline_normalize( cmdline ) end |
#wet_run(cmd, *args) ⇒ Object
91 92 93 |
# File 'lib/launchy/detect/runner.rb', line 91 def wet_run( cmd, *args ) system( *all_args( cmd, *args ) ) end |