Forum: Ruby Comment for partial line

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.
Xia _. (Guest)
on 2007-02-07 02:09
Hi

Can someone confirm that Ruby only allows #tail of line commenting and
=begin
this
whole
block
commenting
=end


and not <some comment syntax here>partial line <end comment
syntax>commenting?

and if so, i request this be changed! its really annoying not being able
to do a partial line comment in rhtml

thanks
Jeremy McAnally (Guest)
on 2007-02-07 03:14
(Received via mailing list)
You can do HTML comments in RHTML you know. ;)

--Jeremy

On 2/6/07, Xia __ <removed_email_address@domain.invalid> wrote:
>
>
>


--
http://www.jeremymcanally.com/

My free Ruby e-book:
http://www.humblelittlerubybook.com/book/

My blogs:
http://www.mrneighborly.com/
http://www.rubyinpractice.com/
Michael F. (Guest)
on 2007-02-07 03:28
(Received via mailing list)
Either, <!-- this commet style -->
or...

<% do_stuff; "comment on it"; do_more; "more comments" %>

but please, if you need to document a template... move that stuff into
the controller...
Xia _. (Guest)
on 2007-02-07 03:55
its more for bug tracking; to be able to remove functionality
temporarily to see what is broken, so more like

<% do_stuff; /* HIDE THE FOLLOWING FROM RUBY  do_more; */ %>
Marcello B. (Guest)
on 2007-02-07 04:46
(Received via mailing list)
On Wednesday 07 February 2007 02:55, Xia __ wrote:
> its more for bug tracking; to be able to remove functionality
> temporarily to see what is broken, so more like
>
> <% do_stuff; /* HIDE THE FOLLOWING FROM RUBY  do_more; */ %>

that means that perhaps you have way too much logic in your template,
and you
should better move that logic into the controller. it isn't just a
matter of
taste, it's a matter of good design :).

HTH
Xia _. (Guest)
on 2007-02-07 04:49
too much logic being a rails form helper?
Xia _. (Guest)
on 2007-02-07 04:50
i dont want to turn this thread into a debate about programming design,
i just want to know if ruby offers a fairly simple syntax function which
is available in many languages.
Michael F. (Guest)
on 2007-02-07 05:15
(Received via mailing list)
On 2/7/07, Xia __ <removed_email_address@domain.invalid> wrote:
> i dont want to turn this thread into a debate about programming design,
> i just want to know if ruby offers a fairly simple syntax function which
> is available in many languages.

no.
Xia _. (Guest)
on 2007-02-07 05:38
Michael F. wrote:
> On 2/7/07, Xia __ <removed_email_address@domain.invalid> wrote:
>> i dont want to turn this thread into a debate about programming design,
>> i just want to know if ruby offers a fairly simple syntax function which
>> is available in many languages.
>
> no.

cool thanks michael.

i think there may be some argument for it to be supported in the case of
erb in rhtml; mostly due to common html markup style which is different
to ruby due to line spacing and inline elements in html
Daniel -. (Guest)
on 2007-02-07 05:42
(Received via mailing list)
On 2/7/07, Xia __ <removed_email_address@domain.invalid> wrote:
> cool thanks michael.
>
> i think there may be some argument for it to be supported in the case of
> erb in rhtml; mostly due to common html markup style which is different
> to ruby due to line spacing and inline elements in html
>
> -


So you are really after a debate then ;)
Xia _. (Guest)
on 2007-02-07 05:44
no comment...
Peña, Botp (Guest)
on 2007-02-07 05:59
(Received via mailing list)
On Behalf Of Xia __:
# i dont want to turn this thread into a debate about
# programming design,
# i just want to know if ruby offers a fairly simple syntax
# function which is available in many languages.


the ff is just a kludge. i enclose them text inside single quotes, or %<
>, or %<-- -->

irb(main):041:0> print "Hello, "; 'this wont run; puts "NO!"'; print
"world\n"
Hello, world
=> nil
irb(main):042:0> print "Hello, "; %<this wont run; puts "NO!">; print
"world\n"
Hello, world
=> nil
irb(main):046:0> print "Hello, "; %<--NONONO!-->; print "world.\n"
Hello, world.
=> nil

Hey, about an rcr, use "--" or "++" as inline commenters :))

But sincerely, i have a phobia of inline comments. I once had a bug that
took me a day (24hrs) to find because of a very slick inline comment i
inserted... arrghh.. but that was then. Now, unit test/tdd/bdd/rspec/ioc
rocks. no fear :)

kind regards -botp
Alex Y. (Guest)
on 2007-02-07 11:21
(Received via mailing list)
Xia __ wrote:
> no comment...
>
>
I thought that was the problem?  :-)
This topic is locked and can not be replied to.