]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/yasnippet/snippets/ruby-mode/definitions/cls
Add yasnippet.
[gnu-emacs-elpa] / packages / yasnippet / snippets / ruby-mode / definitions / cls
diff --git a/packages/yasnippet/snippets/ruby-mode/definitions/cls b/packages/yasnippet/snippets/ruby-mode/definitions/cls
new file mode 100644 (file)
index 0000000..19754a7
--- /dev/null
@@ -0,0 +1,13 @@
+# 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
\ No newline at end of file