Index: Ruby.tmbundle/Syntaxes/Ruby.plist
===================================================================
--- Ruby.tmbundle/Syntaxes/Ruby.plist	(revision 11315)
+++ Ruby.tmbundle/Syntaxes/Ruby.plist	(working copy)
@@ -1674,7 +1674,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?!\s+#\s*([Cc]|sh|[Jj]ava))</string>
+			<string>(?&gt;&lt;&lt;-?HTML\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1683,8 +1683,12 @@
 					<string>punctuation.definition.string.begin.ruby</string>
 				</dict>
 			</dict>
+			<key>comment</key>
+			<string>heredoc with embedded HTML and indented terminator</string>
+			<key>contentName</key>
+			<string>text.html.embedded.ruby</string>
 			<key>end</key>
-			<string>^\1$</string>
+			<string>\s*HTML$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1694,7 +1698,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.heredoc.ruby</string>
+			<string>string.unquoted.embedded.html.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1703,6 +1707,10 @@
 				</dict>
 				<dict>
 					<key>include</key>
+					<string>text.html.basic</string>
+				</dict>
+				<dict>
+					<key>include</key>
 					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>
@@ -1713,7 +1721,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;&lt;&lt;-HTML\b)</string>
+			<string>(?&gt;&lt;&lt;-SQL\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1723,11 +1731,11 @@
 				</dict>
 			</dict>
 			<key>comment</key>
-			<string>heredoc with embedded HTML and indented terminator</string>
+			<string>heredoc with embedded SQL and indented terminator</string>
 			<key>contentName</key>
-			<string>text.html.embedded.ruby</string>
+			<string>text.sql.embedded.ruby</string>
 			<key>end</key>
-			<string>\s*HTML$</string>
+			<string>\s*SQL$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1737,7 +1745,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.html.ruby</string>
+			<string>string.unquoted.embedded.sql.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1746,7 +1754,7 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>text.html.basic</string>
+					<string>source.sql</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -1760,7 +1768,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;&lt;&lt;-SQL\b)</string>
+			<string>(?&gt;&lt;&lt;-C\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1770,11 +1778,11 @@
 				</dict>
 			</dict>
 			<key>comment</key>
-			<string>heredoc with embedded SQL and indented terminator</string>
+			<string>heredoc with embedded c and intented terminator</string>
 			<key>contentName</key>
-			<string>text.sql.embedded.ruby</string>
+			<string>text.c.embedded.ruby</string>
 			<key>end</key>
-			<string>\s*SQL$</string>
+			<string>\s*C$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1784,7 +1792,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.sql.ruby</string>
+			<string>string.unquoted.embedded.c.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1793,7 +1801,7 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.sql</string>
+					<string>source.c</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -1807,7 +1815,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;&lt;&lt;-(["\\']?)(\w+_(?i:eval))\1)</string>
+			<string>(?&gt;&lt;&lt;-CSS\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1817,9 +1825,11 @@
 				</dict>
 			</dict>
 			<key>comment</key>
-			<string>ruby code in heredoc, interpolated</string>
+			<string>heredoc with embedded css and intented terminator</string>
+			<key>contentName</key>
+			<string>text.css.embedded.ruby</string>
 			<key>end</key>
-			<string>\s*\2$</string>
+			<string>\s*CSS$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1829,7 +1839,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.ruby.ruby</string>
+			<string>string.unquoted.embedded.css.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1838,11 +1848,11 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>#interpolated_ruby</string>
+					<string>source.css</string>
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.ruby</string>
+					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -1852,7 +1862,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;&lt;&lt;-(\w+))</string>
+			<string>(?&gt;&lt;&lt;-CPP\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1862,9 +1872,11 @@
 				</dict>
 			</dict>
 			<key>comment</key>
-			<string>heredoc with indented terminator</string>
+			<string>heredoc with embedded c++ and intented terminator</string>
+			<key>contentName</key>
+			<string>text.c++.embedded.ruby</string>
 			<key>end</key>
-			<string>\s*\1$</string>
+			<string>\s*CPP$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1874,7 +1886,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.heredoc.ruby</string>
+			<string>string.unquoted.embedded.cplusplus.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1883,6 +1895,10 @@
 				</dict>
 				<dict>
 					<key>include</key>
+					<string>source.c++</string>
+				</dict>
+				<dict>
+					<key>include</key>
 					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>
@@ -1893,7 +1909,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?=\s+#\s*[Cc](?!(\+\+|[Ss][Ss])))</string>
+			<string>(?&gt;&lt;&lt;-(JS|JAVASCRIPT)\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1902,8 +1918,12 @@
 					<string>punctuation.definition.string.begin.ruby</string>
 				</dict>
 			</dict>
+			<key>comment</key>
+			<string>heredoc with embedded javascript and intented terminator</string>
+			<key>contentName</key>
+			<string>text.js.embedded.ruby</string>
 			<key>end</key>
-			<string>^\1$</string>
+			<string>\s*\1$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1913,7 +1933,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.c.ruby</string>
+			<string>string.unquoted.embedded.js.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1922,7 +1942,7 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.c</string>
+					<string>source.js</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -1936,7 +1956,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?=\s+#\s*[Cc]\+\+)</string>
+			<string>(?&gt;&lt;&lt;-(SH|SHELL)\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1945,8 +1965,12 @@
 					<string>punctuation.definition.string.begin.ruby</string>
 				</dict>
 			</dict>
+			<key>comment</key>
+			<string>heredoc with embedded shell and intented terminator</string>
+			<key>contentName</key>
+			<string>text.shell.embedded.ruby</string>
 			<key>end</key>
-			<string>^\1$</string>
+			<string>\s*\1$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1956,7 +1980,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.cplusplus.ruby</string>
+			<string>string.unquoted.embedded.shell.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -1965,7 +1989,7 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.c++</string>
+					<string>source.shell</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -1979,7 +2003,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?=\s+#\s*[Cc][Ss][Ss])</string>
+			<string>(?&gt;&lt;&lt;-RUBY\b)</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1988,8 +2012,12 @@
 					<string>punctuation.definition.string.begin.ruby</string>
 				</dict>
 			</dict>
+			<key>comment</key>
+			<string>heredoc with embedded ruby and intented terminator</string>
+			<key>contentName</key>
+			<string>text.ruby.embedded.ruby</string>
 			<key>end</key>
-			<string>^\1$</string>
+			<string>\s*RUBY$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -1999,7 +2027,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.css.ruby</string>
+			<string>string.unquoted.embedded.ruby.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -2008,7 +2036,7 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.css</string>
+					<string>source.ruby</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -2022,7 +2050,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?=\s+#\s*[Jj]ava[Ss]cript)</string>
+			<string>(?&gt;\b(?:module_|class_)?eval\s+&lt;&lt;-(\w+))</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -2031,8 +2059,12 @@
 					<string>punctuation.definition.string.begin.ruby</string>
 				</dict>
 			</dict>
+			<key>comment</key>
+			<string>ruby code in heredoc, when heredoc seems to be an argument to an eval call</string>
+			<key>contentName</key>
+			<string>text.ruby.embedded.ruby</string>
 			<key>end</key>
-			<string>^\1$</string>
+			<string>\s*\1$</string>
 			<key>endCaptures</key>
 			<dict>
 				<key>0</key>
@@ -2042,7 +2074,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.js.ruby</string>
+			<string>string.unquoted.embedded.ruby.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -2051,11 +2083,11 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.js</string>
+					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>#interpolated_ruby</string>
+					<string>source.ruby</string>
 				</dict>
 				<dict>
 					<key>include</key>
@@ -2065,7 +2097,7 @@
 		</dict>
 		<dict>
 			<key>begin</key>
-			<string>(?&gt;\=\s*&lt;&lt;(\w+))(?=\s+#\s*sh)</string>
+			<string>(?&gt;\=\s*&lt;&lt;(\w+))</string>
 			<key>beginCaptures</key>
 			<dict>
 				<key>0</key>
@@ -2085,7 +2117,7 @@
 				</dict>
 			</dict>
 			<key>name</key>
-			<string>string.unquoted.embedded.shell.ruby</string>
+			<string>string.unquoted.heredoc.ruby</string>
 			<key>patterns</key>
 			<array>
 				<dict>
@@ -2094,10 +2126,47 @@
 				</dict>
 				<dict>
 					<key>include</key>
-					<string>source.shell</string>
+					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>
 					<key>include</key>
+					<string>#escaped_char</string>
+				</dict>
+			</array>
+		</dict>
+		<dict>
+			<key>begin</key>
+			<string>(?&gt;&lt;&lt;-(\w+))</string>
+			<key>beginCaptures</key>
+			<dict>
+				<key>0</key>
+				<dict>
+					<key>name</key>
+					<string>punctuation.definition.string.begin.ruby</string>
+				</dict>
+			</dict>
+			<key>comment</key>
+			<string>heredoc with indented terminator</string>
+			<key>end</key>
+			<string>\s*\1$</string>
+			<key>endCaptures</key>
+			<dict>
+				<key>0</key>
+				<dict>
+					<key>name</key>
+					<string>punctuation.definition.string.end.ruby</string>
+				</dict>
+			</dict>
+			<key>name</key>
+			<string>string.unquoted.heredoc.ruby</string>
+			<key>patterns</key>
+			<array>
+				<dict>
+					<key>include</key>
+					<string>#heredoc</string>
+				</dict>
+				<dict>
+					<key>include</key>
 					<string>#interpolated_ruby</string>
 				</dict>
 				<dict>