summaryrefslogtreecommitdiffstats
path: root/emacs.d/snippets/text-mode/ruby-mode
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2009-10-22 05:30:58 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2009-10-22 05:30:58 +0200
commitc13334d651b13d8b047cb3dc35ad3e1ef239013f (patch)
treece0361f3bbbe502af91b33f896644d5695680223 /emacs.d/snippets/text-mode/ruby-mode
parentff21663ded2283850f175e6de619feb5da91fef4 (diff)
downloaddotfiles-c13334d651b13d8b047cb3dc35ad3e1ef239013f.tar.gz
dotfiles-c13334d651b13d8b047cb3dc35ad3e1ef239013f.tar.xz
dotfiles-c13334d651b13d8b047cb3dc35ad3e1ef239013f.zip
added snippets for loading with module from dotfiles
Diffstat (limited to '')
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/#4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/=b6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/Comp8
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/all4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/am4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/any4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/app6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/bm6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/case7
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/cla6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/classify4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/cls13
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/collect4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/dee4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/deli4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/det4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/dow6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/ea4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/eac4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/eai4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/eav4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/eawi4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/forin6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/if6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/ife8
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/inject4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/mm6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/r4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/rb4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/reject4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/req4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/rreq4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/rw4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/select4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/tim4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/until6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/upt6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/w4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/when6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/while6
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/y4
-rw-r--r--emacs.d/snippets/text-mode/ruby-mode/zip4
42 files changed, 212 insertions, 0 deletions
diff --git a/emacs.d/snippets/text-mode/ruby-mode/# b/emacs.d/snippets/text-mode/ruby-mode/#
new file mode 100644
index 0000000..33581c8
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/#
@@ -0,0 +1,4 @@
+#name : # =>
+#group : general
+# --
+# => \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/=b b/emacs.d/snippets/text-mode/ruby-mode/=b
new file mode 100644
index 0000000..22a013f
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/=b
@@ -0,0 +1,6 @@
+#name : =begin rdoc ... =end
+#group : general
+# --
+=begin rdoc
+ $0
+=end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/Comp b/emacs.d/snippets/text-mode/ruby-mode/Comp
new file mode 100644
index 0000000..03f2b35
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/Comp
@@ -0,0 +1,8 @@
+#name : include Comparable; def <=> ... end
+#group : definitions
+# --
+include Comparable
+
+def <=> other
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/all b/emacs.d/snippets/text-mode/ruby-mode/all
new file mode 100644
index 0000000..a98a9f4
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/all
@@ -0,0 +1,4 @@
+#name : all? { |...| ... }
+#group : collections
+# --
+all? { |${e}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/am b/emacs.d/snippets/text-mode/ruby-mode/am
new file mode 100644
index 0000000..7675a97
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/am
@@ -0,0 +1,4 @@
+#name : alias_method new, old
+#group : definitions
+# --
+alias_method :${new_name}, :${old_name} \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/any b/emacs.d/snippets/text-mode/ruby-mode/any
new file mode 100644
index 0000000..d0b6dd2
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/any
@@ -0,0 +1,4 @@
+#name : any? { |...| ... }
+#group : collections
+# --
+any? { |${e}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/app b/emacs.d/snippets/text-mode/ruby-mode/app
new file mode 100644
index 0000000..19bf60a
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/app
@@ -0,0 +1,6 @@
+#name : if __FILE__ == $PROGRAM_NAME ... end
+#group : general
+# --
+if __FILE__ == $PROGRAM_NAME
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/bm b/emacs.d/snippets/text-mode/ruby-mode/bm
new file mode 100644
index 0000000..4789f64
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/bm
@@ -0,0 +1,6 @@
+#name : Benchmark.bmbm(...) do ... end
+#group : general
+# --
+Benchmark.bmbm(${1:10}) do |x|
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/case b/emacs.d/snippets/text-mode/ruby-mode/case
new file mode 100644
index 0000000..40c3529
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/case
@@ -0,0 +1,7 @@
+#name : case ... end
+#group : general
+# --
+case ${1:object}
+when ${2:condition}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/cla b/emacs.d/snippets/text-mode/ruby-mode/cla
new file mode 100644
index 0000000..81ccf45
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/cla
@@ -0,0 +1,6 @@
+#name : class << self ... end
+#group : definitions
+# --
+class << ${self}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/classify b/emacs.d/snippets/text-mode/ruby-mode/classify
new file mode 100644
index 0000000..2378afa
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/classify
@@ -0,0 +1,4 @@
+#name : classify { |...| ... }
+#group : collections
+# --
+classify { |${e}| $0 } \ No newline at end of file
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
diff --git a/emacs.d/snippets/text-mode/ruby-mode/collect b/emacs.d/snippets/text-mode/ruby-mode/collect
new file mode 100644
index 0000000..934014a
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/collect
@@ -0,0 +1,4 @@
+#name : collect { |...| ... }
+#group : collections
+# --
+collect { |${e}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/dee b/emacs.d/snippets/text-mode/ruby-mode/dee
new file mode 100644
index 0000000..56d0a18
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/dee
@@ -0,0 +1,4 @@
+#name : deep_copy(...)
+#group : general
+# --
+Marshal.load(Marshal.dump($0)) \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/deli b/emacs.d/snippets/text-mode/ruby-mode/deli
new file mode 100644
index 0000000..843b154
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/deli
@@ -0,0 +1,4 @@
+#name : delete_if { |...| ... }
+#group : collections
+# --
+delete_if { |${e} $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/det b/emacs.d/snippets/text-mode/ruby-mode/det
new file mode 100644
index 0000000..6a17da9
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/det
@@ -0,0 +1,4 @@
+#name : detect { |...| ... }
+#group : collections
+# --
+detect { |${e}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/dow b/emacs.d/snippets/text-mode/ruby-mode/dow
new file mode 100644
index 0000000..3b65271
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/dow
@@ -0,0 +1,6 @@
+#name : downto(...) { |n| ... }
+#group : control structure
+# --
+downto(${0}) { |${n}|
+ $0
+} \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/ea b/emacs.d/snippets/text-mode/ruby-mode/ea
new file mode 100644
index 0000000..9cdf8dc
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/ea
@@ -0,0 +1,4 @@
+#name : each { |...| ... }
+#group : collections
+# --
+each { |${e}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/eac b/emacs.d/snippets/text-mode/ruby-mode/eac
new file mode 100644
index 0000000..f0d9cb1
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/eac
@@ -0,0 +1,4 @@
+#name : each_cons(...) { |...| ... }
+#group : collections
+# --
+each_cons(${1:2}) { |${group}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/eai b/emacs.d/snippets/text-mode/ruby-mode/eai
new file mode 100644
index 0000000..5b0ed67
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/eai
@@ -0,0 +1,4 @@
+#name : each_index { |i| ... }
+#group : collections
+# --
+each_index { |${i}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/eav b/emacs.d/snippets/text-mode/ruby-mode/eav
new file mode 100644
index 0000000..558e5b4
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/eav
@@ -0,0 +1,4 @@
+#name : each_value { |val| ... }
+#group : collections
+# --
+each_value { |${val}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/eawi b/emacs.d/snippets/text-mode/ruby-mode/eawi
new file mode 100644
index 0000000..edf8418
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/eawi
@@ -0,0 +1,4 @@
+#name : each_with_index { |e, i| ... }
+#group : collections
+# --
+each_with_index { |${e}, ${i}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/forin b/emacs.d/snippets/text-mode/ruby-mode/forin
new file mode 100644
index 0000000..36b4387
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/forin
@@ -0,0 +1,6 @@
+#name : for ... in ...; ... end
+#group : control structure
+# --
+for ${1:element} in ${2:collection}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/if b/emacs.d/snippets/text-mode/ruby-mode/if
new file mode 100644
index 0000000..077b097
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/if
@@ -0,0 +1,6 @@
+#name : if ... end
+#group : control structure
+# --
+if ${1:condition}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/ife b/emacs.d/snippets/text-mode/ruby-mode/ife
new file mode 100644
index 0000000..e57d395
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/ife
@@ -0,0 +1,8 @@
+#name : if ... else ... end
+#group : control structure
+# --
+if ${1:condition}
+ $2
+else
+ $3
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/inject b/emacs.d/snippets/text-mode/ruby-mode/inject
new file mode 100644
index 0000000..37932e5
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/inject
@@ -0,0 +1,4 @@
+#name : inject(...) { |...| ... }
+#group : collections
+# --
+inject(${1:0}) { |${2:injection}, ${3:element}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/mm b/emacs.d/snippets/text-mode/ruby-mode/mm
new file mode 100644
index 0000000..3f62b10
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/mm
@@ -0,0 +1,6 @@
+#name : def method_missing ... end
+#group : definitions
+# --
+def method_missing(method, *args)
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/r b/emacs.d/snippets/text-mode/ruby-mode/r
new file mode 100644
index 0000000..2e7b797
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/r
@@ -0,0 +1,4 @@
+#name : attr_reader ...
+#group : definitions
+# --
+attr_reader : \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/rb b/emacs.d/snippets/text-mode/ruby-mode/rb
new file mode 100644
index 0000000..74d26dd
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/rb
@@ -0,0 +1,4 @@
+#name : /usr/bin/ruby -wKU
+#group : general
+# --
+#!/usr/bin/ruby -wKU
diff --git a/emacs.d/snippets/text-mode/ruby-mode/reject b/emacs.d/snippets/text-mode/ruby-mode/reject
new file mode 100644
index 0000000..c2501bc
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/reject
@@ -0,0 +1,4 @@
+#name : reject { |...| ... }
+#group : collections
+# --
+reject { |${1:element}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/req b/emacs.d/snippets/text-mode/ruby-mode/req
new file mode 100644
index 0000000..3e001ec
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/req
@@ -0,0 +1,4 @@
+#name : require "..."
+#group : general
+# --
+require "$0" \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/rreq b/emacs.d/snippets/text-mode/ruby-mode/rreq
new file mode 100644
index 0000000..0b9c6a4
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/rreq
@@ -0,0 +1,4 @@
+#name : require File.join(File.dirname(__FILE__), ...)
+#group : general
+# --
+require File.join(File.dirname(__FILE__), $0) \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/rw b/emacs.d/snippets/text-mode/ruby-mode/rw
new file mode 100644
index 0000000..a364675
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/rw
@@ -0,0 +1,4 @@
+#name : attr_accessor ...
+#group : definitions
+# --
+attr_accessor : \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/select b/emacs.d/snippets/text-mode/ruby-mode/select
new file mode 100644
index 0000000..78bca8f
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/select
@@ -0,0 +1,4 @@
+#name : select { |...| ... }
+#group : collections
+# --
+select { |${1:element}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/tim b/emacs.d/snippets/text-mode/ruby-mode/tim
new file mode 100644
index 0000000..0da115f
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/tim
@@ -0,0 +1,4 @@
+#name : times { |n| ... }
+#group : control structure
+# --
+times { |${n}| $0 } \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/until b/emacs.d/snippets/text-mode/ruby-mode/until
new file mode 100644
index 0000000..476966a
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/until
@@ -0,0 +1,6 @@
+#name : until ... end
+#group: control structure
+# --
+until ${condition}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/upt b/emacs.d/snippets/text-mode/ruby-mode/upt
new file mode 100644
index 0000000..6fc6810
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/upt
@@ -0,0 +1,6 @@
+#name : upto(...) { |n| ... }
+#group : control structure
+# --
+upto(${n}) { |${i}|
+ $0
+} \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/w b/emacs.d/snippets/text-mode/ruby-mode/w
new file mode 100644
index 0000000..9edbfcb
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/w
@@ -0,0 +1,4 @@
+#name : attr_writer ...
+#group : definitions
+# --
+attr_writer : \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/when b/emacs.d/snippets/text-mode/ruby-mode/when
new file mode 100644
index 0000000..9b06f21
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/when
@@ -0,0 +1,6 @@
+#name : when ... end
+#group : control structure
+# --
+when ${condition}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/while b/emacs.d/snippets/text-mode/ruby-mode/while
new file mode 100644
index 0000000..4c9ad35
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/while
@@ -0,0 +1,6 @@
+#name : while ... end
+#group : control structure
+# --
+while ${condition}
+ $0
+end \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/y b/emacs.d/snippets/text-mode/ruby-mode/y
new file mode 100644
index 0000000..0ddf0f9
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/y
@@ -0,0 +1,4 @@
+#name : :yields: arguments (rdoc)
+#group : general
+# --
+:yields: $0 \ No newline at end of file
diff --git a/emacs.d/snippets/text-mode/ruby-mode/zip b/emacs.d/snippets/text-mode/ruby-mode/zip
new file mode 100644
index 0000000..56f4266
--- /dev/null
+++ b/emacs.d/snippets/text-mode/ruby-mode/zip
@@ -0,0 +1,4 @@
+#name : zip(...) { |...| ... }
+#group : collections
+# --
+zip(${enums}) { |${row}| $0 } \ No newline at end of file