|
| 1 | +{ |
| 2 | + "New Minitest spec": { |
| 3 | + "prefix": ["Minitest"], |
| 4 | + "body": [ |
| 5 | + "# frozen_string_literal: true", |
| 6 | + "", |
| 7 | + "require \"spec_helper\"", |
| 8 | + "", |
| 9 | + "class $1 < Minitest::Spec", |
| 10 | + " describe \"$2\" do", |
| 11 | + " it \"$3\" do", |
| 12 | + " $0", |
| 13 | + " assert(true)", |
| 14 | + " end", |
| 15 | + " end", |
| 16 | + "end", |
| 17 | + "" |
| 18 | + ], |
| 19 | + "description": "New Minitest class using the spec syntax." |
| 20 | + }, |
| 21 | + "New Minitest test": { |
| 22 | + "prefix": ["Minitest"], |
| 23 | + "body": [ |
| 24 | + "# frozen_string_literal: true", |
| 25 | + "", |
| 26 | + "require \"test_helper\"", |
| 27 | + "", |
| 28 | + "class $1 < Minitest::Test", |
| 29 | + " def test_$2", |
| 30 | + " $0", |
| 31 | + " assert(true)", |
| 32 | + " end", |
| 33 | + "end", |
| 34 | + "" |
| 35 | + ], |
| 36 | + "description": "New Minitest class using the test syntax." |
| 37 | + }, |
| 38 | + "New Rspec test": { |
| 39 | + "prefix": ["Rspec"], |
| 40 | + "body": [ |
| 41 | + "# frozen_string_literal: true", |
| 42 | + "", |
| 43 | + "describe $1 do", |
| 44 | + " describe \"$2\" do", |
| 45 | + " it \"$3\" do", |
| 46 | + " $0", |
| 47 | + " expect(true).to eq(true)", |
| 48 | + " end", |
| 49 | + " end", |
| 50 | + "end", |
| 51 | + "" |
| 52 | + ], |
| 53 | + "description": "New Minitest class using the spec syntax." |
| 54 | + }, |
| 55 | + "New class": { |
| 56 | + "prefix": ["class"], |
| 57 | + "body": ["class $1", " def initialize", " $0", " end", "end", ""], |
| 58 | + "description": "New Ruby class." |
| 59 | + }, |
| 60 | + "New module": { |
| 61 | + "prefix": ["module"], |
| 62 | + "body": ["module $1", " def $2", " $0", " end", "end", ""], |
| 63 | + "description": "New Ruby module." |
| 64 | + }, |
| 65 | + "Begin rescue block": { |
| 66 | + "prefix": ["begin"], |
| 67 | + "body": ["begin", " $0", "rescue $1", "end", ""], |
| 68 | + "description": "New Ruby begin block with rescue." |
| 69 | + }, |
| 70 | + "Begin rescue ensure": { |
| 71 | + "prefix": ["begin"], |
| 72 | + "body": ["begin", " $0", "rescue $1", "ensure", "end", ""], |
| 73 | + "description": "New Ruby begin block with rescue and ensure." |
| 74 | + }, |
| 75 | + "Each inline": { |
| 76 | + "prefix": ["each"], |
| 77 | + "body": ["each { |$1| $0 }"], |
| 78 | + "description": "New Ruby inline each loop." |
| 79 | + }, |
| 80 | + "Each block": { |
| 81 | + "prefix": ["each"], |
| 82 | + "body": ["each do |$1|", " $0", "end"], |
| 83 | + "description": "New Ruby each loop." |
| 84 | + }, |
| 85 | + "Map inline": { |
| 86 | + "prefix": ["map"], |
| 87 | + "body": ["map { |$1| $0 }"], |
| 88 | + "description": "New Ruby inline map loop." |
| 89 | + }, |
| 90 | + "Map block": { |
| 91 | + "prefix": ["map"], |
| 92 | + "body": ["map do |$1|", " $0", "end"], |
| 93 | + "description": "New Ruby map loop." |
| 94 | + }, |
| 95 | + "Flat map inline": { |
| 96 | + "prefix": ["flat_map"], |
| 97 | + "body": ["flat_map { |$1| $0 }"], |
| 98 | + "description": "New Ruby inline flat_map loop." |
| 99 | + }, |
| 100 | + "Flat Map block": { |
| 101 | + "prefix": ["flat_map"], |
| 102 | + "body": ["flat_map do |$1|", " $0", "end"], |
| 103 | + "description": "New Ruby flat_map loop." |
| 104 | + }, |
| 105 | + "Select inline": { |
| 106 | + "prefix": ["select"], |
| 107 | + "body": ["select { |$1| $0 }"], |
| 108 | + "description": "New Ruby inline select loop." |
| 109 | + }, |
| 110 | + "Select block": { |
| 111 | + "prefix": ["select"], |
| 112 | + "body": ["select do |$1|", " $0", "end"], |
| 113 | + "description": "New Ruby select loop." |
| 114 | + }, |
| 115 | + "Find inline": { |
| 116 | + "prefix": ["find"], |
| 117 | + "body": ["find { |$1| $0 }"], |
| 118 | + "description": "New Ruby inline find loop." |
| 119 | + }, |
| 120 | + "Find block": { |
| 121 | + "prefix": ["find"], |
| 122 | + "body": ["find do |$1|", " $0", "end"], |
| 123 | + "description": "New Ruby find loop." |
| 124 | + }, |
| 125 | + "Define method method": { |
| 126 | + "prefix": ["def"], |
| 127 | + "body": ["def $1", " $0", "end"], |
| 128 | + "description": "New method." |
| 129 | + }, |
| 130 | + "Define singleton method": { |
| 131 | + "prefix": ["defs"], |
| 132 | + "body": ["def self.$1", " $0", "end"], |
| 133 | + "description": "New singleton method." |
| 134 | + }, |
| 135 | + "Define attribute accessor": { |
| 136 | + "prefix": ["attr"], |
| 137 | + "body": ["attr_accessor :$1"], |
| 138 | + "description": "New attribute accessor." |
| 139 | + }, |
| 140 | + "Define attribute reader": { |
| 141 | + "prefix": ["attr"], |
| 142 | + "body": ["attr_reader :$1"], |
| 143 | + "description": "New attribute reader." |
| 144 | + }, |
| 145 | + "Define attribute writer": { |
| 146 | + "prefix": ["attr"], |
| 147 | + "body": ["attr_writer :$1"], |
| 148 | + "description": "New attribute writer." |
| 149 | + }, |
| 150 | + "If else": { |
| 151 | + "prefix": ["if"], |
| 152 | + "body": ["if $1", " $0", "else", "end"], |
| 153 | + "description": "New if statement with else." |
| 154 | + }, |
| 155 | + "If elsif": { |
| 156 | + "prefix": ["if"], |
| 157 | + "body": ["if $1", " $0", "elsif $2", " $0", "end"], |
| 158 | + "description": "New if statement with elsif." |
| 159 | + } |
| 160 | +} |
0 commit comments