Initial commit.
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
#name : # =>
|
||||
#group : general
|
||||
# --
|
||||
# =>
|
@@ -0,0 +1,6 @@
|
||||
#name : =begin rdoc ... =end
|
||||
#group : general
|
||||
# --
|
||||
=begin rdoc
|
||||
$0
|
||||
=end
|
@@ -0,0 +1,8 @@
|
||||
#name : include Comparable; def <=> ... end
|
||||
#group : definitions
|
||||
# --
|
||||
include Comparable
|
||||
|
||||
def <=> other
|
||||
$0
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: GLOB
|
||||
# key: $
|
||||
# --
|
||||
$${1:GLOBAL} = $0
|
@@ -0,0 +1,4 @@
|
||||
#name : all? { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
all? { |${e}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : alias_method new, old
|
||||
#group : definitions
|
||||
# --
|
||||
alias_method :${new_name}, :${old_name}
|
@@ -0,0 +1,4 @@
|
||||
#name : any? { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
any? { |${e}| $0 }
|
@@ -0,0 +1,6 @@
|
||||
#name : if __FILE__ == $PROGRAM_NAME ... end
|
||||
#group : general
|
||||
# --
|
||||
if __FILE__ == $PROGRAM_NAME
|
||||
$0
|
||||
end
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: attribute
|
||||
# key: @
|
||||
# --
|
||||
@${1:attr} = $0
|
@@ -0,0 +1,10 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: bench
|
||||
# key: bench
|
||||
# --
|
||||
require "benchmark"
|
||||
|
||||
TESTS = ${1:1_000}
|
||||
Benchmark.bmbm do |x|
|
||||
x.report("${2:var}") {}
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : Benchmark.bmbm(...) do ... end
|
||||
#group : general
|
||||
# --
|
||||
Benchmark.bmbm(${1:10}) do |x|
|
||||
$0
|
||||
end
|
@@ -0,0 +1,7 @@
|
||||
#name : case ... end
|
||||
#group : general
|
||||
# --
|
||||
case ${1:object}
|
||||
when ${2:condition}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : class << self ... end
|
||||
#group : definitions
|
||||
# --
|
||||
class << ${self}
|
||||
$0
|
||||
end
|
11
.emacs.d/elpa/yasnippet-20160131.948/snippets/ruby-mode/cls
Normal file
11
.emacs.d/elpa/yasnippet-20160131.948/snippets/ruby-mode/cls
Normal file
@@ -0,0 +1,11 @@
|
||||
#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))))))))
|
||||
(replace-regexp-in-string "_" "" fn t t))`}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : collect { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
collect { |${e}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : deep_copy(...)
|
||||
#group : general
|
||||
# --
|
||||
Marshal.load(Marshal.dump($0))
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: def ... end
|
||||
# key: def
|
||||
# --
|
||||
def ${1:method}${2:(${3:args})}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : delete_if { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
delete_if { |${e}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : detect { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
detect { |${e}| $0 }
|
@@ -0,0 +1,6 @@
|
||||
#name : downto(...) { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
downto(${0}) { |${n}|
|
||||
$0
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
#name : each { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each { |${e}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : each_cons(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_cons(${1:2}) { |${group}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : each_index { |i| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_index { |${i}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : each_value { |val| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_value { |${val}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : each_with_index { |e, i| ... }
|
||||
#group : collections
|
||||
# --
|
||||
each_with_index { |${e}, ${i}| $0 }
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: for
|
||||
# key: for
|
||||
# --
|
||||
for ${1:el} in ${2:collection}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : for ... in ...; ... end
|
||||
#group : control structure
|
||||
# --
|
||||
for ${1:element} in ${2:collection}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,16 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: formula
|
||||
# key: form
|
||||
# --
|
||||
require 'formula'
|
||||
|
||||
class ${1:Name} <Formula
|
||||
url '${2:url}'
|
||||
homepage '${3:home}'
|
||||
md5 '${4:md5}'
|
||||
|
||||
def install
|
||||
${5:system "./configure"}
|
||||
$0
|
||||
end
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : if ... end
|
||||
#group : control structure
|
||||
# --
|
||||
if ${1:condition}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,8 @@
|
||||
#name : if ... else ... end
|
||||
#group : control structure
|
||||
# --
|
||||
if ${1:condition}
|
||||
$2
|
||||
else
|
||||
$3
|
||||
end
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: init
|
||||
# key: init
|
||||
# --
|
||||
def initialize(${1:args})
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : inject(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
inject(${1:0}) { |${2:injection}, ${3:element}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : map { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
map { |${e}| $0 }
|
@@ -0,0 +1,6 @@
|
||||
#name : def method_missing ... end
|
||||
#group : definitions
|
||||
# --
|
||||
def method_missing(method, *args)
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : attr_reader ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_reader :
|
@@ -0,0 +1,4 @@
|
||||
#name : /usr/bin/ruby -wU
|
||||
#group : general
|
||||
# --
|
||||
#!/usr/bin/ruby -wU
|
@@ -0,0 +1,4 @@
|
||||
#name : reduce(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
reduce(${1:0}) { |${2:accumulator}, ${3:element}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : reject { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
reject { |${1:element}| $0 }
|
@@ -0,0 +1,4 @@
|
||||
#name : require_relative
|
||||
#group : general
|
||||
# --
|
||||
require_relative '$0'
|
@@ -0,0 +1,4 @@
|
||||
#name : require "..."
|
||||
#group : general
|
||||
# --
|
||||
require '$0'
|
@@ -0,0 +1,4 @@
|
||||
#name : attr_accessor ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_accessor :
|
@@ -0,0 +1,4 @@
|
||||
#name : select { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
select { |${1:element}| $0 }
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: str
|
||||
# key: s
|
||||
# --
|
||||
#{$0}
|
@@ -0,0 +1,7 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: test class
|
||||
# key: tc
|
||||
# --
|
||||
class TC_${1:Class} < Test::Unit::TestCase
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : times { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
times { |${n}| $0 }
|
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: to_
|
||||
# key: to_
|
||||
# --
|
||||
def to_s
|
||||
"${1:string}"
|
||||
end
|
||||
$0
|
@@ -0,0 +1,5 @@
|
||||
# -*- mode: snippet -*-
|
||||
# name: tu
|
||||
# key: tu
|
||||
# --
|
||||
require 'test/unit'
|
@@ -0,0 +1,6 @@
|
||||
#name : until ... end
|
||||
#group: control structure
|
||||
# --
|
||||
until ${condition}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : upto(...) { |n| ... }
|
||||
#group : control structure
|
||||
# --
|
||||
upto(${n}) { |${i}|
|
||||
$0
|
||||
}
|
@@ -0,0 +1,4 @@
|
||||
#name : attr_writer ...
|
||||
#group : definitions
|
||||
# --
|
||||
attr_writer :
|
@@ -0,0 +1,6 @@
|
||||
#name : when ... end
|
||||
#group : control structure
|
||||
# --
|
||||
when ${condition}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,6 @@
|
||||
#name : while ... end
|
||||
#group : control structure
|
||||
# --
|
||||
while ${condition}
|
||||
$0
|
||||
end
|
@@ -0,0 +1,4 @@
|
||||
#name : :yields: arguments (rdoc)
|
||||
#group : general
|
||||
# --
|
||||
:yields: $0
|
@@ -0,0 +1,4 @@
|
||||
#name : zip(...) { |...| ... }
|
||||
#group : collections
|
||||
# --
|
||||
zip(${enums}) { |${row}| $0 }
|
Reference in New Issue
Block a user