Created
December 13, 2011 08:17
-
-
Save apotonick/1471200 to your computer and use it in GitHub Desktop.
My Ruby templates for Scribes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8"?> | |
<scribes version="0.1"> | |
<snippet><entry><trigger id="ruby">select</trigger><description>select element</description><template>select { |${element}| ${element}.${} }${cursor}</template></entry><entry><trigger id="ruby">when</trigger><description>when</description><template>inject(${object}) do |${injection}, ${element}| | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">reject</trigger><description>reject element</description><template>reject { |${element}| ${element}.${} }${cursor}</template></entry><entry><trigger id="ruby">:</trigger><description>hash pair</description><template>:${key} => ${"value"}${,}${cursor}</template></entry><entry><trigger id="ruby">ife</trigger><description>if...else</description><template>if ${condition} | |
${statement_1} | |
else | |
${statement_2} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">unless</trigger><description>unless</description><template>unless ${condition} | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">do</trigger><description>do...end</description><template>do | |
${statement} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">doo</trigger><description>do...end</description><template>do |${object}| | |
${statement} | |
end | |
${cursor}</template></entry> | |
<entry><trigger id="ruby">describe</trigger><description>describe</description><template>describe "${what}" do | |
${cursor} | |
end | |
</template></entry> | |
<entry><trigger id="ruby">it</trigger><description>it</description><template>it "${what}" do | |
${cursor} | |
end | |
</template></entry> | |
<entry><trigger id="ruby">each</trigger><description>each element</description><template>ch { |${element}| ${element}.${} }${cursor}</template></entry><entry><trigger id="ruby">eachwi</trigger><description>each with index</description><template>each_with_index { |${element}, ${idx}| ${element}.$0 }${cursor}</template></entry><entry><trigger id="ruby">inject</trigger><description>inject object</description><template>inject(${object}) { |${injection}, ${element}| ${} }${cursor}</template></entry><entry><trigger id="ruby">case</trigger><description>case...end</description><template>case ${object} | |
when ${condition} | |
${statement} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">class</trigger><description>class...end</description><template>class ${class_name} | |
${cursor} | |
end | |
</template></entry> | |
<entry><trigger id="ruby">module</trigger><description>module...end</description><template>module ${module_name} | |
${cursor} | |
end | |
</template></entry> | |
<entry><trigger id="ruby">before</trigger><description>before...end</description><template>before do | |
${cursor} | |
end | |
</template></entry> | |
<entry><trigger id="ruby">forin</trigger><description>for...in...end</description><template>for ${element} in ${collection} | |
${element}.${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">rejecto</trigger><description>reject element do</description><template>reject do |${element}| | |
${element}.${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">collecto</trigger><description>collect element do</description><template>begin | |
${statement} | |
rescue ${Exception} => ${e} | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">def</trigger><description>Method Definition</description><template>def ${method_name} | |
${cursor} | |
end</template></entry> | |
<entry><trigger id="ruby">##</trigger><description>#{..}</description><template>#{${eval}}${cursor}</template></entry> | |
<entry><trigger id="ruby">asserte</trigger><description>assert_equal</description><template>assert_equal ${expected}, ${subject}${cursor}</template></entry> | |
<entry><trigger id="ruby">def</trigger><description>Method Definition</description><template>def ${method_name} | |
${body} | |
end | |
${cursor}</template></entry> | |
<entry><trigger id="ruby">if</trigger><description>if...end</description><template>if ${condition} | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">collect</trigger><description>collect element</description><template>collect { |${element}| ${element}.${object} }${cursor}</template></entry><entry><trigger id="ruby">doo</trigger><description>do |object|...end</description><template>do |${object}| | |
${statement} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">eacho</trigger><description>each element do</description><template>each do |${element}| | |
${element}.${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">eachwio</trigger><description>each with index do</description><template>each_with_index do |${element}, ${idx}| | |
${element}.${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">injecto</trigger><description>inject object do</description><template>inject(${object}) do |${injection}, ${element}| | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">begin</trigger><description>begin...rescue...end</description><template>begin | |
${} | |
rescue ${Exception} => ${e} | |
${} | |
end | |
${cursor}</template></entry><entry><trigger id="ruby">selecto</trigger><description>select element do</description><template>select do |${element}| | |
${element}.${} | |
end | |
${cursor}</template></entry></snippet></scribes> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment