Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add ERB grammar.

  • Loading branch information...
commit 48fa996de5141d39d2aef1f9a422e3bda6f36177 1 parent f855d76
@infininight infininight authored
View
16 Commands/Check ERB Syntax.plist
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>beforeRunningCommand</key>
@@ -13,15 +13,23 @@ puts result
TextMate.go_to :line =&gt; $1 if result =~ /-:(\d+):/</string>
<key>input</key>
<string>document</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>^V</string>
<key>name</key>
<string>Validate Syntax (ERB)</string>
- <key>output</key>
- <string>showAsTooltip</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>text</string>
+ <key>outputLocation</key>
+ <string>toolTip</string>
<key>scope</key>
- <string>text.html.ruby, text.html source.ruby</string>
+ <string>text.html.erb, text.html source.ruby</string>
<key>uuid</key>
<string>76FCF165-54CB-4213-BC55-BD60B9C6A3EC</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
14 Commands/Toggle ERb Tags.tmCommand
@@ -45,15 +45,23 @@ print result</string>
<string>scope</string>
<key>input</key>
<string>selection</string>
+ <key>inputFormat</key>
+ <string>text</string>
<key>keyEquivalent</key>
<string>^&gt;</string>
<key>name</key>
<string>Toggle ERb Tags</string>
- <key>output</key>
- <string>insertAsSnippet</string>
+ <key>outputCaret</key>
+ <string>afterOutput</string>
+ <key>outputFormat</key>
+ <string>snippet</string>
+ <key>outputLocation</key>
+ <string>replaceInput</string>
<key>scope</key>
- <string>source.ruby.embedded, source.ruby.rails.embedded, comment.block.erb, meta.erb</string>
+ <string>meta.embedded.block.erb, meta.embedded.line.erb, comment.block.erb</string>
<key>uuid</key>
<string>835FAAC6-5431-436C-998B-241F7226B99B</string>
+ <key>version</key>
+ <integer>2</integer>
</dict>
</plist>
View
2  Snippets/Insert ERb's <% __ %> or <%= __ %>.tmSnippet
@@ -9,7 +9,7 @@
<key>name</key>
<string>Insert ERb’s &lt;% .. %&gt; or &lt;%= .. %&gt;</string>
<key>scope</key>
- <string>text.html, source.yaml, meta.erb</string>
+ <string>text.html.erb, source.yaml</string>
<key>uuid</key>
<string>FDFABCB9-DF58-4469-AE11-5407A4FF4D70</string>
</dict>
View
243 Syntaxes/HTML (Ruby - ERB).tmLanguage
@@ -0,0 +1,243 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+<dict>
+ <key>fileTypes</key>
+ <array>
+ <string>erb</string>
+ <string>rhtml</string>
+ <string>html.erb</string>
+ </array>
+ <key>injections</key>
+ <dict>
+ <key>text.html.erb - (meta.embedded.block.erb | meta.embedded.line.erb | meta.tag | comment), meta.tag string.quoted</key>
+ <dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>(^\s*)(?=&lt;%+#(?![^%]*%&gt;))</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.whitespace.comment.leading.erb</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(?!\G)(\s*$\n)?</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.whitespace.comment.trailing.erb</string>
+ </dict>
+ </dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#comment</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>(^\s*)(?=&lt;%(?![^%]*%&gt;))</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.whitespace.embedded.leading.erb</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>(?!\G)(\s*$\n)?</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.whitespace.embedded.trailing.erb</string>
+ </dict>
+ </dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>#tags</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#comment</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>#tags</string>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>HTML (Ruby - ERB)</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>include</key>
+ <string>text.html.basic</string>
+ </dict>
+ </array>
+ <key>repository</key>
+ <dict>
+ <key>comment</key>
+ <dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>&lt;%+#</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.begin.erb</string>
+ </dict>
+ </dict>
+ <key>end</key>
+ <string>%&gt;</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.end.erb</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>comment.block.erb</string>
+ </dict>
+ </array>
+ </dict>
+ <key>tags</key>
+ <dict>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>begin</key>
+ <string>&lt;%+(?!&gt;)=?(?![^%]*%&gt;)</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.embedded.begin.erb</string>
+ </dict>
+ </dict>
+ <key>contentName</key>
+ <string>source.ruby</string>
+ <key>end</key>
+ <string>(-?%)&gt;</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.embedded.end.erb</string>
+ </dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>source.ruby</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.embedded.block.erb</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.erb</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>(#).*?(?=-?%&gt;)</string>
+ <key>name</key>
+ <string>comment.line.number-sign.erb</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>source.ruby</string>
+ </dict>
+ </array>
+ </dict>
+ <dict>
+ <key>begin</key>
+ <string>&lt;%+(?!&gt;)=?</string>
+ <key>beginCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.embedded.begin.erb</string>
+ </dict>
+ </dict>
+ <key>contentName</key>
+ <string>source.ruby</string>
+ <key>end</key>
+ <string>(-?%)&gt;</string>
+ <key>endCaptures</key>
+ <dict>
+ <key>0</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.section.embedded.end.erb</string>
+ </dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>source.ruby</string>
+ </dict>
+ </dict>
+ <key>name</key>
+ <string>meta.embedded.line.erb</string>
+ <key>patterns</key>
+ <array>
+ <dict>
+ <key>captures</key>
+ <dict>
+ <key>1</key>
+ <dict>
+ <key>name</key>
+ <string>punctuation.definition.comment.erb</string>
+ </dict>
+ </dict>
+ <key>match</key>
+ <string>(#).*?(?=-?%&gt;)</string>
+ <key>name</key>
+ <string>comment.line.number-sign.erb</string>
+ </dict>
+ <dict>
+ <key>include</key>
+ <string>source.ruby</string>
+ </dict>
+ </array>
+ </dict>
+ </array>
+ </dict>
+ </dict>
+ <key>scopeName</key>
+ <string>text.html.erb</string>
+ <key>uuid</key>
+ <string>13FF9439-15D0-4E74-9A8E-83ABF0BAA5E7</string>
+</dict>
+</plist>
Please sign in to comment.
Something went wrong with that request. Please try again.