ri/YAML/Windows Problem

A

Austin Ziegler

Attn Curt Hibbs, Dave Thomas, and _why the lucky stiff:

There is a display problem with ri on Windows, and it's related to
YAML. There is a workaround available, but something needs to be
fixed somewhere -- and I don't really have time to track down which
part is actually causing problems.

Problem:
c:\Apps\Ruby\share\ri\1.8\site\Class>ri Class#superclass
------------------------------------------------------- Class#superclass
class.superclass -> a_super_class or nil
------------------------------------------------------------------------
Returns the superclass of _class_, or +nil+.

File.superclass #=> IO

IO.superclass #=> Object

Object.superclass #=> nil

share/ri/Class/superclass-i.yaml is in DOS line-ending format. When I
edit this file and save with Unix line-ending format, I get:

------------------------------------------------------- Class#superclass
class.superclass -> a_super_class or nil
------------------------------------------------------------------------
Returns the superclass of _class_, or +nil+.

File.superclass #=> IO
IO.superclass #=> Object
Object.superclass #=> nil

Big difference. This is especially important on longer descriptions
(e.g., Class itself -- which includes the class model diagram). What
can be done?

1) The Windows Installer team can work around this by doing a dos2unix
on all ri documents after compiling but before packaging.
2) The rdoc/ri generation phase should probably open the output files
as "wb", not just "w". The "b" has no useful meaning on Unix, but it
will force the documents to be written as received (e.g., no newline
translation). (ri_writer.rb lines 36, 51, others perhaps?).
3) The rdoc/ri read phase should probably open the files "rb" -- but
I'm not sure that is useful or necessary; one would think that opening
the file as "r" would do the reverse line ending translation, but it
obviously doesn't.
4) YAML::load needs to be able to detect documents that use CRLF line
endings and *not* treat them as badly as it does.

Can we get this fixed ASAP?

-austin
 
W

why the lucky stiff

Austin said:
There is a display problem with ri on Windows, and it's related to
YAML. There is a workaround available, but something needs to be
fixed somewhere -- and I don't really have time to track down which
part is actually causing problems.
Exactly which version of Ruby are you using? Within the past few weeks,
I wrote new code to handle the double-edged CR-LF combo attack. I don't
think you'll find this code in 1.8.2-preview2. Someone, somebody out
there, some wonderful crazy daring beautiful little moron needs to try
with Ruby CVS on Windows. I'm not sure who. I wish Walker Texas Ranger
was here. Help.

_why
 
A

Austin Ziegler

Exactly which version of Ruby are you using? Within the past few weeks,
I wrote new code to handle the double-edged CR-LF combo attack. I don't
think you'll find this code in 1.8.2-preview2. Someone, somebody out
there, some wonderful crazy daring beautiful little moron needs to try
with Ruby CVS on Windows. I'm not sure who. I wish Walker Texas Ranger
was here. Help.

I'm using 1.8.2-preview2. I'm in the middle of trying to get a new
version of Ruwiki out (0.8.1), so I don't have time to play with a CVS
build (even though I now have the capability to do so).

-austin
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,818
Latest member
Brigette36

Latest Threads

Top