https://github.com/accessd/sublime-useful-ruby-snippets
Ruby snippets for Sublime Text Editor http://www.sublimetext.com/
https://github.com/accessd/sublime-useful-ruby-snippets
Last synced: about 1 year ago
JSON representation
Ruby snippets for Sublime Text Editor http://www.sublimetext.com/
- Host: GitHub
- URL: https://github.com/accessd/sublime-useful-ruby-snippets
- Owner: accessd
- Created: 2012-09-06T17:25:33.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2013-06-15T15:34:43.000Z (about 13 years ago)
- Last Synced: 2025-03-30T03:44:10.234Z (about 1 year ago)
- Size: 110 KB
- Stars: 18
- Watchers: 5
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
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:
```ruby
... do
end
```
Description rspec block:
```ruby
describe "description" do ... end
```
FactoryGirl create method:
```ruby
create(:...)
```
## Complete Inventory
`...` denotes the cursor position immediately after code insertion.
```ruby
before do
...
end
```
```ruby
before { ... }
```
```ruby
create ( :... )
```
```ruby
describe "..." do
end
```
```ruby
do
...
end
```
```ruby
each { |...| }
```
```ruby
each_pair { |k,v| ... }
```
```ruby
each_pair do |k,v|
...
end
```
```ruby
...:
```
```ruby
it { should... }
```
```ruby
let(:...) { }
```
```ruby
let!(:...) { }
```
---
[Ruby](http://ruby-lang.org) snippets for [Sublime Text Editor](http://www.sublimetext.com/)