are there different sensitivities/settings to whitespace in ruby?
i have a RoR project, where an active record call has a lot of components:
max_stuff = FooSummary.select("max(stuff) as stuff")
.joins(:foo => :bar)
.where("user_id = ? and record_date < ?", r.user_id, r.record_date)
.group("user_id")
.first
1.9.3 works fine with this on my mac, but on the ubuntu server it runs on, it complains about the fact that .joins is on a separate line (unexpected . expecting kEND)
what gives?
Move the period to the preceding line. If parsing line-by-line,
looks like a full statement, and the next line, taken separately, is a syntax error:
However, this can’t be a statement:
and the parser knows it has to append the next line as well:
(which gives the same parse as
foo = bar.baz, as expected).