emacs-prelude/vendor/yasnippet/snippets/ruby-mode/definitions/cls

13 lines
393 B
Text
Raw Normal View History

2012-02-17 22:12:32 +02:00
# name: class ... end
# contributor: hitesh <hitesh.jasani@gmail.com>
# key: cls
# --
class ${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