mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-16 10:24:18 +00:00
restructuring classic snippets dir to conform to new parenting specs
This commit is contained in:
4
snippets/ruby-mode/#
Normal file
4
snippets/ruby-mode/#
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : # =>
|
||||
#group : general
|
||||
# --
|
||||
# =>
|
||||
1
snippets/ruby-mode/.yas-parents
Normal file
1
snippets/ruby-mode/.yas-parents
Normal file
@@ -0,0 +1 @@
|
||||
text-mode
|
||||
6
snippets/ruby-mode/=b
Normal file
6
snippets/ruby-mode/=b
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : =begin rdoc ... =end
|
||||
#group : general
|
||||
# --
|
||||
=begin rdoc
|
||||
$0
|
||||
=end
|
||||
8
snippets/ruby-mode/Comp
Normal file
8
snippets/ruby-mode/Comp
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : include Comparable; def <=> ... end
|
||||
#group : definitions
|
||||
# --
|
||||
include Comparable
|
||||
|
||||
def <=> other
|
||||
$0
|
||||
end
|
||||
4
snippets/ruby-mode/all
Normal file
4
snippets/ruby-mode/all
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : all? { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
all? { |${e}| $0 }
|
||||
4
snippets/ruby-mode/am
Normal file
4
snippets/ruby-mode/am
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : alias_method new, old
|
||||
#group : definitions
|
||||
# --
|
||||
alias_method :${new_name}, :${old_name}
|
||||
4
snippets/ruby-mode/any
Normal file
4
snippets/ruby-mode/any
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : any? { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
any? { |${e}| $0 }
|
||||
6
snippets/ruby-mode/app
Normal file
6
snippets/ruby-mode/app
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : if __FILE__ == $PROGRAM_NAME ... end
|
||||
#group : general
|
||||
# --
|
||||
if __FILE__ == $PROGRAM_NAME
|
||||
$0
|
||||
end
|
||||
6
snippets/ruby-mode/bm
Normal file
6
snippets/ruby-mode/bm
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : Benchmark.bmbm(...) do ... end
|
||||
#group : general
|
||||
# --
|
||||
Benchmark.bmbm(${1:10}) do |x|
|
||||
$0
|
||||
end
|
||||
7
snippets/ruby-mode/case
Normal file
7
snippets/ruby-mode/case
Normal file
@@ -0,0 +1,7 @@
|
||||
#name : case ... end
|
||||
#group : general
|
||||
# --
|
||||
case ${1:object}
|
||||
when ${2:condition}
|
||||
$0
|
||||
end
|
||||
6
snippets/ruby-mode/cla
Normal file
6
snippets/ruby-mode/cla
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : class << self ... end
|
||||
#group : definitions
|
||||
# --
|
||||
class << ${self}
|
||||
$0
|
||||
end
|
||||
4
snippets/ruby-mode/classify
Normal file
4
snippets/ruby-mode/classify
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : classify { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
classify { |${e}| $0 }
|
||||
13
snippets/ruby-mode/cls
Normal file
13
snippets/ruby-mode/cls
Normal file
@@ -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
|
||||
4
snippets/ruby-mode/collect
Normal file
4
snippets/ruby-mode/collect
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : collect { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
collect { |${e}| $0 }
|
||||
4
snippets/ruby-mode/dee
Normal file
4
snippets/ruby-mode/dee
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : deep_copy(...)
|
||||
#group : general
|
||||
# --
|
||||
Marshal.load(Marshal.dump($0))
|
||||
4
snippets/ruby-mode/deli
Normal file
4
snippets/ruby-mode/deli
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : delete_if { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
delete_if { |${e} $0 }
|
||||
4
snippets/ruby-mode/det
Normal file
4
snippets/ruby-mode/det
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : detect { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
detect { |${e}| $0 }
|
||||
6
snippets/ruby-mode/dow
Normal file
6
snippets/ruby-mode/dow
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : downto(...) { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
downto(${0}) { |${n}|
|
||||
$0
|
||||
}
|
||||
4
snippets/ruby-mode/ea
Normal file
4
snippets/ruby-mode/ea
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : each { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each { |${e}| $0 }
|
||||
4
snippets/ruby-mode/eac
Normal file
4
snippets/ruby-mode/eac
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : each_cons(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_cons(${1:2}) { |${group}| $0 }
|
||||
4
snippets/ruby-mode/eai
Normal file
4
snippets/ruby-mode/eai
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : each_index { |i| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_index { |${i}| $0 }
|
||||
4
snippets/ruby-mode/eav
Normal file
4
snippets/ruby-mode/eav
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : each_value { |val| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_value { |${val}| $0 }
|
||||
4
snippets/ruby-mode/eawi
Normal file
4
snippets/ruby-mode/eawi
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : each_with_index { |e, i| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_with_index { |${e}, ${i}| $0 }
|
||||
6
snippets/ruby-mode/forin
Normal file
6
snippets/ruby-mode/forin
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : for ... in ...; ... end
|
||||
#group : control structure
|
||||
# --
|
||||
for ${1:element} in ${2:collection}
|
||||
$0
|
||||
end
|
||||
6
snippets/ruby-mode/if
Normal file
6
snippets/ruby-mode/if
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : if ... end
|
||||
#group : control structure
|
||||
# --
|
||||
if ${1:condition}
|
||||
$0
|
||||
end
|
||||
8
snippets/ruby-mode/ife
Normal file
8
snippets/ruby-mode/ife
Normal file
@@ -0,0 +1,8 @@
|
||||
#name : if ... else ... end
|
||||
#group : control structure
|
||||
# --
|
||||
if ${1:condition}
|
||||
$2
|
||||
else
|
||||
$3
|
||||
end
|
||||
4
snippets/ruby-mode/inject
Normal file
4
snippets/ruby-mode/inject
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : inject(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
inject(${1:0}) { |${2:injection}, ${3:element}| $0 }
|
||||
6
snippets/ruby-mode/mm
Normal file
6
snippets/ruby-mode/mm
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : def method_missing ... end
|
||||
#group : definitions
|
||||
# --
|
||||
def method_missing(method, *args)
|
||||
$0
|
||||
end
|
||||
4
snippets/ruby-mode/r
Normal file
4
snippets/ruby-mode/r
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : attr_reader ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_reader :
|
||||
4
snippets/ruby-mode/rb
Normal file
4
snippets/ruby-mode/rb
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : /usr/bin/ruby -wKU
|
||||
#group : general
|
||||
# --
|
||||
#!/usr/bin/ruby -wKU
|
||||
4
snippets/ruby-mode/reject
Normal file
4
snippets/ruby-mode/reject
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : reject { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
reject { |${1:element}| $0 }
|
||||
4
snippets/ruby-mode/req
Normal file
4
snippets/ruby-mode/req
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : require "..."
|
||||
#group : general
|
||||
# --
|
||||
require "$0"
|
||||
4
snippets/ruby-mode/rreq
Normal file
4
snippets/ruby-mode/rreq
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : require File.join(File.dirname(__FILE__), ...)
|
||||
#group : general
|
||||
# --
|
||||
require File.join(File.dirname(__FILE__), $0)
|
||||
4
snippets/ruby-mode/rw
Normal file
4
snippets/ruby-mode/rw
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : attr_accessor ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_accessor :
|
||||
4
snippets/ruby-mode/select
Normal file
4
snippets/ruby-mode/select
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : select { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
select { |${1:element}| $0 }
|
||||
4
snippets/ruby-mode/tim
Normal file
4
snippets/ruby-mode/tim
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : times { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
times { |${n}| $0 }
|
||||
6
snippets/ruby-mode/until
Normal file
6
snippets/ruby-mode/until
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : until ... end
|
||||
#group: control structure
|
||||
# --
|
||||
until ${condition}
|
||||
$0
|
||||
end
|
||||
6
snippets/ruby-mode/upt
Normal file
6
snippets/ruby-mode/upt
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : upto(...) { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
upto(${n}) { |${i}|
|
||||
$0
|
||||
}
|
||||
4
snippets/ruby-mode/w
Normal file
4
snippets/ruby-mode/w
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : attr_writer ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_writer :
|
||||
6
snippets/ruby-mode/when
Normal file
6
snippets/ruby-mode/when
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : when ... end
|
||||
#group : control structure
|
||||
# --
|
||||
when ${condition}
|
||||
$0
|
||||
end
|
||||
6
snippets/ruby-mode/while
Normal file
6
snippets/ruby-mode/while
Normal file
@@ -0,0 +1,6 @@
|
||||
#name : while ... end
|
||||
#group : control structure
|
||||
# --
|
||||
while ${condition}
|
||||
$0
|
||||
end
|
||||
4
snippets/ruby-mode/y
Normal file
4
snippets/ruby-mode/y
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : :yields: arguments (rdoc)
|
||||
#group : general
|
||||
# --
|
||||
:yields: $0
|
||||
4
snippets/ruby-mode/zip
Normal file
4
snippets/ruby-mode/zip
Normal file
@@ -0,0 +1,4 @@
|
||||
#name : zip(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
zip(${enums}) { |${row}| $0 }
|
||||
Reference in New Issue
Block a user