Forum: Ruby on Rails ruby change

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.
Af2ce6689213fdb78913a9662b18da6b?d=identicon&s=25 Rick Lloyd (ricklloyd)
on 2009-04-18 01:18
(Received via mailing list)
I've been running into this problem with gems and plugins recently
when using ruby 1.9.1p0.

A review of syntax.y from ruby 1.8.7 and 1.9.1 shows the grammar rule
for then no longer includes the literal symbol ':'.  This change
causes commonly used idioms for case expressions and loops to fail.
These no longer work:

case
when CONDITION :
 BODY
end

while BOOLEAN :
 BODY
end

until BOOLEAN :
 BODY
end

for NAME in EXPRESSION :
 BODY
end

Am I mistaken?  Is this a feature?

This is the question I asked the Ruby language group (redmine.ruby-
lang.org Bug #1389) which produced this response:

It was an "accidental" feature in the first place. It's been removed
to simplify the new hash literal syntax.

At this point, I've found problems with rubyist-aasm and attachment-
fu.  No extensive search here just trying the plugins/gems I've used.

So, if you're trying to work with ruby 1.9 and you're seeing error
messages that look like:

attachment_fu.rb:106: syntax error, unexpected tIDENTIFIER, expecting
keyword_then or ',' or ';' or '\n'

search out the ':' and replace it with 'then'
This topic is locked and can not be replied to.