Launchy::Detect::Runner::Windows

Public Instance Methods

all_args( cmd, *args ) click to toggle source
# File lib/launchy/detect/runner.rb, line 72
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 ) click to toggle source
# File lib/launchy/detect/runner.rb, line 78
def dry_run( cmd, *args )
  all_args( cmd, *args ).join(" ")
end
shell_commands( cmd, *args ) click to toggle source

escape the reserved shell characters in windows command shell technet.microsoft.com/en-us/library/cc723564.aspx

# File lib/launchy/detect/runner.rb, line 84
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 ) click to toggle source
# File lib/launchy/detect/runner.rb, line 90
def wet_run( cmd, *args )
  system( *all_args( cmd, *args ) )
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.