On Mon, 14 Aug 2006 14:05:11 +0000, Jeffrey Schwab wrote:

> newyorkdolluk wrote:
> 
>> can anyone tell me how to bulk comment-out lines of code rather than
>> #'ing each line?
> 
> I don't think there's a multi-line comment character, although I'm sure 
> someone on this list will come up with a neat hack.  At the very least, 
> you could embed the code in a string:
> 
> def begin_comment(s)
>      # Ignore it.  It's a comment.
> end
> 
> begin_comment <<end_comment  # Comment until end of comment.
>      This is a string that's actually serving
>      as a multi-line comment.
> end_comment
> 
> If you're using vim, though:
> 
> Go to the beginning of the first line to be commented.
> Hit ^V to begin block selection.
> Use j to get down to the last line to be commented.
> Enter capital I to begin inserting.
> Enter #, since it's the Ruby comment character.
> Hit Esc.

If you're going to take this approach (and =begin =end is probably better)
then there's no need to define a method. simply use a heredoc that won't
get used:

<<end_comment
The comment started with the previous line

and ends when the heredoc ends
end_comment

Of course, this won't work correctly as the last line in a method, so use
(=begin...=end) as other posters have described.

--Ken

-- 
Ken Bloom. PhD candidate. Linguistic Cognition Laboratory.
Department of Computer Science. Illinois Institute of Technology.
http://www.iit.edu/~kbloom1/