summaryrefslogtreecommitdiffstats
path: root/emacs.d/snippets/text-mode/ruby-mode/cls
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/cls13
1 files changed, 13 insertions, 0 deletions
diff --git a/emacs.d/snippets/text-mode/ruby-mode/cls b/emacs.d/snippets/text-mode/ruby-mode/cls
new file mode 100644
index 0000000..da28fb7
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/cls
@@ -0,0 +1,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