Skip to content

Commit

Permalink
Add mod snippet to ruby-mode for module definitions
Browse files Browse the repository at this point in the history
  • Loading branch information
jimeh authored and joaotavora committed Aug 15, 2012
1 parent 5eede17 commit 064c068
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions snippets/ruby-mode/definitions/mod
@@ -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

0 comments on commit 064c068

Please sign in to comment.