PageRenderTime 142ms CodeModel.GetById 81ms app.highlight 1ms RepoModel.GetById 59ms app.codeStats 0ms

/ruby-mode/Strings/gsub(;..;) { |match| .. } (gsu).yasnippet

http://github.com/ridgetang/snippets
Unknown | 6 lines | 6 code | 0 blank | 0 comment | 0 complexity | 6d5a728380bb46fb327401995c3c08b0 MD5 | raw file
1# -*- mode: snippet -*-
2# key: gsu
3# contributor: Translated from TextMate Snippet
4# name: gsub(/../) { |match| .. }
5# --
6gsub(/${1:pattern}/) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:match}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }