• Embed Doc
  • Readcast
  • Collections
  • CommentGo Back
Download
 
RUBY COMMANDS
⌃⌥⇧
RRuby rcode completion
⌥⎋
Run rake task
⌃⇧
RRun current UnitTest
⌘⇧
ROpen require
⌘⇧
DInsert missing requires
#Execute Line/Selection
⌃⇧
E
SQL COMMANDS
⌃⌥⇧
SDatabase browser
⌥⌘⇧
DExecute line/selection
⌃⇧
Q
RUBY CODE
Toggle string/symbol
:Toggle do .. end / { .. } 
 {Insert/toggle ERb (select.)
>Add ! to method in line
!Begin .. rescue .. end
⌃⇧
WHash pointer
ʻ
=>
ʻ
LEmbed select. code #{..}#
RUBY SNIPPETS
require “..”req
File (foreach, read, open)File
Option parser blockoptp
Add optionopt
UnitTest, TestCase blocktc
def test_
name 
.. enddeft
assert
test 
,
message 
as
assert_(([
a-z
])[a-z]+_?)+as[
a-z
]+
New rdoc block=b
[case, elsif, if, unless,when, while] block...If .. else .. endife
New modulemod
:
key 
=> “
value 
”[,]:
:yieds:
arguments 
y
 { |
variables 
| .. }  {
do |
variables 
| .. enddo
RUBY CLASSES
New Ruby (Rails) classcla
def self.
name 
.. enddefs
alias_method :
new 
, :
old 
am
attr_[read,write,access] ..[r,w,rw]
RUBY FUNCTIONAL
Array.new(..) { |i| .. Array
Hash.new { |h,k| h[k] = .. } Hash
[all,any]? { |
| .. } [all,any]
each { |
| .. } ea
each_(([
a-z
])[a-z]+_?)+ea[
a-z
]+
reverse_each { |
| .. } reve
inject(
init 
) { |
mem 
,
var 
| .. } inj
lambda { |
args 
| .. } lam
map { |
| .. } map
map_with_index { |
,
| .. } mapwi
zip(
enums 
) { |
row 
| .. } zip
TextMate Ruby/Rails/SQL/YAML Cheat SheetTextMate Ruby/Rails/SQL/YAML Cheat Sheet
 
RAILS COMMANDS
⌃⌥⇧
RShow class
ʼ
DB schema
⌃⌘⇧
SGoto alternate file
⌥⌘↓
Goto specific file
⌥⌘⇧↓
Goto file on current line
⌥⌘↑
Generators, migrations,
 fixtures, schema cmds 
ppe
Generate a migration
⌃⇧
MTest ... (rake test tasks)
 \ 
YAML COMMANDS
⌃⌥⇧
YAutocomplete FK fixturereference [habtm]
key 
:
value 
snippet
:Convert to Ruby
⌃⇧
HSyntax cheat sheet
HAdd list item
Sort keys alphabeticallyF5
RAILS SNIPPETS
“session[:
user 
]” snippet
J“params[:
id 
]” snippet
Pflash[:
notice 
] = “
msg 
flash
[c,m]attr_accessor :
name 
[c,m]rw
redirect_to ([
omething 
]+)re[
]+
render ([
omething 
]+)r[
]+
verify [redirect, render]verify
assert(
= assigns(:
))asg
assert_responseasre
assert_rjsasrj
associations: use initials...
has_many :dependenthmd
has_many :throughhmt
validates_(([
a-z
])[a-z]+_?)+
(w/o “_of”, add “if” for :if)
-
before_[
a-z
][a-z]+
bef[
cdus
]
after_[
a-z
][a-z]+
aft[
cdus
]
find([:all,:first,
id 
])fin[a,f,i]
logger.
evel 
log
returning do |
var 
| .. endreturning
xhr [get,post,put,delete]x[…]
SCOPE REFERENCECONTROLLER
respond to (sel. text)
⌘⇧
Hdef create method block
defcreate
CUCUMBER
⌃⌥⇧
CFeaturefea
Scenario, Outlinesc[e,o]
[Given, When, Then] step
[giv,whe,the]
 
Autocomplete step
⌥⎋
Create all undef. steps
⌃⌥⌘⇧↓
Goto current step
⌃⌥⇧↓
Run feature
RRun single scenario
⌘⇧
RAlign table cells
⌥⌘
 \ 
TextMate Ruby/Rails/SQL/YAML Cheat SheetTextMate Ruby/Rails/SQL/YAML Cheat Sheet
of 00

Leave a Comment

You must be to leave a comment.
Submit
Characters: ...
You must be to leave a comment.
Submit
Characters: ...