Ruby snippets for Sublime Text Editor http://www.sublimetext.com/
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.DS_Store
README.md
before-end.sublime-snippet
before-one-line.sublime-snippet
create-fg.sublime-snippet
describe-end.sublime-snippet
do-end.sublime-snippet
do-variable-end.sublime-snippet
each-one-line.sublime-snippet
each-pair-one-line.sublime-snippet
each-pair.sublime-snippet
hash-pair.sublime-snippet
if.sublime-snippet
it-one-line.sublime-snippet
let-bang.sublime-snippet
let.sublime-snippet
pipe.sublime-snippet

README.md

Missing Ruby & RSpec Snippets for Sublime Text 2

A.K.A. I'll Never Be Sure Why Sublime Didn't Ship With do...end

Start typing the first few letters, and hit tab to complete!

Install it!

Just clone it into the right folder using

git clone git://github.com/accessd/sublime-useful-ruby-snippets.git

  • Linux: In your Sublime packages directory, probably ~/.config/sublime-text-2/Packages
  • Mac OS X (I'm on 10.7 Lion): ~/Library/Application\ Support/Sublime\ Text\ 2/Packages/.
Fun Fact: you don't have to be in the Ruby folder, because each snippet is scoped to be used in .rb files.

Examples

Block with do:

  ... do
  end

Description rspec block:

  describe "description" do ... end

FactoryGirl create method:

  create(:...)

Complete Inventory

... denotes the cursor position immediately after code insertion.

  before do
    ...
  end
  before { ... }
  create ( :... )
  describe "..." do
  
  end
       do
    ...
  end
  each { |...|  }
  each_pair { |k,v| ... }
  each_pair do |k,v|
    ...
  end
  ...: 
  it { should... }
  let(:...) {  }
  let!(:...) {  }

Ruby snippets for Sublime Text Editor