Skip to content

Instantly share code, notes, and snippets.

@msassak
Created December 29, 2010 05:51
Show Gist options
  • Save msassak/758228 to your computer and use it in GitHub Desktop.
Save msassak/758228 to your computer and use it in GitHub Desktop.
$ ruby-1.8.7-p302 method_chain.rb
method_chain.rb:2: syntax error, unexpected '.', expecting $end
.gsub(/f/, "")
^
$ ruby-1.9.2-p0 method_chain.rb
OO
puts "foo".gsub(/o/, "O")
.gsub(/f/, "")
@tschmidt
Copy link

I agree, leaving the dot at the end of the previous line feels awkward especially since I'm used to being able to continue the chain on the next line from javascript development. I'm glad to see the new syntax supported in Ruby 1.9.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment