Ruby 1.8.4 RC1 for Windows debugger problem?

Discussion in 'Ruby' started by john peter, Apr 4, 2006.

  1. john peter

    john peter Guest

    --0-1557245214-1144175744=:88230
    Content-Type: text/plain; charset=iso-8859-1
    Content-Transfer-Encoding: quoted-printable

    i'm trying out my first ruby debugging session from a DOS prompt, but am =
    running into a weird problem as shown below. anyone knows what's happenin=
    g?
    i can't list my program (ptest.rb) from inside the debug session; also, i=
    don't
    know why i'm getting the rubygem thingy since my program consists of
    plain ruby code:

    C:\rubyquizzes>ruby -r debug ptest.rb
    Debug.rb
    Emacs support available.

    c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb:4:require 'rubygems'
    (rdb:1) list 1-7
    [1, 7] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb
    1 # This file allows for the running of rubygems with a nice
    2 # command line look-and-feel: ruby -rubygems foo.rb
    3
    =3D> 4 require 'rubygems'
    (rdb:1) list 1-12
    [1, 12] in c:/ruby/lib/ruby/site_ruby/1.8/ubygems.rb
    1 # This file allows for the running of rubygems with a nice
    2 # command line look-and-feel: ruby -rubygems foo.rb
    3
    =3D> 4 require 'rubygems'
    (rdb:1) c
    With braces, result =3D block given to 'two' returns three
    With do/end, result =3D block given to 'one' returns three

    ----- ptest.rb -----
    def one(arg)
    if block_given?
    "block given to 'one' returns #{yield}"
    else
    arg
    end
    end

    def two
    if block_given?
    "block given to 'two' returns #{yield}"
    end
    end

    result1 =3D one two {
    "three"
    } =20

    result2 =3D one two do
    "three"
    end

    puts "With braces, result =3D #{result1}"
    puts "With do/end, result =3D #{result2}"

    =09
    ---------------------------------
    New Yahoo! Messenger with Voice. Call regular phones from your PC and sav=
    e big.
    --0-1557245214-1144175744=:88230--
    john peter, Apr 4, 2006
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Olivier MATROT
    Replies:
    3
    Views:
    875
    Olivier MATROT
    Jan 23, 2008
  2. john peter
    Replies:
    0
    Views:
    78
    john peter
    Apr 4, 2006
  3. Huw Collingbourne

    [ANN] Ruby In Steel Personal Edition RC1

    Huw Collingbourne, Jan 2, 2007, in forum: Ruby
    Replies:
    0
    Views:
    84
    Huw Collingbourne
    Jan 2, 2007
  4. mdiam
    Replies:
    6
    Views:
    143
    Hidetoshi NAGAI
    Jan 12, 2009
  5. Jian Lin
    Replies:
    1
    Views:
    122
    Luis Lavena
    Dec 9, 2009
Loading...

Share This Page