Forum: Ruby Help with <<-EOF

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.
Mario R. (Guest)
on 2009-05-11 20:37
Hi,

I have a piece of code like:
xmlData=<<-EOF
  xml code
EOF

I need to change it into:
xmlData="
  xml code
"

but I don't know why... it doesn't work when I change it into a normal
string.

Any idea?
Eleanor McHugh (Guest)
on 2009-05-11 21:02
(Received via mailing list)
On 11 May 2009, at 17:37, Mario R. wrote:
> "
>
> but I don't know why... it doesn't work when I change it into a normal
> string.
>
> Any idea?

Are you escaping all double quotes in the string?
Also, why do you need to make the change?


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
----
raise ArgumentError unless @reality.responds_to? :reason
Mario R. (Guest)
on 2009-05-11 21:19
There are no double quotes...

I need to do it because is a requirement from the client :(
(all string should be assigned by ")

Eleanor McHugh wrote:
> On 11 May 2009, at 17:37, Mario R. wrote:
>> "
Mario R. (Guest)
on 2009-05-11 21:22
Ok... I did it.
I think the problem was a special character at the beginning of the
string.
Thanks for your time.

Mario R. wrote:
> There are no double quotes...
Eleanor McHugh (Guest)
on 2009-05-11 21:26
(Received via mailing list)
On 11 May 2009, at 18:19, Mario R. wrote:
> There are no double quotes...
>
> I need to do it because is a requirement from the client :(
> (all string should be assigned by ")

Well I guess there's no accounting for clients lol


Ellie

Eleanor McHugh
Games With Brains
http://slides.games-with-brains.net
----
raise ArgumentError unless @reality.responds_to? :reason
Robert K. (Guest)
on 2009-05-11 22:35
(Received via mailing list)
On 11.05.2009 19:26, Eleanor McHugh wrote:
> On 11 May 2009, at 18:19, Mario R. wrote:
>> There are no double quotes...
>>
>> I need to do it because is a requirement from the client :(
>> (all string should be assigned by ")
>
> Well I guess there's no accounting for clients lol

I'd be curios to hear the reason for this requirement.

Cheers

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