[#4567] Re: What's the biggest Ruby development? — Aleksi Niemel<aleksi.niemela@...>

Dave said:

18 messages 2000/08/23
[#4568] Q's on Marshal — Robert Feldt <feldt@...> 2000/08/23

[#4580] RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/25

[#4584] Re: RubyUnit testcase run for different init params? — Dave Thomas <Dave@...> 2000/08/25

Robert Feldt <feldt@ce.chalmers.se> writes:

[#4623] Re: RubyUnit testcase run for different init params? — Robert Feldt <feldt@...> 2000/08/28

On Sat, 26 Aug 2000, Dave Thomas wrote:

[#4652] Andy and Dave's European Tour 2000 — Dave Thomas <Dave@...>

24 messages 2000/08/30
[#4653] Re: Andy and Dave's European Tour 2000 — matz@... (Yukihiro Matsumoto) 2000/08/30

Hi,

[#4657] Ruby tutorials for newbie — Kevin Liang <kevin@...> 2000/08/30

Hi,

[ruby-talk:04341] DRY and embedded docs.

From: Hugh Sasse Staff Elec Eng <hgs@...>
Date: 2000-08-08 10:53:31 UTC
List: ruby-talk #4341
If I have a here document in some ruby program:

print <<"END"
usage #{$0} options arguments

where option is
 -a   (or whatever)
     ....
 -z   ( i.e a whole load of these)
END

How can I get this text into a 
=begin
=end
section so I can have it as documentation, without breaking the
Don't Repeat Yourself rule?

I cannot do

print <<"END"
=begin
usage #{$0}.....
=end
END
because the =begin and =end are no longer considered documentation
by ruby.  They may be by some other program, admittedly, but they
end up in the string created by the here document, which I don't
want.  Clearly one may need to put lines beginning with = in a here
document, so ruby _is_ doing the right thing, but I cannot have the
lines considered to be both a here document and embedded documentation.

Is there a cunning way round this without generating my ruby from
m4 or some such?

	Hugh
	hgs@dmu.ac.uk


In This Thread

Prev Next