mirror of
https://github.com/rafamadriz/friendly-snippets
synced 2024-09-16 22:14:02 +02:00
2b93d03982
Fix `each` snippet so that the block content is not auto filled with the `item`, following the regular ruby snippets
64 lines
1.5 KiB
JSON
64 lines
1.5 KiB
JSON
{
|
|
"if": {
|
|
"prefix": "if",
|
|
"body": ["<% if ${1:truevalue} %>", " $2", "<% end %>"],
|
|
"description": "if .. end"
|
|
},
|
|
"else": {
|
|
"prefix": "else",
|
|
"body": ["<% else %>"],
|
|
"description": "else"
|
|
},
|
|
"elsif": {
|
|
"prefix": "elsif",
|
|
"body": ["<% elsif ${1:truevalue} %>"],
|
|
"description": "elsif"
|
|
},
|
|
"end": {
|
|
"prefix": "end",
|
|
"body": ["<% end %>"],
|
|
"description": "end"
|
|
},
|
|
"ife": {
|
|
"prefix": "ife",
|
|
"body": [
|
|
"<% if ${1:truevalue} %>",
|
|
" $2",
|
|
"<% else %>",
|
|
" $3",
|
|
"<% end %>"
|
|
],
|
|
"description": "if .. else .. end"
|
|
},
|
|
"unless": {
|
|
"prefix": "unless",
|
|
"body": ["<% unless ${1:falsevalue} %>", " $2", "<% end %>"],
|
|
"description": "unless .. end"
|
|
},
|
|
"unlesse": {
|
|
"prefix": "unlesse",
|
|
"body": [
|
|
"<% unless ${1:falsevalue} %>",
|
|
" $2",
|
|
"<% else %>",
|
|
" $3",
|
|
"<% end %>"
|
|
],
|
|
"description": "unless .. end"
|
|
},
|
|
"each": {
|
|
"prefix": "each",
|
|
"body": ["<% ${1:items}.each do |${2:item}| %>", " $3", "<% end %>"],
|
|
"description": "each do"
|
|
},
|
|
"render": {
|
|
"prefix": ["pe", "="],
|
|
"body": ["<%= $1 %>"],
|
|
"description": "render block pe"
|
|
},
|
|
"exec": {
|
|
"prefix": ["er", "%"],
|
|
"body": ["<% $1 %>"],
|
|
"description": "erb exec block"
|
|
}
|
|
}
|