Merge pull request #282 from jimeh/add-ruby-module-snippet

Enhancement, exceptional: Add `mod` snippet to ruby-mode for `module` definitions
This commit is contained in:
João Távora 2012-08-13 01:12:12 -07:00
commit f82350a75d

View File

@ -0,0 +1,13 @@
# name: module ... end
# contributor: hitesh <hitesh.jasani@gmail.com>, jimeh <contact@jimeh.me>
# key: mod
# --
module ${1:`(let ((fn (capitalize (file-name-nondirectory
(file-name-sans-extension
(or (buffer-file-name)
(buffer-name (current-buffer))))))))
(cond
((string-match "_" fn) (replace-match "" nil nil fn))
(t fn)))`}
$0
end