mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-09-21 16:08:24 +03:00
Add bundles for coffeeScript and ruby
This commit is contained in:
parent
627a75b9c6
commit
1d70e2e85b
1
bundles/CoffeeScriptBundle.tmbundle/.gitignore
vendored
Normal file
1
bundles/CoffeeScriptBundle.tmbundle/.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
*.cache
|
@ -0,0 +1,159 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
#
|
||||
# Based on (from Source.tmbundle):
|
||||
#
|
||||
# Assignment block tidier, version 0.1.
|
||||
#
|
||||
# Copyright Chris Poirier 2006.
|
||||
# Licensed under the Academic Free License version 3.0.
|
||||
#
|
||||
# This script can be used as a command for TextMate to align all
|
||||
# of the assignment signs within a block of text. When using it with
|
||||
# TextMate, set the command input to "Selected Text" or "Document",
|
||||
# and the output to "Replace Selected Text". Map it to a key
|
||||
# equivalent, and any time you want to tidy up a block, either
|
||||
# select it, or put your cursor somewhere within it; then hit the
|
||||
# key equivalent. Voila.
|
||||
#
|
||||
# Note that this is the first version of the script, and it hasn't
|
||||
# been heavily tested. You might encounter a bug or two.
|
||||
#
|
||||
# Note (by Dr Nic) - the "first version" seems to have worked for years.
|
||||
# I hope the CoffeeScript version is as successful.
|
||||
#
|
||||
# Per the license, use of this script is ENTIRELY at your own risk.
|
||||
# See the license for full details (they override anything I've
|
||||
# said here).
|
||||
|
||||
lines = STDIN.readlines()
|
||||
selected_text = ENV.member?("TM_SELECTED_TEXT")
|
||||
|
||||
relevant_line_pattern = /^[^:]+:/
|
||||
column_search_pattern = /[\t ]*:/
|
||||
|
||||
comments = []
|
||||
|
||||
begin
|
||||
#
|
||||
# If called on a selection, every assignment statement
|
||||
# is in the block. If called on the document, we start on the
|
||||
# current line and look up and down for the start and end of the
|
||||
# block.
|
||||
|
||||
if selected_text then
|
||||
block_top = 1
|
||||
block_bottom = lines.length
|
||||
else
|
||||
|
||||
#
|
||||
# We start looking on the current line. However, if the
|
||||
# current line doesn't match the pattern, we may be just
|
||||
# after or just before a block, and we should check. If
|
||||
# neither, we are done.
|
||||
|
||||
start_on = ENV["TM_LINE_NUMBER"].to_i
|
||||
block_top = lines.length + 1
|
||||
block_bottom = 0
|
||||
search_top = 1
|
||||
search_bottom = lines.length
|
||||
search_failed = false
|
||||
|
||||
if lines[start_on - 1] !~ relevant_line_pattern then
|
||||
if lines[start_on - 2] =~ relevant_line_pattern then
|
||||
search_bottom = start_on = start_on - 1
|
||||
elsif lines[start_on] =~ relevant_line_pattern then
|
||||
search_top = start_on = start_on
|
||||
else
|
||||
search_failed = true
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Now with the search boundaries set, start looking for
|
||||
# the block top and bottom.
|
||||
|
||||
unless search_failed
|
||||
start_on.downto(search_top) do |number|
|
||||
if lines[number-1] =~ relevant_line_pattern then
|
||||
block_top = number
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
|
||||
start_on.upto(search_bottom) do |number|
|
||||
if lines[number-1] =~ relevant_line_pattern then
|
||||
block_bottom = number
|
||||
else
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
#
|
||||
# Now, iterate over the block and find the best column number
|
||||
# for the = sign. The pattern will tell us the position of the
|
||||
# first bit of whitespace before the equal sign. We put the
|
||||
# equals sign to the right of the furthest-right one. Note that
|
||||
# we cannot assume every line in the block is relevant.
|
||||
|
||||
best_column = 0
|
||||
block_top.upto(block_bottom) do |number|
|
||||
line = lines[number - 1]
|
||||
if line =~ relevant_line_pattern then
|
||||
m = column_search_pattern.match(line)
|
||||
best_column = m.begin(0) if m.begin(0) > best_column
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
#
|
||||
# Reformat the block. Again, we cannot assume all lines in the
|
||||
# block are relevant.
|
||||
|
||||
block_top.upto(block_bottom) do |number|
|
||||
if lines[number-1] =~ relevant_line_pattern then
|
||||
before, after = lines[number-1].split(/[\t ]*:[\t ]*/, 2)
|
||||
# lines[number-1] = [before.ljust(best_column), after].join(after[0,1] == '>' ? ":" : ": ")
|
||||
lines[number-1] = ["#{before}:".ljust(best_column + 2), after].join
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
rescue => e
|
||||
comments << "Error: #{e.inspect}"
|
||||
comments << e.backtrace
|
||||
end
|
||||
|
||||
#
|
||||
# Output the replacement text
|
||||
|
||||
lines.each do |line|
|
||||
puts line
|
||||
end
|
||||
|
||||
comments.flatten.each { |c| puts "# #{c}" }
|
||||
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>~@]</string>
|
||||
<key>name</key>
|
||||
<string>Align Assignments</string>
|
||||
<key>output</key>
|
||||
<string>replaceSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>EE3293A5-3761-40BD-9CA8-DAAA176AA19E</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,6 @@
|
||||
{
|
||||
"path": "$HOME/bin:/usr/local/bin:$PATH",
|
||||
"cmd": ["coffee","-c","$file"],
|
||||
"file_regex": "^(...*?):([0-9]*):?([0-9]*)",
|
||||
"selector": "source.coffee"
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/bin/bash
|
||||
|
||||
function pre {
|
||||
echo -n '<pre style="word-wrap: break-word;">'
|
||||
perl -pe '$| = 1; s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/$\\n/<br>/'
|
||||
echo '</pre>'
|
||||
}
|
||||
|
||||
${TM_COFFEE:=coffee} -scp --bare | pre
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>document</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@b</string>
|
||||
<key>name</key>
|
||||
<string>Compile and Display JS</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>D749F761-1740-4918-9490-90DF376BA72E</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,34 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
column_number = ENV['TM_COLUMN_NUMBER']
|
||||
whitespace = " " * (column_number.to_i - 1)
|
||||
|
||||
print <<-EOS
|
||||
###
|
||||
#{whitespace}$0
|
||||
#{whitespace}###
|
||||
EOS
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^#</string>
|
||||
<key>name</key>
|
||||
<string>Insert Heredoc """ comment</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>68A86250-0280-11E0-A976-0800200C9A66</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,34 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
column_number = ENV['TM_COLUMN_NUMBER']
|
||||
whitespace = " " * (column_number.to_i - 1)
|
||||
|
||||
print <<-EOS
|
||||
"""
|
||||
#{whitespace}$0
|
||||
#{whitespace}"""
|
||||
EOS
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@"</string>
|
||||
<key>name</key>
|
||||
<string>Insert Heredoc """ quotes</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>F08537AF-4F02-4040-999D-F0785CF64C02</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,34 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
column_number = ENV['TM_COLUMN_NUMBER']
|
||||
whitespace = " " * (column_number.to_i - 1)
|
||||
|
||||
print <<-EOS
|
||||
'''
|
||||
#{whitespace}$0
|
||||
#{whitespace}'''
|
||||
EOS
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@'</string>
|
||||
<key>name</key>
|
||||
<string>Insert Heredoc ''' quotes</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>C4F99E3D-1540-4BC1-8038-0A19D65BABC8</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,27 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>cat <<SNIPPET
|
||||
${TM_SELECTED_TEXT:-$TM_CURRENT_WORD} = (\${1:args}) ->
|
||||
\$0
|
||||
SNIPPET</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>$
</string>
|
||||
<key>name</key>
|
||||
<string>New Function</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>192428A1-8684-4172-8728-225B4C9E532F</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,25 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/bin/bash
|
||||
|
||||
${TM_COFFEE:=coffee} -s
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@R</string>
|
||||
<key>name</key>
|
||||
<string>Run selected text</string>
|
||||
<key>output</key>
|
||||
<string>showAsTooltip</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>90424631-D00B-448C-B157-DAC92DFB2858</string>
|
||||
</dict>
|
||||
</plist>
|
32
bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand
Normal file
32
bundles/CoffeeScriptBundle.tmbundle/Commands/Run.tmCommand
Normal file
@ -0,0 +1,32 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/bin/bash
|
||||
|
||||
function pre {
|
||||
echo -n '<pre style="word-wrap: break-word;">'
|
||||
perl -pe '$| = 1; s/&/&amp;/g; s/</&lt;/g; s/>/&gt;/g; s/$\\n/<br>/'
|
||||
echo '</pre>'
|
||||
}
|
||||
|
||||
|
||||
${TM_COFFEE:=coffee} -s | pre
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@r</string>
|
||||
<key>name</key>
|
||||
<string>Run</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>30395DAB-44A6-44F7-99E1-02D64621303A</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,36 @@
|
||||
<?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>name</key>
|
||||
<string>Comments</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>shellVariables</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START</string>
|
||||
<key>value</key>
|
||||
<string># </string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START_2</string>
|
||||
<key>value</key>
|
||||
<string>###</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_END_2</string>
|
||||
<key>value</key>
|
||||
<string>###</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>0A92C6F6-4D73-4859-B38C-4CC19CBC191F</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>name</key>
|
||||
<string>Disable Indent Corrections</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>disableIndentCorrections</key>
|
||||
<true/>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>5E57C0C3-77D5-4809-A131-F777EE264908</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,27 @@
|
||||
<?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>name</key>
|
||||
<string>Indent</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>decreaseIndentPattern</key>
|
||||
<string>^\s*(\}|\]|else|catch|finally)$</string>
|
||||
<key>increaseIndentPattern</key>
|
||||
<string>(?x)
|
||||
^\s*
|
||||
(.*class
|
||||
|[a-zA-Z\$_](\w|\$|:|\.)*\s*(?=\:(\s*\(.*\))?\s*((=|-)>\s*$)) # function that is not one line
|
||||
|[a-zA-Z\$_](\w|\$|\.)*\s*(:|=)\s*((if|while)(?!.*?then)|for|$) # assignment using multiline if/while/for
|
||||
|(if|while)\b(?!.*?then)|for\b
|
||||
|(try|finally|catch\s+\S.*)\s*$
|
||||
|.*[-=]>$
|
||||
|.*[\{\[]$)</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>C5D6C716-12FE-4CE8-A916-6CABEDE8AFE7</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,19 @@
|
||||
<?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>name</key>
|
||||
<string>Symbol List: Method</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee meta.function.coffee</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>showInSymbolList</key>
|
||||
<integer>1</integer>
|
||||
<key>symbolTransformation</key>
|
||||
<string>s/^\s*([a-zA-Z\$_]+)\s*=/$2/</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>419D24D8-0DD6-4D9A-8CA0-6D9CD740BEEC</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>name</key>
|
||||
<string>Symbol List: Method Instance</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee entity.name.type.instance</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>showInSymbolList</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>B087AF2F-8946-4EA9-8409-49E7C4A2EEF0</string>
|
||||
</dict>
|
||||
</plist>
|
21
bundles/CoffeeScriptBundle.tmbundle/README.markdown
Normal file
21
bundles/CoffeeScriptBundle.tmbundle/README.markdown
Normal file
@ -0,0 +1,21 @@
|
||||
CoffeeScript.tmbundle
|
||||
---------------------
|
||||
|
||||
A **TextMate Bundle** for the **CoffeeScript** programming language.
|
||||
|
||||
Installation:
|
||||
-------------
|
||||
|
||||
cd ~/Library/Application\ Support/TextMate/Bundles (Textmate 1)
|
||||
cd /Applications/TextMate.app/Contents/SharedSupport/Bundles (Textmate 1.5.10 & 2)
|
||||
git clone git://github.com/jashkenas/coffee-script-tmbundle CoffeeScriptBundle.tmbundle
|
||||
|
||||
The bundle includes syntax highlighting, the ability to compile or evaluate CoffeeScript inline, convenient symbol listing for functions, and a number of expando snippets.
|
||||
|
||||
Patches for additions are always welcome.
|
||||
|
||||
![screenshot](http://jashkenas.s3.amazonaws.com/images/coffeescript/textmate-highlighting.png)
|
||||
|
||||
If your TextMate.app is having trouble finding the `coffee` command, remember that [TextMate doesn't inherit your regular PATH](http://wiki.macromates.com/Troubleshooting/TextMateAndThePath).
|
||||
|
||||
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>for ${1:name} in ${2:array}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Array Comprehension</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>fora</string>
|
||||
<key>uuid</key>
|
||||
<string>2D4AC0B4-47AA-4E38-9A11-09A48C2A9439</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>(${1:args}) =>
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Function (bound)</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>bfun</string>
|
||||
<key>uuid</key>
|
||||
<string>20BDC055-ED67-4D0E-A47F-ADAA828EFF2B</string>
|
||||
</dict>
|
||||
</plist>
|
20
bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet
Normal file
20
bundles/CoffeeScriptBundle.tmbundle/Snippets/Class.tmSnippet
Normal file
@ -0,0 +1,20 @@
|
||||
<?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>content</key>
|
||||
<string>class ${1:ClassName}${2: extends ${3:Ancestor}}
|
||||
|
||||
${4:constructor: (${5:args}) ->
|
||||
${6:# body...}}
|
||||
$7</string>
|
||||
<key>name</key>
|
||||
<string>Class</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>cla</string>
|
||||
<key>uuid</key>
|
||||
<string>765ACBD3-380A-4CF8-9111-345A36A0DAE7</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>else if ${1:condition}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Else if</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>elif</string>
|
||||
<key>uuid</key>
|
||||
<string>EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,19 @@
|
||||
<?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>content</key>
|
||||
<string>(${1:args}) ->
|
||||
${0:# body...}
|
||||
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>Function</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>fun</string>
|
||||
<key>uuid</key>
|
||||
<string>F2E2E79A-A85D-471D-9847-72AE40205942</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,19 @@
|
||||
<?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>content</key>
|
||||
<string>if ${1:condition}
|
||||
${2:# body...}
|
||||
else
|
||||
${3:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>If .. Else</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>ife</string>
|
||||
<key>uuid</key>
|
||||
<string>2AD19F12-E499-4715-9A47-FC8D594BC550</string>
|
||||
</dict>
|
||||
</plist>
|
17
bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet
Normal file
17
bundles/CoffeeScriptBundle.tmbundle/Snippets/If.tmSnippet
Normal file
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>if ${1:condition}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>If</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>if</string>
|
||||
<key>uuid</key>
|
||||
<string>F4FDFB3A-71EF-48A4-93F4-178B949546B1</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,18 @@
|
||||
<?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>content</key>
|
||||
<string>#{${1:$TM_SELECTED_TEXT}}</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>#</string>
|
||||
<key>name</key>
|
||||
<string>Interpolated Code</string>
|
||||
<key>scope</key>
|
||||
<string>(string.quoted.double.coffee) - string source, (string.quoted.double.heredoc.coffee) - string source</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>#</string>
|
||||
<key>uuid</key>
|
||||
<string>C04ED189-6ACB-44E6-AD5B-911B760AD1CC</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>for ${1:key}, ${2:value} of ${3:Object}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Object comprehension</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>foro</string>
|
||||
<key>uuid</key>
|
||||
<string>9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>for ${1:name} in [${2:start}...${3:finish}]${4: by ${5:step}}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Range comprehension (exclusive)</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>forrex</string>
|
||||
<key>uuid</key>
|
||||
<string>FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>for ${1:name} in [${2:start}..${3:finish}]${4: by ${5:step}}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Range comprehension (inclusive)</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>forr</string>
|
||||
<key>uuid</key>
|
||||
<string>E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>\`${1:`pbpaste`}\`</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^j</string>
|
||||
<key>name</key>
|
||||
<string>Raw javascript</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>422A59E7-FC36-4E99-B01C-6353515BB544</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,18 @@
|
||||
<?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>content</key>
|
||||
<string>switch ${1:object}
|
||||
when ${2:value}
|
||||
${0:# body...}</string>
|
||||
<key>name</key>
|
||||
<string>Switch</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>swi</string>
|
||||
<key>uuid</key>
|
||||
<string>3931A7C6-F1FB-484F-82D1-26F5A8F779D0</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>if ${1:condition} then ${2:value} else ${3:other}</string>
|
||||
<key>name</key>
|
||||
<string>Ternary If</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>ifte</string>
|
||||
<key>uuid</key>
|
||||
<string>CF0B4684-E4CB-4E10-8C25-4D15400C3385</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,19 @@
|
||||
<?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>content</key>
|
||||
<string>try
|
||||
$1
|
||||
catch ${2:error}
|
||||
$3</string>
|
||||
<key>name</key>
|
||||
<string>Try .. Catch</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>try</string>
|
||||
<key>uuid</key>
|
||||
<string>CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>${1:action} unless ${2:condition}</string>
|
||||
<key>name</key>
|
||||
<string>Unless</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>unl</string>
|
||||
<key>uuid</key>
|
||||
<string>E561AECD-5933-4F59-A6F7-FA96E1203606</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet
Normal file
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h1.tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string># $1
|
||||
# ==============================================================================
|
||||
$0</string>
|
||||
<key>name</key>
|
||||
<string>Subheader</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>/1</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet
Normal file
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h2.tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string># $1
|
||||
# ----------------------------------------------------------------------
|
||||
$0</string>
|
||||
<key>name</key>
|
||||
<string>Subheader</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>/2</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet
Normal file
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/h3.tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string># $1
|
||||
# -------------------------
|
||||
$0</string>
|
||||
<key>name</key>
|
||||
<string>Subheader</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>/3</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet
Normal file
16
bundles/CoffeeScriptBundle.tmbundle/Snippets/log.tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>console.log $0</string>
|
||||
<key>name</key>
|
||||
<string>log</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>log</string>
|
||||
<key>uuid</key>
|
||||
<string>FBC44B18-323A-4C00-A35B-15E41830C5AD</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>${2/^.*?([\w_]+).*$/\L$1/} = require ${2:'${1:sys}'}$3</string>
|
||||
<key>name</key>
|
||||
<string>require</string>
|
||||
<key>scope</key>
|
||||
<string>source.coffee</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>req</string>
|
||||
<key>uuid</key>
|
||||
<string>8A65E175-18F2-428F-A695-73E01139E41A</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,736 @@
|
||||
<?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>comment</key>
|
||||
<string>CoffeeScript Syntax: version 1</string>
|
||||
<key>fileTypes</key>
|
||||
<array>
|
||||
<string>coffee</string>
|
||||
<string>Cakefile</string>
|
||||
<string>coffee.erb</string>
|
||||
</array>
|
||||
<key>firstLineMatch</key>
|
||||
<string>^#!.*\bcoffee</string>
|
||||
<key>foldingStartMarker</key>
|
||||
<string>^\s*class\s+\S.*$|.*(->|=>)\s*$|.*[\[{]\s*$</string>
|
||||
<key>foldingStopMarker</key>
|
||||
<string>^\s*$|^\s*[}\]]\s*$</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^~C</string>
|
||||
<key>name</key>
|
||||
<string>CoffeeScript</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.function.coffee</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.function.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>comment</key>
|
||||
<string>match stuff like: a -> … </string>
|
||||
<key>match</key>
|
||||
<string>(\([^()]*?\))\s*([=-]>)</string>
|
||||
<key>name</key>
|
||||
<string>meta.inline.function.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.new.coffee</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.type.instance.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(new)\s+(\w+(?:\.\w*)*)</string>
|
||||
<key>name</key>
|
||||
<string>meta.class.instance.constructor</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>'''</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>'''</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.heredoc.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"""</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"""</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.heredoc.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\.</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolated_coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>`</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>`</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.script.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<!#)###(?!#)</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>###(?:[ \t]*\n)</string>
|
||||
<key>name</key>
|
||||
<string>comment.block.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>@\w*</string>
|
||||
<key>name</key>
|
||||
<string>storage.type.annotation.coffeescript</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(#)(?!\{).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>/{3}</string>
|
||||
<key>end</key>
|
||||
<string>/{3}[imgy]{0,4}</string>
|
||||
<key>name</key>
|
||||
<string>string.regexp.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolated_coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#embedded_comment</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>/(?![\s=/*+{}?]).*?[^\\]/[igmy]{0,4}(?![a-zA-Z0-9])</string>
|
||||
<key>name</key>
|
||||
<string>string.regexp.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)
|
||||
\b(?<![\.\$])(
|
||||
break|by|catch|continue|else|finally|for|in|of|if|return|switch|
|
||||
then|throw|try|unless|when|while|until|loop|do|(?<=for)\s+own
|
||||
)(?!\s*:)\b
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>keyword.control.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)
|
||||
and=|or=|!|%|&|\^|\*|\/|(\-)?\-(?!>)|\+\+|\+|~|==|=(?!>)|!=|<=|>=|<<=|>>=|
|
||||
>>>=|<>|<|>|!|&&|\.\.(\.)?|\?|\||\|\||\:|\*=|(?<!\()/=|%=|\+=|\-=|&=|
|
||||
\^=|\b(?<![\.\$])(instanceof|new|delete|typeof|and|or|is|isnt|not)\b
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.assignment.coffee</string>
|
||||
</dict>
|
||||
<key>4</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.separator.key-value</string>
|
||||
</dict>
|
||||
<key>5</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>([a-zA-Z\$_](\w|\$|\.)*\s*(?!\::)((:)|(=))(?!(\s*\(.*\))?\s*((=|-)>)))</string>
|
||||
<key>name</key>
|
||||
<string>variable.assignment.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>(?<=\s|^)([\[\{])(?=.*?[\]\}]\s+[:=])</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>([\]\}]\s*[:=])</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.operator.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>meta.variable.assignment.destructured.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#variable_name</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#instance_variable</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#single_quoted_string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#double_quoted_string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#numeric</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.coffee</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.function.coffee</string>
|
||||
</dict>
|
||||
<key>4</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.parameter.function.coffee</string>
|
||||
</dict>
|
||||
<key>5</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.function.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?x)
|
||||
(\s*)
|
||||
(?=[a-zA-Z\$_])
|
||||
(
|
||||
[a-zA-Z\$_](\w|\$|:|\.)*\s*
|
||||
(?=[:=](\s*\(.*\))?\s*([=-]>))
|
||||
)
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>meta.function.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>[=-]></string>
|
||||
<key>name</key>
|
||||
<string>storage.type.function.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?<!\.)(true|on|yes)(?!\s*[:=])\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.boolean.true.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?<!\.)(false|off|no)(?!\s*[:=])\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.boolean.false.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?<!\.)null(?!\s*[:=])\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.null.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(?<!\.)(super|this|extends)(?!\s*[:=])\b</string>
|
||||
<key>name</key>
|
||||
<string>variable.language.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>storage.type.class.coffee</string>
|
||||
</dict>
|
||||
<key>2</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.name.type.class.coffee</string>
|
||||
</dict>
|
||||
<key>3</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>keyword.control.inheritance.coffee</string>
|
||||
</dict>
|
||||
<key>4</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>entity.other.inherited-class.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(class\b)\s+(@?[a-zA-Z\$_][\w\.]*)?(?:\s+(extends)\s+(@?[a-zA-Z\$\._][\w\.]*))?</string>
|
||||
<key>name</key>
|
||||
<string>meta.class.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(debugger|\\)\b</string>
|
||||
<key>name</key>
|
||||
<string>keyword.other.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)\b(
|
||||
Array|ArrayBuffer|Blob|Boolean|Date|document|event|Function|
|
||||
Int(8|16|32|64)Array|Math|Map|Number|
|
||||
Object|Proxy|RegExp|Set|String|WeakMap|
|
||||
window|Uint(8|16|32|64)Array|XMLHttpRequest
|
||||
)\b</string>
|
||||
<key>name</key>
|
||||
<string>support.class.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(console)\b</string>
|
||||
<key>name</key>
|
||||
<string>entity.name.type.object.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>((?<=console\.)(debug|warn|info|log|error|time|timeEnd|assert))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.console.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)\b(
|
||||
decodeURI(Component)?|encodeURI(Component)?|eval|parse(Float|Int)|require
|
||||
)\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)((?<=\.)(
|
||||
apply|call|concat|every|filter|forEach|from|hasOwnProperty|indexOf|
|
||||
isPrototypeOf|join|lastIndexOf|map|of|pop|propertyIsEnumerable|push|
|
||||
reduce(Right)?|reverse|shift|slice|some|sort|splice|to(Locale)?String|
|
||||
unshift|valueOf
|
||||
))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.method.array.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)((?<=Array\.)(
|
||||
isArray
|
||||
))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.static.array.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)((?<=Object\.)(
|
||||
create|definePropert(ies|y)|freeze|getOwnProperty(Descriptors?|Names)|
|
||||
getProperty(Descriptor|Names)|getPrototypeOf|is(Extensible|Frozen|Sealed)?|
|
||||
isnt|keys|preventExtensions|seal
|
||||
))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.static.object.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)((?<=Math\.)(
|
||||
abs|acos|acosh|asin|asinh|atan|atan2|atanh|ceil|cos|cosh|exp|expm1|floor|
|
||||
hypot|log|log10|log1p|log2|max|min|pow|random|round|sign|sin|sinh|sqrt|
|
||||
tan|tanh|trunc
|
||||
))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.static.math.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?x)((?<=Number\.)(
|
||||
is(Finite|Integer|NaN)|toInteger
|
||||
))\b</string>
|
||||
<key>name</key>
|
||||
<string>support.function.static.number.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\b(Infinity|NaN|undefined)\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.language.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\;</string>
|
||||
<key>name</key>
|
||||
<string>punctuation.terminator.statement.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>,[ |\t]*</string>
|
||||
<key>name</key>
|
||||
<string>meta.delimiter.object.comma.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\.</string>
|
||||
<key>name</key>
|
||||
<string>meta.delimiter.method.period.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\{|\}</string>
|
||||
<key>name</key>
|
||||
<string>meta.brace.curly.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\(|\)</string>
|
||||
<key>name</key>
|
||||
<string>meta.brace.round.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\[|\]\s*</string>
|
||||
<key>name</key>
|
||||
<string>meta.brace.square.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#instance_variable</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#single_quoted_string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#double_quoted_string</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#numeric</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>repository</key>
|
||||
<dict>
|
||||
<key>double_quoted_string</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>"</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>"</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.double.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]|37[0-7]?|[4-7][0-7]?|.)</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.coffee</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>#interpolated_coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>embedded_comment</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.comment.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>(?<!\\)(#).*$\n?</string>
|
||||
<key>name</key>
|
||||
<string>comment.line.number-sign.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>instance_variable</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(@)([a-zA-Z_\$]\w*)?</string>
|
||||
<key>name</key>
|
||||
<string>variable.other.readwrite.instance.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>interpolated_coffee</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>\#\{</string>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.section.embedded.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>\}</string>
|
||||
<key>name</key>
|
||||
<string>source.coffee.embedded.source</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>include</key>
|
||||
<string>$self</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>numeric</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>(?<!\$)\b((0([box])[0-9a-fA-F]+)|([0-9]+(\.[0-9]+)?(e[+\-]?[0-9]+)?))\b</string>
|
||||
<key>name</key>
|
||||
<string>constant.numeric.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>single_quoted_string</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>begin</key>
|
||||
<string>'</string>
|
||||
<key>beginCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.begin.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>end</key>
|
||||
<string>'</string>
|
||||
<key>endCaptures</key>
|
||||
<dict>
|
||||
<key>0</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>punctuation.definition.string.end.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>string.quoted.single.coffee</string>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>match</key>
|
||||
<string>\\(x\h{2}|[0-2][0-7]{,2}|3[0-6][0-7]?|37[0-7]?|[4-7][0-7]?|.)</string>
|
||||
<key>name</key>
|
||||
<string>constant.character.escape.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>variable_name</key>
|
||||
<dict>
|
||||
<key>patterns</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>captures</key>
|
||||
<dict>
|
||||
<key>1</key>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>variable.assignment.coffee</string>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>match</key>
|
||||
<string>([a-zA-Z\$_]\w*(\.\w+)*)</string>
|
||||
<key>name</key>
|
||||
<string>variable.assignment.coffee</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>scopeName</key>
|
||||
<string>source.coffee</string>
|
||||
<key>uuid</key>
|
||||
<string>5B520980-A7D5-4E10-8582-1A4C889A8DE5</string>
|
||||
</dict>
|
||||
</plist>
|
114
bundles/CoffeeScriptBundle.tmbundle/info.plist
Normal file
114
bundles/CoffeeScriptBundle.tmbundle/info.plist
Normal file
@ -0,0 +1,114 @@
|
||||
<?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>mainMenu</key>
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<string>D77D67C9-7BA6-4B42-A563-2E2416DEEB53</string>
|
||||
<string>E11D7545-67B4-4191-8012-756E2C9AD382</string>
|
||||
<string>5786C9CC-C7ED-46FA-9D0B-069E52DAF268</string>
|
||||
<string>1C7FD768-1DEA-4825-8220-FACA8D507E80</string>
|
||||
</array>
|
||||
<key>submenus</key>
|
||||
<dict>
|
||||
<key>1C7FD768-1DEA-4825-8220-FACA8D507E80</key>
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<string>F08537AF-4F02-4040-999D-F0785CF64C02</string>
|
||||
<string>C4F99E3D-1540-4BC1-8038-0A19D65BABC8</string>
|
||||
<string>68A86250-0280-11E0-A976-0800200C9A66</string>
|
||||
<string>EE3293A5-3761-40BD-9CA8-DAAA176AA19E</string>
|
||||
<string>422A59E7-FC36-4E99-B01C-6353515BB544</string>
|
||||
<string>8A65E175-18F2-428F-A695-73E01139E41A</string>
|
||||
<string>C04ED189-6ACB-44E6-AD5B-911B760AD1CC</string>
|
||||
<string>FBC44B18-323A-4C00-A35B-15E41830C5AD</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Other</string>
|
||||
</dict>
|
||||
<key>5786C9CC-C7ED-46FA-9D0B-069E52DAF268</key>
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<string>192428A1-8684-4172-8728-225B4C9E532F</string>
|
||||
<string>F2E2E79A-A85D-471D-9847-72AE40205942</string>
|
||||
<string>20BDC055-ED67-4D0E-A47F-ADAA828EFF2B</string>
|
||||
<string>2D4AC0B4-47AA-4E38-9A11-09A48C2A9439</string>
|
||||
<string>9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420</string>
|
||||
<string>FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3</string>
|
||||
<string>E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2</string>
|
||||
<string>3931A7C6-F1FB-484F-82D1-26F5A8F779D0</string>
|
||||
<string>765ACBD3-380A-4CF8-9111-345A36A0DAE7</string>
|
||||
<string>CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Constructs</string>
|
||||
</dict>
|
||||
<key>D77D67C9-7BA6-4B42-A563-2E2416DEEB53</key>
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<string>30395DAB-44A6-44F7-99E1-02D64621303A</string>
|
||||
<string>D749F761-1740-4918-9490-90DF376BA72E</string>
|
||||
<string>90424631-D00B-448C-B157-DAC92DFB2858</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Run</string>
|
||||
</dict>
|
||||
<key>E11D7545-67B4-4191-8012-756E2C9AD382</key>
|
||||
<dict>
|
||||
<key>items</key>
|
||||
<array>
|
||||
<string>F4FDFB3A-71EF-48A4-93F4-178B949546B1</string>
|
||||
<string>2AD19F12-E499-4715-9A47-FC8D594BC550</string>
|
||||
<string>EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9</string>
|
||||
<string>CF0B4684-E4CB-4E10-8C25-4D15400C3385</string>
|
||||
<string>E561AECD-5933-4F59-A6F7-FA96E1203606</string>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Control</string>
|
||||
</dict>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>name</key>
|
||||
<string>CoffeeScript</string>
|
||||
<key>ordering</key>
|
||||
<array>
|
||||
<string>5B520980-A7D5-4E10-8582-1A4C889A8DE5</string>
|
||||
<string>0A92C6F6-4D73-4859-B38C-4CC19CBC191F</string>
|
||||
<string>419D24D8-0DD6-4D9A-8CA0-6D9CD740BEEC</string>
|
||||
<string>B087AF2F-8946-4EA9-8409-49E7C4A2EEF0</string>
|
||||
<string>C5D6C716-12FE-4CE8-A916-6CABEDE8AFE7</string>
|
||||
<string>EE3293A5-3761-40BD-9CA8-DAAA176AA19E</string>
|
||||
<string>192428A1-8684-4172-8728-225B4C9E532F</string>
|
||||
<string>30395DAB-44A6-44F7-99E1-02D64621303A</string>
|
||||
<string>D749F761-1740-4918-9490-90DF376BA72E</string>
|
||||
<string>90424631-D00B-448C-B157-DAC92DFB2858</string>
|
||||
<string>F08537AF-4F02-4040-999D-F0785CF64C02</string>
|
||||
<string>C4F99E3D-1540-4BC1-8038-0A19D65BABC8</string>
|
||||
<string>F2E2E79A-A85D-471D-9847-72AE40205942</string>
|
||||
<string>20BDC055-ED67-4D0E-A47F-ADAA828EFF2B</string>
|
||||
<string>F4FDFB3A-71EF-48A4-93F4-178B949546B1</string>
|
||||
<string>2AD19F12-E499-4715-9A47-FC8D594BC550</string>
|
||||
<string>EA8F5EDB-6E1E-4C36-9CA5-12B108F1A7C9</string>
|
||||
<string>CF0B4684-E4CB-4E10-8C25-4D15400C3385</string>
|
||||
<string>E561AECD-5933-4F59-A6F7-FA96E1203606</string>
|
||||
<string>2D4AC0B4-47AA-4E38-9A11-09A48C2A9439</string>
|
||||
<string>9D126CC5-EA14-4A40-B6D3-6A5FC1AC1420</string>
|
||||
<string>FA6AB9BF-3444-4A8C-B010-C95C2CF5BAB3</string>
|
||||
<string>E0F8E45A-9262-4DD6-ADFF-B5B9D6CE99C2</string>
|
||||
<string>3931A7C6-F1FB-484F-82D1-26F5A8F779D0</string>
|
||||
<string>765ACBD3-380A-4CF8-9111-345A36A0DAE7</string>
|
||||
<string>CAFB0DED-5E23-4A84-AC20-87FBAF22DBAC</string>
|
||||
<string>422A59E7-FC36-4E99-B01C-6353515BB544</string>
|
||||
<string>8A65E175-18F2-428F-A695-73E01139E41A</string>
|
||||
<string>C04ED189-6ACB-44E6-AD5B-911B760AD1CC</string>
|
||||
<string>FBC44B18-323A-4C00-A35B-15E41830C5AD</string>
|
||||
</array>
|
||||
<key>uuid</key>
|
||||
<string>A46E4382-F1AC-405B-8F22-65FF470F34D7</string>
|
||||
</dict>
|
||||
</plist>
|
27
bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist
Normal file
27
bundles/ruby.tmbundle/Commands/Check ERB Syntax.plist
Normal file
@ -0,0 +1,27 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
|
||||
puts "using ruby-" + RUBY_VERSION.to_s + ' / erb'
|
||||
result = `"${TM_ERB:=erb}" -T - -x | "${TM_RUBY:=ruby}" -c 2>&1`
|
||||
puts result
|
||||
TextMate.go_to :line => $1 if result =~ /-:(\d+):/</string>
|
||||
<key>input</key>
|
||||
<string>document</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^V</string>
|
||||
<key>name</key>
|
||||
<string>Validate Syntax (ERB)</string>
|
||||
<key>output</key>
|
||||
<string>showAsTooltip</string>
|
||||
<key>scope</key>
|
||||
<string>text.html.ruby, text.html source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>76FCF165-54CB-4213-BC55-BD60B9C6A3EC</string>
|
||||
</dict>
|
||||
</plist>
|
28
bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist
Normal file
28
bundles/ruby.tmbundle/Commands/Check Ruby Syntax.plist
Normal file
@ -0,0 +1,28 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
require ENV['TM_SUPPORT_PATH'] + '/lib/textmate'
|
||||
puts `"${TM_RUBY:=ruby}" -e'puts "Using ruby-" + RUBY_VERSION.to_s'`
|
||||
result = `"${TM_RUBY:=ruby}" -wc 2>&1`
|
||||
puts result
|
||||
TextMate.go_to :line => $1 if result =~ /-:(\d+):/
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>document</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^V</string>
|
||||
<key>name</key>
|
||||
<string>Validate Syntax</string>
|
||||
<key>output</key>
|
||||
<string>showAsTooltip</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>EE5F19BA-6C02-11D9-92BA-0011242E4184</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,72 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
require "#{ENV["TM_SUPPORT_PATH"]}/lib/exit_codes"
|
||||
require "#{ENV["TM_SUPPORT_PATH"]}/lib/ui"
|
||||
|
||||
require "pathname"
|
||||
|
||||
TM_RUBY = ENV["TM_RUBY"] || "ruby"
|
||||
RCODETOOLS = "#{ENV['TM_BUNDLE_SUPPORT']}/vendor/rcodetools"
|
||||
|
||||
RAILS_DIR = nil
|
||||
dir = File.dirname(ENV["TM_FILEPATH"]) rescue ENV["TM_PROJECT_DIRECTORY"]
|
||||
if dir
|
||||
dir = Pathname.new(dir)
|
||||
loop do
|
||||
if (dir + "config/environment.rb").exist?
|
||||
Object.send(:remove_const, :RAILS_DIR)
|
||||
RAILS_DIR = dir.to_s
|
||||
break
|
||||
end
|
||||
|
||||
break if dir.to_s == "/"
|
||||
|
||||
dir += ".."
|
||||
end
|
||||
end
|
||||
|
||||
command = <<END_COMMAND.tr("\n", " ").strip
|
||||
"#{TM_RUBY}"
|
||||
-I "#{RCODETOOLS}/lib"
|
||||
--
|
||||
"#{RCODETOOLS}/bin/rct-complete"
|
||||
#{"-r \"#{RAILS_DIR}/config/environment.rb\"" if RAILS_DIR}
|
||||
--line=#{ENV['TM_LINE_NUMBER']}
|
||||
--column=#{ENV['TM_LINE_INDEX']}
|
||||
2> /dev/null
|
||||
END_COMMAND
|
||||
completions = `#{command}`.split("\n").map { |l| l.strip }.select { |l| l =~ /\S/ }
|
||||
|
||||
if not $?.success?
|
||||
TextMate.exit_show_tool_tip "Parse error."
|
||||
elsif completions.size == 1
|
||||
selected = completions.first
|
||||
elsif completions.size > 1
|
||||
selected = completions[TextMate::UI.menu(completions)] rescue exit
|
||||
else
|
||||
TextMate.exit_show_tool_tip "No matches were found."
|
||||
end
|
||||
|
||||
print selected.sub(/\A#{Regexp.escape(ENV['TM_CURRENT_WORD'].to_s)}/, "")
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>document</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>~</string>
|
||||
<key>name</key>
|
||||
<string>Completion: Ruby (rcodetools)</string>
|
||||
<key>output</key>
|
||||
<string>afterSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>47D203ED-EB9B-4653-A07B-A897800CEB76</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,29 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
print case str = STDIN.read
|
||||
when /=>/; str.gsub(/:(\w+)[\s]+=>[\s]+/, '\1: ')
|
||||
when /(\w+):/; str.gsub(/(\w+):(\s*(?:"(?:\\"|[^"])*"|'(?:\\'|[^'])*'|\w+\([^)]*\)|[^,]+))/, ":\\1 =>\\2")
|
||||
else; str
|
||||
end
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^=</string>
|
||||
<key>name</key>
|
||||
<string>Toggle Ruby Hash 1.8/1.9 Syntax</string>
|
||||
<key>output</key>
|
||||
<string>replaceSelectedText</string>
|
||||
<key>uuid</key>
|
||||
<string>F4EEB2B6-07D8-402F-8FC3-79B7308D2576</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,33 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
s = STDIN.read
|
||||
case s
|
||||
when /^\w+$/
|
||||
print "*#{s}*$0"
|
||||
when ""
|
||||
print "*$1*$0"
|
||||
else
|
||||
print "<b>#{s}</b>"
|
||||
end</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@b</string>
|
||||
<key>name</key>
|
||||
<string>Bold</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby comment</string>
|
||||
<key>uuid</key>
|
||||
<string>931DD73E-615E-476E-9B0D-8341023AE730</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,33 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
s = STDIN.read
|
||||
case s
|
||||
when /^\w+$/
|
||||
print "+#{s}+$0"
|
||||
when ""
|
||||
print "+$1+$0"
|
||||
else
|
||||
print "<tt>#{s}</tt>"
|
||||
end</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@k</string>
|
||||
<key>name</key>
|
||||
<string>Typewriter</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby comment</string>
|
||||
<key>uuid</key>
|
||||
<string>2DDB6FE0-6111-4C40-A149-8E67E76F8272</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,33 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
s = STDIN.read
|
||||
case s
|
||||
when /^\w+$/
|
||||
print "_#{s}_$0"
|
||||
when ""
|
||||
print "_$1_$0"
|
||||
else
|
||||
print "<em>#{s}</em>"
|
||||
end</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@i</string>
|
||||
<key>name</key>
|
||||
<string>Italic</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby comment</string>
|
||||
<key>uuid</key>
|
||||
<string>DAA69A0C-FC1E-4509-9931-DFFB38B4D6AE</string>
|
||||
</dict>
|
||||
</plist>
|
47
bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist
Normal file
47
bundles/ruby.tmbundle/Commands/Execute Line with Ruby.plist
Normal file
@ -0,0 +1,47 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
# be smart, dont print something if we already have..
|
||||
$write_count = 0
|
||||
def STDOUT.write(what)
|
||||
$write_count += 1
|
||||
super(what)
|
||||
end
|
||||
|
||||
# execure the code
|
||||
begin
|
||||
# insert a space if input was a selection, if it was a line insert \n
|
||||
print(ENV['TM_SELECTED_TEXT'] ? " " : "\n")
|
||||
r = eval(STDIN.read)
|
||||
rescue Object
|
||||
r = $!.class.to_s
|
||||
end
|
||||
|
||||
# try to_s, if it doesnt work use inspect
|
||||
# Array and Hash are shown via inspect because they look better with formating
|
||||
# do this just if the script did not print anything itself
|
||||
if $write_count == 1
|
||||
print( (r.class != Hash and r.class != Array and not r.nil? and r.respond_to? :to_s) ? r.to_s : r.inspect )
|
||||
print( "\n" ) unless ENV.has_key?('TM_SELECTED_TEXT')
|
||||
end
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^E</string>
|
||||
<key>name</key>
|
||||
<string>Execute Line / Selection as Ruby</string>
|
||||
<key>output</key>
|
||||
<string>afterSelectedText</string>
|
||||
<key>uuid</key>
|
||||
<string>EE5F1FB2-6C02-11D9-92BA-0011242E4184</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,29 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>export RUBYLIB="$TM_BUNDLE_SUPPORT/vendor/rcodetools/lib${RUBYLIB:+:$RUBYLIB}"
|
||||
export TM_RUBY=$(which "${TM_RUBY:-ruby}")
|
||||
|
||||
|
||||
"${TM_RUBY}" -r "${TM_SUPPORT_PATH}/lib/ruby1.9/add_1.8_features.rb" -- "$TM_BUNDLE_SUPPORT/vendor/rcodetools/bin/xmpfilter"
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>document</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^@E</string>
|
||||
<key>name</key>
|
||||
<string>Execute and Update ‘# =>’ Markers</string>
|
||||
<key>output</key>
|
||||
<string>replaceSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>FBFC214F-B019-4967-95D2-028F374A3221</string>
|
||||
</dict>
|
||||
</plist>
|
51
bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist
Normal file
51
bundles/ruby.tmbundle/Commands/Insert Missing Requires.plist
Normal file
@ -0,0 +1,51 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
$: << "#{ENV['TM_SUPPORT_PATH']}/lib"
|
||||
|
||||
require "escape"
|
||||
require "open3"
|
||||
|
||||
# make exceptions in the writing Thread kill the process so we don't hang
|
||||
Thread.abort_on_exception = true
|
||||
|
||||
CURSOR = [0xFFFC].pack("U").freeze
|
||||
line, col = ENV["TM_LINE_NUMBER"].to_i - 1, ENV["TM_LINE_INDEX"].to_i
|
||||
|
||||
stdin, stdout, stderr = Open3.popen3("/usr/bin/env", "ruby", "#{ENV['TM_BUNDLE_SUPPORT']}/bin/insert_requires.rb")
|
||||
Thread.new do
|
||||
code = STDIN.read.to_a
|
||||
unless ENV.has_key?('TM_SELECTED_TEXT')
|
||||
if code[line].nil? # if cursor was on the last line and it was blank
|
||||
code << CURSOR
|
||||
else
|
||||
code[line][col...col] = CURSOR
|
||||
end
|
||||
end
|
||||
stdin.write code.join
|
||||
stdin.close
|
||||
end
|
||||
|
||||
print stdout.read.split(CURSOR).join('${0}')
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>document</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^#</string>
|
||||
<key>name</key>
|
||||
<string>Insert Missing Requires</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>9FB64639-F776-499B-BA6F-BB45F86F80FD</string>
|
||||
</dict>
|
||||
</plist>
|
24
bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist
Normal file
24
bundles/ruby.tmbundle/Commands/Lookup in Documentation.plist
Normal file
@ -0,0 +1,24 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>"${TM_BUNDLE_SUPPORT}/bin/linked_ri.rb"</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^h</string>
|
||||
<key>name</key>
|
||||
<string>Documentation for Word / Selection</string>
|
||||
<key>output</key>
|
||||
<string>showAsTooltip</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby, source.ruby.rails</string>
|
||||
<key>uuid</key>
|
||||
<string>63F3B3B7-CBE2-426B-B551-657733F3868B</string>
|
||||
</dict>
|
||||
</plist>
|
29
bundles/ruby.tmbundle/Commands/Make Destructive Call.plist
Normal file
29
bundles/ruby.tmbundle/Commands/Make Destructive Call.plist
Normal file
@ -0,0 +1,29 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>res=$(ruby "$TM_BUNDLE_SUPPORT/bin/make_destructive.rb")
|
||||
|
||||
if [ "$res" = "" ]
|
||||
then exit_show_tool_tip "Retry this command without a selection."
|
||||
else echo -n "$res"
|
||||
fi</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^!</string>
|
||||
<key>name</key>
|
||||
<string>Add ! to Method in Line / Selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>7F79BC8D-8A4F-4570-973B-05DFEC25747F</string>
|
||||
</dict>
|
||||
</plist>
|
39
bundles/ruby.tmbundle/Commands/New Method.plist
Normal file
39
bundles/ruby.tmbundle/Commands/New Method.plist
Normal file
@ -0,0 +1,39 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby -wKU
|
||||
|
||||
require "#{ENV['TM_SUPPORT_PATH']}/lib/exit_codes"
|
||||
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape"
|
||||
|
||||
method_name = ENV["TM_SELECTED_TEXT"] || ENV["TM_CURRENT_WORD"] or
|
||||
TextMate.exit_show_tool_tip(
|
||||
"Please type the new function's name or use the def⇥ snippet."
|
||||
)
|
||||
|
||||
print <<END_SNIPPET
|
||||
def #{e_sn method_name}\${1/.+/(/}\${1:args}\${1/.+/)/}
|
||||
\$0
|
||||
end
|
||||
END_SNIPPET
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>word</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>$
</string>
|
||||
<key>name</key>
|
||||
<string>New Method</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>0275EF39-9357-408F-AF20-79E415CA9504</string>
|
||||
</dict>
|
||||
</plist>
|
31
bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand
Normal file
31
bundles/ruby.tmbundle/Commands/Omit from RDoc.tmCommand
Normal file
@ -0,0 +1,31 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
s = STDIN.read
|
||||
puts "\#--"
|
||||
if s== ""
|
||||
puts "\# $0","\#++"
|
||||
else
|
||||
puts s, "\#++", "$0"
|
||||
end</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>line</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^@O</string>
|
||||
<key>name</key>
|
||||
<string>Omit</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>BF4CA9F1-51CD-48D4-8357-852234F59046</string>
|
||||
</dict>
|
||||
</plist>
|
65
bundles/ruby.tmbundle/Commands/Open Require.tmCommand
Normal file
65
bundles/ruby.tmbundle/Commands/Open Require.tmCommand
Normal file
@ -0,0 +1,65 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
require "#{ENV['TM_SUPPORT_PATH']}/lib/ui.rb"
|
||||
require "#{ENV['TM_SUPPORT_PATH']}/lib/textmate.rb"
|
||||
|
||||
REQUIRE_RE = /^\s*(?:require|load)\s*(['"])([^'"#]+?)(?:\.rb)?\1[ \t]*$/
|
||||
|
||||
gems_installed = begin
|
||||
require 'rubygems'
|
||||
true
|
||||
rescue LoadError
|
||||
false
|
||||
end
|
||||
|
||||
requires = if ENV['TM_CURRENT_LINE'].to_s =~ REQUIRE_RE
|
||||
["#{$2}.rb"]
|
||||
else
|
||||
$stdin.read.scan(REQUIRE_RE).map { |_, path| "#{path}.rb" }
|
||||
end
|
||||
abort 'No includes found.' if requires.empty?
|
||||
|
||||
file = if requires.size > 1
|
||||
choice = TextMate::UI.menu(requires) or exit
|
||||
requires[choice]
|
||||
else
|
||||
requires.pop
|
||||
end
|
||||
dir = $LOAD_PATH.find { |dir| File.exist? File.join(dir, file) }
|
||||
if not dir and gems_installed and gem_spec = Gem::GemPathSearcher.new.find(file)
|
||||
dir = File.join(gem_spec.full_gem_path, gem_spec.require_path)
|
||||
end
|
||||
|
||||
if file and dir
|
||||
dir.sub!(%r{\A\.(?=/|\z)}, ENV['TM_DIRECTORY']) if ENV['TM_DIRECTORY']
|
||||
file_path = File.join(dir, file)
|
||||
# puts file_path
|
||||
TextMate.go_to :file => file_path
|
||||
exit
|
||||
else
|
||||
puts "File not found: #{file}"
|
||||
end
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>document</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@D</string>
|
||||
<key>name</key>
|
||||
<string>Open Require</string>
|
||||
<key>output</key>
|
||||
<string>showAsTooltip</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>8646378E-91F5-4771-AC7C-43FC49A93576</string>
|
||||
</dict>
|
||||
</plist>
|
27
bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand
Normal file
27
bundles/ruby.tmbundle/Commands/Run Rake Task.tmCommand
Normal file
@ -0,0 +1,27 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>export RUBYLIB="$TM_BUNDLE_SUPPORT/RakeMate${RUBYLIB:+:$RUBYLIB}"
|
||||
export TM_RUBY=$(which "${TM_RUBY:-ruby}")
|
||||
export TM_RAKE=$(which "${TM_RAKE:-rake}")
|
||||
|
||||
"${TM_RUBY}" -- "$TM_BUNDLE_SUPPORT/RakeMate/rake_mate.rb"
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^R</string>
|
||||
<key>name</key>
|
||||
<string>Run Rake Task</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>569C9822-8C41-4907-94C7-1A8A0031B66D</string>
|
||||
</dict>
|
||||
</plist>
|
35
bundles/ruby.tmbundle/Commands/Run focused unit test.plist
Normal file
35
bundles/ruby.tmbundle/Commands/Run focused unit test.plist
Normal file
@ -0,0 +1,35 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>captureFormatString</key>
|
||||
<string>$0</string>
|
||||
<key>capturePattern</key>
|
||||
<string>(/[^:]+):(\d+)</string>
|
||||
<key>command</key>
|
||||
<string>#!/bin/sh
|
||||
|
||||
export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
|
||||
|
||||
/usr/bin/env ruby -KU -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb" --name=
|
||||
</string>
|
||||
<key>fileCaptureRegister</key>
|
||||
<string>1</string>
|
||||
<key>input</key>
|
||||
<string>document</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@R</string>
|
||||
<key>lineCaptureRegister</key>
|
||||
<string>2</string>
|
||||
<key>name</key>
|
||||
<string>Run Focused Unit Test</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>5289EE40-86B8-11D9-A8D4-000A95E13C98</string>
|
||||
</dict>
|
||||
</plist>
|
29
bundles/ruby.tmbundle/Commands/Run.tmCommand
Normal file
29
bundles/ruby.tmbundle/Commands/Run.tmCommand
Normal file
@ -0,0 +1,29 @@
|
||||
<?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>autoScrollOutput</key>
|
||||
<true/>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/bin/sh
|
||||
|
||||
export RUBYLIB="$TM_BUNDLE_SUPPORT/RubyMate${RUBYLIB:+:$RUBYLIB}"
|
||||
|
||||
/usr/bin/env ruby -KU -- "$TM_BUNDLE_SUPPORT/RubyMate/run_script.rb"
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>document</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>@r</string>
|
||||
<key>name</key>
|
||||
<string>Run</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>35222962-C50D-4D58-A6AE-71E7AD980BE4</string>
|
||||
</dict>
|
||||
</plist>
|
37
bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist
Normal file
37
bundles/ruby.tmbundle/Commands/Show RDoc for this file.plist
Normal file
@ -0,0 +1,37 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>saveActiveFile</string>
|
||||
<key>command</key>
|
||||
<string>if (( ${#TM_PROJECT_DIRECTORY} != 0 )); then
|
||||
cd "$TM_PROJECT_DIRECTORY"
|
||||
output="`basename "$TM_PROJECT_DIRECTORY"`"
|
||||
input="."
|
||||
else
|
||||
cd "$TM_DIRECTORY"
|
||||
output="$TM_FILENAME"
|
||||
input="$TM_FILENAME"
|
||||
fi
|
||||
|
||||
output_dir="/tmp/rdoc_${output}"
|
||||
|
||||
rm -rf "${output_dir}"
|
||||
|
||||
rdoc -S -N -q -f html --op "${output_dir}" "$input" &>/dev/null
|
||||
|
||||
echo "<html><head><meta http-equiv=\"refresh\" content=\"0;URL=tm-file://${output_dir}/index.html\"></head></html>"
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>name</key>
|
||||
<string>Show for Current File / Project</string>
|
||||
<key>output</key>
|
||||
<string>showAsHTML</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>1AD6A138-2E89-4D6A-AB3F-416BF9CE968D</string>
|
||||
</dict>
|
||||
</plist>
|
59
bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand
Normal file
59
bundles/ruby.tmbundle/Commands/Toggle ERb Tags.tmCommand
Normal file
@ -0,0 +1,59 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby -w
|
||||
|
||||
require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape"
|
||||
require "enumerator"
|
||||
|
||||
TAGS = %w[<%= <%# <%- <%].freeze
|
||||
|
||||
# locate caret (Allan's code)
|
||||
line = ENV['TM_LINE_NUMBER'].to_i - ENV['TM_INPUT_START_LINE'].to_i
|
||||
col = ENV['TM_LINE_INDEX'].to_i
|
||||
if ENV['TM_LINE_NUMBER'].to_i == ENV['TM_INPUT_START_LINE'].to_i
|
||||
col -= ENV['TM_INPUT_START_LINE_INDEX'].to_i
|
||||
end
|
||||
|
||||
# read input
|
||||
input = $stdin.read
|
||||
|
||||
# snippetize output
|
||||
lines = RUBY_VERSION < "1.9" ? input.to_a : input.lines.to_a
|
||||
lines[line] = e_sn(lines[line][0...col]) + "${0}" + e_sn(lines[line][col..-1])
|
||||
enum = RUBY_VERSION < "1.9" ? lines.enum_with_index :
|
||||
lines.each.with_index
|
||||
output = enum.inject(String.new) do |out, (l, i)|
|
||||
i == line ? out + l : out + e_sn(l)
|
||||
end
|
||||
|
||||
# swap ERb tags
|
||||
result = output.sub(/\A<%[-#=]?/) { |match| TAGS[TAGS.index(match) - 1] }
|
||||
if result[2] == ?-
|
||||
result.sub!(/%>\Z/, "-%>")
|
||||
else
|
||||
result.sub!(/-%>\Z/, "%>")
|
||||
end
|
||||
print result</string>
|
||||
<key>disableOutputAutoIndent</key>
|
||||
<true/>
|
||||
<key>fallbackInput</key>
|
||||
<string>scope</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^></string>
|
||||
<key>name</key>
|
||||
<string>Toggle ERb Tags</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby.embedded, source.ruby.rails.embedded, comment.block.erb, meta.erb</string>
|
||||
<key>uuid</key>
|
||||
<string>835FAAC6-5431-436C-998B-241F7226B99B</string>
|
||||
</dict>
|
||||
</plist>
|
55
bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist
Normal file
55
bundles/ruby.tmbundle/Commands/Toggle Quote Style.plist
Normal file
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
class String
|
||||
def escape(char)
|
||||
gsub(/\\.|#{Regexp.quote(char)}/) { |match| match == char ? "\\#{char}" : match }
|
||||
end
|
||||
|
||||
def unescape(char)
|
||||
gsub(/\\./) { |match| match == "\\#{char}" ? char : match }
|
||||
end
|
||||
end
|
||||
|
||||
print case str = STDIN.read
|
||||
# Handle standard quotes
|
||||
when /\A"(.*)"\z/m; "'" + $1.unescape('"').escape("'") + "'"
|
||||
when /\A'(.*)'\z/m; "%Q{" + $1.unescape("'").escape("}") + "}"
|
||||
when /\A%[Qq]?\{(.*)\}\z/m; '"' + $1.unescape("}").escape('"') + '"'
|
||||
|
||||
# Handle the more esoteric quote styles
|
||||
when /\A%[Qq]?\[(.*)(\])\z/m,
|
||||
/\A%[Qq]?\((.*)(\))\z/m,
|
||||
/\A%[Qq]?<(.*)(>)\z/m; '"' + $1.unescape($2).escape('"') + '"'
|
||||
when /\A%[Qq]?(.)(.*)\1\z/m; '"' + $2.unescape($1).escape('"') + '"'
|
||||
|
||||
# Handle shell escapes
|
||||
when /\A`(.*)`\z/m; "%x{" + $1.unescape("`").escape("}") + "}"
|
||||
when /\A%x\{(.*)\}\z/m; "`" + $1.unescape("}").escape("`") + "`"
|
||||
|
||||
# Default case
|
||||
else str
|
||||
end
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>scope</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^"</string>
|
||||
<key>name</key>
|
||||
<string>Toggle Quote Style</string>
|
||||
<key>output</key>
|
||||
<string>replaceSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby string.quoted.double, source.ruby string.quoted.single, source.ruby string</string>
|
||||
<key>uuid</key>
|
||||
<string>6519CB08-8326-4B77-A251-54722FFBFC1F</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,35 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>bundleUUID</key>
|
||||
<string>467B298F-6227-11D9-BFB1-000D93589AF6</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
|
||||
print case str = STDIN.read
|
||||
# Handle standard quotes
|
||||
when /\A["'](\w+)["']\z/ then ":" + $1
|
||||
when /\A:(\w+)\z/ then '"' + $1 + '"'
|
||||
# Default case
|
||||
else str
|
||||
end
|
||||
</string>
|
||||
<key>fallbackInput</key>
|
||||
<string>scope</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^:</string>
|
||||
<key>name</key>
|
||||
<string>Toggle String / Symbol</string>
|
||||
<key>output</key>
|
||||
<string>replaceSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby string.quoted, source.ruby constant.other.symbol.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>B297E4B8-A8FF-49CE-B9C4-6D4911724D43</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,150 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby -KU
|
||||
# encoding: UTF-8
|
||||
|
||||
require "rexml/text"
|
||||
require "#{ENV["TM_SUPPORT_PATH"]}/lib/escape"
|
||||
|
||||
# transform XML into normal and sanitized Ruby
|
||||
ruby, safe_ruby, scope = "", "", []
|
||||
STDIN.read.scan(/<(.*?)>|([^<]+)/) do
|
||||
if $1
|
||||
if $1[0] == ?/
|
||||
scope.pop
|
||||
else
|
||||
scope.push($1)
|
||||
end
|
||||
else
|
||||
unescaped = REXML::Text.unnormalize($2)
|
||||
ruby << unescaped
|
||||
# strip strings, regexes, and comments from safe_ruby but leave byte count
|
||||
if scope.any? { |s| s =~ /\A(?:string|comment)\b/ }
|
||||
safe_ruby << " " * unescaped.length
|
||||
else
|
||||
safe_ruby << unescaped
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
# find and mark the cursor
|
||||
line_number = ENV["TM_LINE_NUMBER"].to_i
|
||||
input_start_line = ENV["TM_INPUT_START_LINE"].to_i
|
||||
row = line_number - input_start_line
|
||||
col = ENV["TM_LINE_INDEX"].to_i
|
||||
if line_number == input_start_line
|
||||
col -= ENV["TM_INPUT_START_LINE_INDEX"].to_i
|
||||
end
|
||||
cursor = ruby[/\A(?:.*\n){#{row - 1}}.{#{col}}/].size
|
||||
CURSOR = [0xFFFC].pack("U")
|
||||
B = "(?:\\b|#{CURSOR})" # Note: /\w/u includes CURSOR
|
||||
ruby[cursor, 0] = CURSOR
|
||||
safe_ruby[cursor, 0] = CURSOR
|
||||
|
||||
# find the block nearest to the cursor
|
||||
block_start, block_length = nil, nil
|
||||
loop do
|
||||
block_start = safe_ruby.rindex( /(\{|#{B}do#{B})/,
|
||||
block_start.nil? ? cursor : block_start - 1 )
|
||||
if block_start.nil? # block not found: give up and don't change the document
|
||||
print e_sn(ruby).sub(CURSOR, "$0")
|
||||
exit
|
||||
end
|
||||
block_length, nesting = 0, []
|
||||
if $1 == "{"
|
||||
re, starts, stop = /\{|\}|[^{}]+/, ["{"], "}"
|
||||
else
|
||||
re, starts, stop = /#{B}do#{B}|#{B}end#{B}|./m, ["do"], "end"
|
||||
end
|
||||
safe_ruby[block_start..-1].scan(re) do |token|
|
||||
block_length += token.length
|
||||
token.sub!(/\A#{CURSOR}/, "")
|
||||
token.sub!(/#{CURSOR}\z/, "")
|
||||
case token
|
||||
when *starts
|
||||
nesting << token
|
||||
when stop
|
||||
if nesting.last.nil?
|
||||
nesting << nil
|
||||
break
|
||||
else
|
||||
nesting.pop
|
||||
break if nesting.empty?
|
||||
end
|
||||
end
|
||||
end
|
||||
break if nesting.empty? and ruby[block_start, block_length].include? CURSOR
|
||||
end
|
||||
block = ruby[block_start, block_length]
|
||||
|
||||
# toggle the block
|
||||
if block[0] == ?{
|
||||
block = block[1..-2]
|
||||
if block.include? "\n"
|
||||
block[0, 0] = " " if block =~ /\A#{CURSOR}?[A-Za-z0-9_]/
|
||||
block << " " if block =~ /[A-Za-z0-9_]#{CURSOR}?\z/
|
||||
block = "do#{block}end"
|
||||
else # expand the block
|
||||
block.strip!
|
||||
lines = %w[do]
|
||||
if block.sub!(/\A(#{CURSOR}?(\s*)\|[^|]*\|)/, "")
|
||||
lines.first << "#{' ' if $2.empty?}#{$1}"
|
||||
end
|
||||
indent = ruby[0...block_start][/^([ \t]*).*\Z/, 1]
|
||||
tab = ( ENV["TM_SOFT_TABS"] == "YES" ? " " * ENV["TM_TAB_SIZE"].to_i :
|
||||
"\t" )
|
||||
lines << "#{indent}#{tab}#{block.strip}"
|
||||
lines << "#{indent}end"
|
||||
block = lines.join("\n")
|
||||
end
|
||||
else
|
||||
block = block[2..-4]
|
||||
if block.include? "\n" # collapse the block
|
||||
lines = block.send(block.respond_to?(:lines) ? :lines : :to_s).to_a
|
||||
lines.first.send(
|
||||
"#{'r' if lines.first =~ /\A\s*#{CURSOR}?\s*\|[^|]*\|/}strip!"
|
||||
)
|
||||
lines[1..-1].each do |line|
|
||||
line.strip!
|
||||
end
|
||||
lines.first << "; " unless lines.first =~
|
||||
/\A\s*#{CURSOR}?\s*(?:\|[^|]*\|)?\s*#{CURSOR}?\z/
|
||||
lines.first << " " unless lines.first =~ /\s\z/
|
||||
lines[1..-2].each do |line|
|
||||
line << "; "
|
||||
end
|
||||
lines[-2].sub!(/; \z/, "") if lines.size > 2 and lines.last.empty?
|
||||
cursor_by_end = lines.size > 2 && lines.last == CURSOR
|
||||
lines[-2].sub!(/; \z/, " ") if cursor_by_end
|
||||
block = "{#{lines.join}#{' ' unless cursor_by_end}}"
|
||||
else
|
||||
block = "{#{block}}"
|
||||
end
|
||||
end
|
||||
|
||||
# replace document
|
||||
print e_sn(ruby[0...block_start])
|
||||
print e_sn(block).sub(CURSOR, "$0")
|
||||
print e_sn(ruby[(block_start + block_length)..-1])
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>inputFormat</key>
|
||||
<string>xml</string>
|
||||
<key>keyEquivalent</key>
|
||||
<string>^{</string>
|
||||
<key>name</key>
|
||||
<string>Toggle ‘do … end’ / ‘{ … }’</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>59E811FF-E722-46BE-8938-04713612FABB</string>
|
||||
</dict>
|
||||
</plist>
|
31
bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist
Normal file
31
bundles/ruby.tmbundle/Commands/word_wrap() (worw).plist
Normal file
@ -0,0 +1,31 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
$: << ENV['TM_SUPPORT_PATH'] + '/lib'
|
||||
require "ui"
|
||||
TextMate::UI.request_string(:title => "Wrap Size",
|
||||
:prompt => "Enter a character width:",
|
||||
:button1 => "Build Snippet") do |col|
|
||||
col = col.to_i
|
||||
print %Q{gsub!(/(.{1,#{col}}|\\S{#{col + 1},})(?: +|$\\n?)/, "\\\\1\\n")}
|
||||
end
|
||||
</string>
|
||||
<key>input</key>
|
||||
<string>none</string>
|
||||
<key>name</key>
|
||||
<string>word_wrap()</string>
|
||||
<key>output</key>
|
||||
<string>afterSelectedText</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>worw</string>
|
||||
<key>uuid</key>
|
||||
<string>97054C4D-E4A3-45B1-9C00-B82DBCB30CAD</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,39 @@
|
||||
<?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>beforeRunningCommand</key>
|
||||
<string>nop</string>
|
||||
<key>command</key>
|
||||
<string>#!/usr/bin/env ruby -wKU
|
||||
|
||||
require 'pathname'
|
||||
|
||||
require "#{ENV['TM_SUPPORT_PATH']}/lib/escape.rb"
|
||||
|
||||
from_path = Pathname.new(ENV['TM_FILEPATH'] || '.').dirname.realpath
|
||||
to_path = Pathname.new(ENV['TM_DROPPED_FILE']).realpath
|
||||
begin
|
||||
path = to_path.relative_path_from(from_path)
|
||||
rescue ArgumentError
|
||||
path = to_path
|
||||
end
|
||||
lib = path.to_s.sub(/\.rb\z/i, '')
|
||||
puts %Q{require "#{e_sn(lib).gsub('"', '\"')}"}
|
||||
</string>
|
||||
<key>draggedFileExtensions</key>
|
||||
<array>
|
||||
<string>rb</string>
|
||||
</array>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>name</key>
|
||||
<string>Require Ruby File</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>uuid</key>
|
||||
<string>C122CD92-DDBE-4869-9C7A-CC2B254C9411</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,54 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb benchmark</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>TESTS = ${1:10_000}
|
||||
Benchmark.bmbm do |results|
|
||||
$0
|
||||
end</string>
|
||||
<key>name</key>
|
||||
<string>Benchmark.bmbm do .. end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>bm-</string>
|
||||
<key>uuid</key>
|
||||
<string>942F20E2-C40A-44B8-A3F2-99AAC68CB534</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>Benchmark.bmbm do .. end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>bm</string>
|
||||
<key>uuid</key>
|
||||
<string>C649F945-DAB8-4DA2-B73C-2EFF9D7D34F3</string>
|
||||
</dict>
|
||||
</plist>
|
25
bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro
Normal file
25
bundles/ruby.tmbundle/Macros/Delete forward:backward.tmMacro
Normal file
@ -0,0 +1,25 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>deleteBackward:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>deleteForward:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string></string>
|
||||
<key>name</key>
|
||||
<string>Delete forward/backward</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby.embedded.source.empty</string>
|
||||
<key>uuid</key>
|
||||
<string>A83F68A9-F751-4BB4-AE16-56812878C16A</string>
|
||||
</dict>
|
||||
</plist>
|
54
bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist
Normal file
54
bundles/ruby.tmbundle/Macros/Overwrite } in #{ .. }.plist
Normal file
@ -0,0 +1,54 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveRightAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>action</key>
|
||||
<string>replaceAll</string>
|
||||
<key>findInProjectIgnoreCase</key>
|
||||
<false/>
|
||||
<key>findString</key>
|
||||
<string>((?m:.){2,})|\}|([^}])</string>
|
||||
<key>ignoreCase</key>
|
||||
<false/>
|
||||
<key>regularExpression</key>
|
||||
<true/>
|
||||
<key>replaceAllScope</key>
|
||||
<string>selection</string>
|
||||
<key>replaceString</key>
|
||||
<string>$1}$2</string>
|
||||
<key>wrapAround</key>
|
||||
<false/>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>findWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveLeft:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveRight:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string>}</string>
|
||||
<key>name</key>
|
||||
<string>Overwrite '}' in #{ .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby string.quoted source.ruby.embedded</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>uuid</key>
|
||||
<string>E5158F94-CC52-4424-A495-14EF9272653F</string>
|
||||
</dict>
|
||||
</plist>
|
51
bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro
Normal file
51
bundles/ruby.tmbundle/Macros/PStore_new( __ ).tmMacro
Normal file
@ -0,0 +1,51 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb pstore</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>PStore.new(${1:"${2:file_name.pstore}"})</string>
|
||||
<key>name</key>
|
||||
<string>PStore.new( .. )</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Pn-</string>
|
||||
<key>uuid</key>
|
||||
<string>5B46ECFD-23A4-4F0C-9951-F64C19C72C2B</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>PStore.new( .. )</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Pn</string>
|
||||
<key>uuid</key>
|
||||
<string>5AE7CFB4-418E-4E00-AD76-06DB755EE876</string>
|
||||
</dict>
|
||||
</plist>
|
57
bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist
Normal file
57
bundles/ruby.tmbundle/Macros/YAML.dump(.., file) (Yd).plist
Normal file
@ -0,0 +1,57 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb yaml</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>File.open(${1:"${2:path/to/file}.yaml"}, "w") { |${3:file}| YAML.dump(${4:obj}, ${3:file}) }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Yd-</string>
|
||||
<key>uuid</key>
|
||||
<string>3BA6762A-BB6B-489E-8006-F30F386AEF48</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string></string>
|
||||
<key>name</key>
|
||||
<string>YAML.dump(.., file)</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Yd</string>
|
||||
<key>uuid</key>
|
||||
<string>9460392B-C036-4A76-A5AE-1191F10E4B1B</string>
|
||||
</dict>
|
||||
</plist>
|
57
bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist
Normal file
57
bundles/ruby.tmbundle/Macros/YAML.load(file) (Yl).plist
Normal file
@ -0,0 +1,57 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb yaml</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>File.open(${1:"${2:path/to/file}.yaml"}) { |${3:file}| YAML.load(${3:file}) }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Yl-</string>
|
||||
<key>uuid</key>
|
||||
<string>8343ACF4-EEB7-44B5-B835-94826466D4D5</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>keyEquivalent</key>
|
||||
<string></string>
|
||||
<key>name</key>
|
||||
<string>YAML.load(file)</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Yl</string>
|
||||
<key>uuid</key>
|
||||
<string>2C07D4E7-D74F-4AE4-82BE-B0BA82247AFA</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,63 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb delegate</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass})
|
||||
def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/}
|
||||
super(${4:del_obj})
|
||||
|
||||
$0
|
||||
end
|
||||
|
||||
|
||||
end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>class-</string>
|
||||
<key>uuid</key>
|
||||
<string>AFE1D078-EA16-45F5-AD8A-FAC1B523D861</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>class .. < DelegateClass .. initialize .. end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>cla</string>
|
||||
<key>uuid</key>
|
||||
<string>121B334B-2AA6-4E9A-A8B8-BF93B627982B</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb jcode</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>each_char { |${1:chr}| $0 }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eac-</string>
|
||||
<key>uuid</key>
|
||||
<string>FDD73070-6D32-4301-A86A-C55B77C3D8ED</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>each_char { |chr| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eac</string>
|
||||
<key>uuid</key>
|
||||
<string>7E084412-80E6-4B70-8092-C03D1ECE4CD2</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb enumerator</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>each_cons(${1:2}) { |${2:group}| $0 }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eac-</string>
|
||||
<key>uuid</key>
|
||||
<string>3C04589C-5127-478E-97B3-CA7DD2EA7ECD</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>each_cons(..) { |group| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eac</string>
|
||||
<key>uuid</key>
|
||||
<string>EC73D5CC-5F05-46B9-A6F4-82037E4A38C9</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb enumerator</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>each_slice(${1:2}) { |${2:group}| $0 }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eas-</string>
|
||||
<key>uuid</key>
|
||||
<string>CD748479-D2A4-4AB5-95BD-4C89512BA210</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>each_slice(..) { |group| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>eas</string>
|
||||
<key>uuid</key>
|
||||
<string>825B721D-4367-4DF7-98C0-F005695DF9E3</string>
|
||||
</dict>
|
||||
</plist>
|
55
bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist
Normal file
55
bundles/ruby.tmbundle/Macros/extend Forwardable (Forw).plist
Normal file
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb forwardable</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>extend Forwardable</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Forw-</string>
|
||||
<key>uuid</key>
|
||||
<string>7F46C90A-595B-4B83-A4F7-058F63CE4218</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>extend Forwardable</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Forw</string>
|
||||
<key>uuid</key>
|
||||
<string>58FDEA60-10AF-4C49-AA09-29B77030DB25</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,55 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb enumerator</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>bundlePath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle</string>
|
||||
<key>content</key>
|
||||
<string>enum_with_index.map { |${1:e}, ${2:i}| $0 }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>supportPath</key>
|
||||
<string>/Users/james/Library/Application Support/TextMate/Bundles/Ruby Idioms.tmbundle/Support</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>mapwi-</string>
|
||||
<key>uuid</key>
|
||||
<string>BD4CFD7B-1AC0-4569-9BDA-FD491F41F4E6</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>map_with_index { |e, i| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>scopeType</key>
|
||||
<string>local</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>mapwi</string>
|
||||
<key>uuid</key>
|
||||
<string>BFB65D1C-62F1-485D-8A67-3E5A2E55107C</string>
|
||||
</dict>
|
||||
</plist>
|
51
bundles/ruby.tmbundle/Macros/require_gem "__".tmMacro
Normal file
51
bundles/ruby.tmbundle/Macros/require_gem "__".tmMacro
Normal file
@ -0,0 +1,51 @@
|
||||
<?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>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb rubygems</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>require "$0"</string>
|
||||
<key>name</key>
|
||||
<string>require_gem ".."</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>reqg-</string>
|
||||
<key>uuid</key>
|
||||
<string>34FEBB9F-73CD-4DD4-A0A3-1CF2A5E3DE78</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>require_gem ".."</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>reqg</string>
|
||||
<key>uuid</key>
|
||||
<string>33969819-62C5-4E03-B824-C2337205F364</string>
|
||||
</dict>
|
||||
</plist>
|
51
bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro
Normal file
51
bundles/ruby.tmbundle/Macros/xmlread(__).tmMacro
Normal file
@ -0,0 +1,51 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>commands</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>moveToBeginningOfDocumentAndModifySelection:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>command</key>
|
||||
<string>insert_requires.rb rexml/document</string>
|
||||
<key>input</key>
|
||||
<string>selection</string>
|
||||
<key>output</key>
|
||||
<string>insertAsSnippet</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>executeCommandWithOptions:</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>argument</key>
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>REXML::Document.new(File.read(${1:"${2:path/to/file}"}))</string>
|
||||
<key>name</key>
|
||||
<string>xmlread(..)</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>xml-</string>
|
||||
<key>uuid</key>
|
||||
<string>B904D4AA-D15D-48A4-8EB2-563BAF489332</string>
|
||||
</dict>
|
||||
<key>command</key>
|
||||
<string>insertSnippetWithOptions:</string>
|
||||
</dict>
|
||||
</array>
|
||||
<key>name</key>
|
||||
<string>xmlread(..)</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>xml</string>
|
||||
<key>uuid</key>
|
||||
<string>F6BF907E-FDF7-4D9B-9E57-BE159561349D</string>
|
||||
</dict>
|
||||
</plist>
|
42
bundles/ruby.tmbundle/Preferences/Block typing pairs.plist
Normal file
42
bundles/ruby.tmbundle/Preferences/Block typing pairs.plist
Normal file
@ -0,0 +1,42 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Typing Pairs: Block Opening</string>
|
||||
<key>scope</key>
|
||||
<string>keyword.control.start-block.ruby, meta.syntax.ruby.start-block</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>smartTypingPairs</key>
|
||||
<array>
|
||||
<array>
|
||||
<string>"</string>
|
||||
<string>"</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>(</string>
|
||||
<string>)</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>{</string>
|
||||
<string>}</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>[</string>
|
||||
<string>]</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>“</string>
|
||||
<string>”</string>
|
||||
</array>
|
||||
<array>
|
||||
<string>|</string>
|
||||
<string>|</string>
|
||||
</array>
|
||||
</array>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>6D75102B-6E51-4360-8F12-BE12327B6AE6</string>
|
||||
</dict>
|
||||
</plist>
|
38
bundles/ruby.tmbundle/Preferences/Comments.plist
Normal file
38
bundles/ruby.tmbundle/Preferences/Comments.plist
Normal file
@ -0,0 +1,38 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Comments</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>shellVariables</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START</string>
|
||||
<key>value</key>
|
||||
<string># </string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_START_2</string>
|
||||
<key>value</key>
|
||||
<string>=begin
|
||||
</string>
|
||||
</dict>
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>TM_COMMENT_END_2</string>
|
||||
<key>value</key>
|
||||
<string>=end
|
||||
</string>
|
||||
</dict>
|
||||
</array>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>1D26F26C-C6F7-434F-84F8-FEE895372E8A</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Completion: ENV[…] variables</string>
|
||||
<key>scope</key>
|
||||
<string>meta.environment-variable.ruby string.quoted</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>completionCommand</key>
|
||||
<string>env|grep "^$TM_CURRENT_WORD"|sort|cut -d= -f1</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>1A7701FA-D866-498C-AD4C-7846538DB535</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,22 @@
|
||||
<?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>name</key>
|
||||
<string>Completion: require strings</string>
|
||||
<key>scope</key>
|
||||
<string>meta.require.ruby string.quoted</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>completionCommand</key>
|
||||
<string>#!/usr/bin/env ruby
|
||||
ptrn = /^#{Regexp.escape ENV["TM_CURRENT_WORD"].to_s}[^.]+\..+/
|
||||
puts( $LOAD_PATH.inject([]) do |res, path|
|
||||
res << Dir.new(path).grep(ptrn) { |file| file[/^[^.]+/] } if File.exists?(path)
|
||||
res
|
||||
end.sort.uniq )</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>AEDD6A5F-417F-4177-8589-B07518ACA9DE</string>
|
||||
</dict>
|
||||
</plist>
|
44
bundles/ruby.tmbundle/Preferences/Miscellaneous.plist
Normal file
44
bundles/ruby.tmbundle/Preferences/Miscellaneous.plist
Normal file
@ -0,0 +1,44 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Indent</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>decreaseIndentPattern</key>
|
||||
<string>^\s*([}\]]\s*$|(end|rescue|ensure|else|elsif|when)\b)</string>
|
||||
<key>increaseIndentPattern</key>
|
||||
<string>(?x)^
|
||||
(\s*
|
||||
(module|class|def
|
||||
|unless|if|else|elsif
|
||||
|case|when
|
||||
|begin|rescue|ensure
|
||||
|for|while|until
|
||||
|(?= .*? \b(do|begin|case|if|unless)\b )
|
||||
# the look-ahead above is to quickly discard non-candidates
|
||||
( "(\\.|[^\\"])*+" # eat a double quoted string
|
||||
| '(\\.|[^\\'])*+' # eat a single quoted string
|
||||
| [^#"'] # eat all but comments and strings
|
||||
)*
|
||||
( \s (do|begin|case)
|
||||
| [-+=&|*/~%^<>~](?<!\$.) \s*+ (if|unless)
|
||||
)
|
||||
)\b
|
||||
(?! [^;]*+ ; .*? \bend\b )
|
||||
|( "(\\.|[^\\"])*+" # eat a double quoted string
|
||||
| '(\\.|[^\\'])*+' # eat a single quoted string
|
||||
| [^#"'] # eat all but comments and strings
|
||||
)*
|
||||
( \{ (?! [^}]*+ \} )
|
||||
| \[ (?! [^\]]*+ \] )
|
||||
)
|
||||
).*$</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>6FEAF60F-F0F3-4618-9259-DE93285F50D1</string>
|
||||
</dict>
|
||||
</plist>
|
19
bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist
Normal file
19
bundles/ruby.tmbundle/Preferences/Symbo List: Method.plist
Normal file
@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Symbol List: Method</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby meta.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>showInSymbolList</key>
|
||||
<integer>1</integer>
|
||||
<key>symbolTransformation</key>
|
||||
<string>s/^\s*def\s+/ /</string>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>92E190C9-A861-4025-92D4-D6B5A24C22D4</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>name</key>
|
||||
<string>Symbol List: No Function Call</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby meta.function-call entity.name.function</string>
|
||||
<key>settings</key>
|
||||
<dict>
|
||||
<key>showInSymbolList</key>
|
||||
<integer>0</integer>
|
||||
</dict>
|
||||
<key>uuid</key>
|
||||
<string>A5D50494-EB97-48DE-A2BE-322DF52A7A7A</string>
|
||||
</dict>
|
||||
</plist>
|
17
bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet
Normal file
17
bundles/ruby.tmbundle/Snippets/# encoding: UTF-8.tmSnippet
Normal file
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string># encoding: ${1:UTF-8}
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string># encoding: UTF-8</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>utf8</string>
|
||||
<key>uuid</key>
|
||||
<string>B2C3ADE8-E19E-4B87-9C6C-593D490114C7</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,17 @@
|
||||
<?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>content</key>
|
||||
<string>#!/usr/bin/env ruby${TM_RUBY_SWITCHES: -wKU}
|
||||
</string>
|
||||
<key>name</key>
|
||||
<string>#!/usr/bin/env ruby -wKU</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>rb</string>
|
||||
<key>uuid</key>
|
||||
<string>A05CBDD6-845D-45EB-94FB-F8787F5456BE</string>
|
||||
</dict>
|
||||
</plist>
|
20
bundles/ruby.tmbundle/Snippets/060 ruby if else.plist
Normal file
20
bundles/ruby.tmbundle/Snippets/060 ruby if else.plist
Normal file
@ -0,0 +1,20 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>if ${1:condition}
|
||||
$2
|
||||
else
|
||||
$3
|
||||
end</string>
|
||||
<key>name</key>
|
||||
<string>if … else … end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>ife</string>
|
||||
<key>uuid</key>
|
||||
<string>667082E6-62C3-11D9-B8CF-000D93589AF6</string>
|
||||
</dict>
|
||||
</plist>
|
18
bundles/ruby.tmbundle/Snippets/070 ruby if.plist
Normal file
18
bundles/ruby.tmbundle/Snippets/070 ruby if.plist
Normal file
@ -0,0 +1,18 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>if ${1:condition}
|
||||
$0
|
||||
end</string>
|
||||
<key>name</key>
|
||||
<string>if … end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>if</string>
|
||||
<key>uuid</key>
|
||||
<string>6670835F-62C3-11D9-B8CF-000D93589AF6</string>
|
||||
</dict>
|
||||
</plist>
|
19
bundles/ruby.tmbundle/Snippets/080 ruby case.plist
Normal file
19
bundles/ruby.tmbundle/Snippets/080 ruby case.plist
Normal file
@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>case ${1:object}
|
||||
when ${2:condition}
|
||||
$0
|
||||
end</string>
|
||||
<key>name</key>
|
||||
<string>case … end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>case</string>
|
||||
<key>uuid</key>
|
||||
<string>667083EE-62C3-11D9-B8CF-000D93589AF6</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string> :yields: ${0:arguments}</string>
|
||||
<key>name</key>
|
||||
<string>:yields:</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby comment</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>y</string>
|
||||
<key>uuid</key>
|
||||
<string>ED6368FB-A11D-4622-9F42-7879481094F1</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet
Normal file
16
bundles/ruby.tmbundle/Snippets/Add '# =>' Marker.tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string># => </string>
|
||||
<key>name</key>
|
||||
<string>Add ‘# =>’ Marker</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>#</string>
|
||||
<key>uuid</key>
|
||||
<string>88BC3896-DC39-4307-A271-21D33340F15A</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>Array.new(${1:10}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }</string>
|
||||
<key>name</key>
|
||||
<string>Array.new(10) { |i| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Array</string>
|
||||
<key>uuid</key>
|
||||
<string>DAE6A754-D906-4763-B816-CE67125CEF08</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,19 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>TESTS = ${1:10_000}
|
||||
Benchmark.bmbm do |results|
|
||||
$0
|
||||
end</string>
|
||||
<key>name</key>
|
||||
<string>Benchmark.bmbm do .. end</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>bm-</string>
|
||||
<key>uuid</key>
|
||||
<string>942F20E2-C40A-44B8-A3F2-99AAC68CB534</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>Dir.glob(${1:"${2:dir/glob/*}"}) { |${3:file}| $0 }</string>
|
||||
<key>name</key>
|
||||
<string>Dir.glob("..") { |file| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Dir</string>
|
||||
<key>uuid</key>
|
||||
<string>332AA973-AA71-48CB-AEE9-1D71E11019AC</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/ruby.tmbundle/Snippets/Dir["__"].tmSnippet
Normal file
16
bundles/ruby.tmbundle/Snippets/Dir["__"].tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>Dir[${1:"${2:glob/**/*.rb}"}]</string>
|
||||
<key>name</key>
|
||||
<string>Dir[".."]</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Dir</string>
|
||||
<key>uuid</key>
|
||||
<string>8EBBB26F-980E-404E-8366-74E5772298F6</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>File.foreach(${1:"${2:path/to/file}"}) { |${3:line}| $0 }</string>
|
||||
<key>name</key>
|
||||
<string>File.foreach ("..") { |line| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>File</string>
|
||||
<key>uuid</key>
|
||||
<string>8F594E5E-6F46-4E98-B5FB-1C8F3BA9828F</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 }</string>
|
||||
<key>name</key>
|
||||
<string>File.open("..") { |file| .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>File</string>
|
||||
<key>uuid</key>
|
||||
<string>397FA09F-A30F-4EE4-920C-318D5004EE97</string>
|
||||
</dict>
|
||||
</plist>
|
16
bundles/ruby.tmbundle/Snippets/File_read("__").tmSnippet
Normal file
16
bundles/ruby.tmbundle/Snippets/File_read("__").tmSnippet
Normal file
@ -0,0 +1,16 @@
|
||||
<?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>content</key>
|
||||
<string>File.read(${1:"${2:path/to/file}"})</string>
|
||||
<key>name</key>
|
||||
<string>File.read("..")</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>File</string>
|
||||
<key>uuid</key>
|
||||
<string>50C56AC8-48F3-42A0-AF10-8164464AFAEF</string>
|
||||
</dict>
|
||||
</plist>
|
@ -0,0 +1,16 @@
|
||||
<?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">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>content</key>
|
||||
<string>Hash.new { |${1:hash}, ${2:key}| ${1:hash}[${2:key}] = $0 }</string>
|
||||
<key>name</key>
|
||||
<string>Hash.new { |hash, key| hash[key] = .. }</string>
|
||||
<key>scope</key>
|
||||
<string>source.ruby</string>
|
||||
<key>tabTrigger</key>
|
||||
<string>Hash</string>
|
||||
<key>uuid</key>
|
||||
<string>E16EE658-1CA0-4950-954B-B962E50B754F</string>
|
||||
</dict>
|
||||
</plist>
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user