Ruby 1.8.0 bugs

Can anyone confirm these bugs i’ve noticed in Ruby-1.8.0 on cygwin?

  1. line numbers reported by error messages are too small.

i.e., with the following script:
== begin script, with line numbers ==

(1)| 1+3
(2)| 4+6
(3)|
(4)| 7+5
(5)|
(6)|
(7)| 7+e3r2
== end script ==

i get the following error message:
test.rb:5: undefined local variable or method ‘e3r2’ …

when you have comments in your code, it gets even more confusing.

  1. file reading/writing is inconsistent.
    using puts to write strings to a file gives a file with CR+LF line
    endings, but gets and all other line-reading methods from I/O only
    operate properly with LF line-terminated files. If the file uses
    CR+LF, the first character of the line is read in as part of previous
    line.

am i going mad? i really should’ve stuck with ruby 1.7, but the
temptation to play with new things was too great, and now i’ve got
fox/fxruby extensions installed it will take forever to recompile them
and reinstall them into a 1.7 system.

pleeeeeeeeeeeeeease help.

cheers

james

james@lazyatom.com (James Adam) writes:

Can anyone confirm these bugs i’ve noticed in Ruby-1.8.0 on cygwin?

  1. line numbers reported by error messages are too small.

i.e., with the following script:
== begin script, with line numbers ==

(1)| 1+3
(2)| 4+6
(3)|
(4)| 7+5
(5)|
(6)|
(7)| 7+e3r2
== end script ==

i get the following error message:
test.rb:5: undefined local variable or method ‘e3r2’ …

when you have comments in your code, it gets even more confusing.

What is “e3r2” and why do you think it should not be considered a
local variable or method?

  1. file reading/writing is inconsistent.
    using puts to write strings to a file gives a file with CR+LF line
    endings, but gets and all other line-reading methods from I/O only
    operate properly with LF line-terminated files. If the file uses
    CR+LF, the first character of the line is read in as part of previous
    line.

This sounds like a bug. If you haven’t yet, you might try a nightly
snapshot or build from CVS.

···


matt

Hi,

···

In message “Ruby 1.8.0 bugs” on 03/02/14, James Adam james@lazyatom.com writes:

Can anyone confirm these bugs i’ve noticed in Ruby-1.8.0 on cygwin?

From the discussion on ruby-dev mailing list, it is caused by “text
mode mount” on Cygwin. If you re-mount your directory in “binary
mode”, there’d be no problem.

And Cygwin Ruby maintainers are considering to make Cygwin Ruby to
force binary mode.

						matz.

james@lazyatom.com (James Adam) writes:

Can anyone confirm these bugs i’ve noticed in Ruby-1.8.0 on cygwin?

  1. line numbers reported by error messages are too small.

i.e., with the following script:
== begin script, with line numbers ==

(1)| 1+3
(2)| 4+6
(3)|
(4)| 7+5
(5)|
(6)|
(7)| 7+e3r2
== end script ==

i get the following error message:
test.rb:5: undefined local variable or method ‘e3r2’ …

when you have comments in your code, it gets even more confusing.

What is “e3r2” and why do you think it should not be considered a
local variable or method?

The point was a wrong line number in the error message.

···

On Thursday, Feb 13, 2003, at 22:05 US/Pacific, Matt Armstrong wrote:

  1. file reading/writing is inconsistent.
    using puts to write strings to a file gives a file with CR+LF line
    endings, but gets and all other line-reading methods from I/O only
    operate properly with LF line-terminated files. If the file uses
    CR+LF, the first character of the line is read in as part of previous
    line.

This sounds like a bug. If you haven’t yet, you might try a nightly
snapshot or build from CVS.


matt

matz@ruby-lang.org (Yukihiro Matsumoto) wrote in message news:1045208765.999279.3056.nullmailer@picachu.netlab.jp

Hi,

Can anyone confirm these bugs i’ve noticed in Ruby-1.8.0 on cygwin?

From the discussion on ruby-dev mailing list, it is caused by “text
mode mount” on Cygwin. If you re-mount your directory in “binary
mode”, there’d be no problem.

And Cygwin Ruby maintainers are considering to make Cygwin Ruby to
force binary mode.

  					matz.

actually, i have the directory mounted in binmode and i still get this
behaviour. here is the mount table for my system:

$ mount
C:\Cygwin\bin on /usr/bin type system (binmode)
C:\Cygwin\lib on /usr/lib type system (binmode)
C:\Cygwin on / type system (binmode)
c: on /cygdrive/c type system (binmode)
d: on /cygdrive/d type user (textmode,noumount)

running the following script:
f = File.open(“test.txt”, “w”); f.puts(“line1\nline2\nline3”); f.close

…results in a file with LF only line-endings ir run in ‘/’, but
CR+LF line-endings if run in /cygdrive/c

am i doing this wrong?

···

In message “Ruby 1.8.0 bugs” > on 03/02/14, James Adam james@lazyatom.com writes: