Source

.emacs.d / vendor / yasnippet / snippets / ruby-mode / definitions / mod

# 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