Add ruby stuff
[emacs.git] / .emacs.d / elisp / yasnippet / snippets / ruby-mode / definitions / mod
1 # name: module ... end
2 # contributor: hitesh <hitesh.jasani@gmail.com>, jimeh <contact@jimeh.me>
3 # key: mod
4 # --
5 module ${1:`(let ((fn (capitalize (file-name-nondirectory
6 (file-name-sans-extension
7 (or (buffer-file-name)
8 (buffer-name (current-buffer))))))))
9 (cond
10 ((string-match "_" fn) (replace-match "" nil nil fn))
11 (t fn)))`}
12 $0
13 end