On 7/19/06, listrecv / gmail.com <listrecv / gmail.com> wrote:
>
> Sean O'Halpin wrote:
> > Not true. For example, try double-clicking on a .rb file in Explorer -
> > that runs ruby as a console program without going through cmd.exe.
>
> I believe that there is still a cmd.exe running in the background,
> powering it.

Nope. It's spawned directly. Make sure you don't have cmd.exe running,
double-click a .rb file containing just the line
  gets
to make sure it waits for input, check Task Manager and you'll see
that there is no cmd.exe running.

>
> If I'm wrong, is there a way to make a .bat script invoke irb, but skip
> cmd.exe?
>

No - .bat (& .cmd) files are scripts that are interpreted by cmd.exe.
However, you could have an irb.rb file containing this (pinched from
irb.bat):

require "irb"

if __FILE__ == $0
  IRB.start(__FILE__)
else
  # check -e option
  if /^-e$/ =~ $0
    IRB.start(__FILE__)
  else
    IRB.setup(__FILE__)
  end
end

which would bypass cmd.exe. However, command line history seems to be
built into the console these days (i.e. it's nothing to do with
cmd.exe).

Regards,
Sean