summaryrefslogblamecommitdiffstats
path: root/emacs.d/snippets/text-mode/ruby-mode/cls
blob: da28fb7af0040d18434f0ddf74ccab4f08d96d00 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12
13












                                                                         
#name : class ... end
#contributor : hitesh <hitesh.jasani@gmail.com>
#group : definitions
# --
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