Forum: Ruby Carriage Return added during return of large string from cla

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
19a9e4d07410618284db6a44de12e079?d=identicon&s=25 Xeno Campanoli (Guest)
on 2006-02-13 21:39
(Received via mailing list)
Say, this is a doosey:  I'm constructing a string of markup for a CGI
script,
and I'm deciding to convert to print as I go rather than all at once, so
I
code, then start debugging, and to debug I dump markup.  I then find
that
markup that looks good and clean just before I return from my class
function
(called by another class function if that's important) ends up having
sections
polluted with carriage returns (not all of it, just those newlines which
precede each line of one of the three concatenated strings from the
three
files which I uploaded from my primary files (javascript code).  So I
get
all these files loaded, strings concatenated, and right before I return
them
from my old function I dump them and they look fine.  Right after they
get
returned from the old function to the new one, this one section has CRs.
What
gives?  Were they there all along and suddenly only appear from some
magic?
How could it otherwise be that the function, in it's wild and unexpected
massage of my markup, is guessing well enough to precede only those
lines
which correspond to one of my files?

The code is non-trivial, and I cannot afford to pull it apart right now.
I'll
try to make the time tonight.  Presumably this is something you gurus
know all
about.

xc
This topic is locked and can not be replied to.