* Start again the textmate snippet importations, with better

textmate_import.rb and yasnippet.el
This commit is contained in:
capitaomorte
2010-04-01 11:41:19 +00:00
parent 6b07c4b1d6
commit 5d9f7fb6b4
939 changed files with 0 additions and 7031 deletions

View File

@@ -1 +0,0 @@
text-mode

View File

@@ -1,50 +0,0 @@
(defvar yas/ruby-snippet-open-paren " "
"The open parenthesis used in ruby-mode snippets. Normally blank but could be (")
(defvar yas/ruby-snippet-close-paren " "
"The close parenthesis used in ruby-mode snippets. Normally blank but could be )")
(defun yas/ruby-snippet-paren (&optional arg)
"Defaults to returning the open paren. If arg equals t then shows close paren."
(if arg
yas/ruby-snippet-close-paren
yas/ruby-snippet-open-paren))
(defvar yas/ruby-shebang-args " -wKU"
"Arguments for the ruby shebang line.")
(defun yas/ruby-infer-class-name ()
"Infer the class name from the buffer. Thanks to hitesh <hitesh.jasani@gmail.com>"
(let ((fn (capitalize (file-name-nondirectory
(file-name-sans-extension
(buffer-file-name))))))
(cond
((string-match "_" fn) (replace-match "" nil nil fn))
(t fn))))
(defun yas/ruby-toggle-single-multi-line-block ()
(interactive)
(save-excursion
(let* ((block-start (progn (ruby-beginning-of-block) (point)))
(block-end (progn (ruby-end-of-block) (forward-word)(point))))
(when (and block-start
block-end)
(goto-char block-start)
(cond ((not (eq (line-number-at-pos block-end)
(line-number-at-pos block-start)))
(when (looking-at ".*[^\w]\\(do\\)[^\w]\\(|.*|\\)?")
(goto-char block-end)
(insert "}")
(goto-char block-start)
(replace-regexp "do" "{" t block-start (line-end-position))))
(t
(replace-regexp "\\(.*\\){[^w]\\(|.*|\\)" "\1do \2\n" nil block-start block-end)))))))
;; conditions
;;
(yas/define-condition-cache yas/ruby-in-interpolated-string-p (member (fourth (syntax-ppss)) (list ?\" ?\`)))
(yas/define-condition-cache yas/ruby-in-comment-p (fifth (syntax-ppss)))
(yas/define-condition-cache yas/ruby-in-string-p (fourth (syntax-ppss)))
(yas/define-condition-cache yas/ruby-end-is-block-end-p
(save-excursion
(ruby-backward-sexp)
(not (eq (point) (point-min)))))

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: Array
# contributor: Translated from TextMate Snippet
# name: Array.new(10) { |i| .. }
## condition: "source.ruby"
# --
Array.new(${1:10}) { ${2:$(if (string= yas/text "") "" "|")}${2:i}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: deli
# contributor: Translated from TextMate Snippet
# name: delete_if { |e| .. }
## condition: "source.ruby"
# --
delete_if { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: fil
# contributor: Translated from TextMate Snippet
# name: fill(range) { |i| .. }
## condition: "source.ruby"
# --
fill(${1:range}) { ${2:$(if (string= yas/text "") "" "|")}${2:variable}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: flao
# contributor: Translated from TextMate Snippet
# name: flatten_once()
## condition: "source.ruby"
# --
inject(Array.new) { | ${1:arr}, ${2:a}| $1.push(*$2) }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: zip
# contributor: Translated from TextMate Snippet
# name: zip(enums) { |row| .. }
## condition: "source.ruby"
# --
zip(${1:enums}) { |${2:row}| $0 }

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: do
# contributor: Translated from TextMate Snippet
# name: Insert do |variable| … end
## condition: "source.ruby"
# --
do ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")}
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: lam
# contributor: Translated from TextMate Snippet
# name: lambda { |args| .. }
## condition: "source.ruby"
# --
lambda { ${1:$(if (string= yas/text "") "" "|")}${1:args}${1:$(if (string= yas/text "") "" "|")}$0 }

View File

@@ -1,13 +0,0 @@
# -*- mode: snippet -*-
# type: command
# key: {
# contributor: Translated from TextMate Snippet
# name: Insert { |variable| … }
# condition: (not (or (yas/ruby-in-comment-p) (yas/ruby-in-string-p)))
# --
(yas/expand-snippet (concat
"{ ${1:$(if (string= yas/text \"\") \"\" \"|\")}${1:variable}${1:$(if (string= yas/text \"\") \" \" \"| \")}`yas/selected-text`$0"
(save-excursion (if (search-forward-regexp "}" (line-end-position) t)
"" "}"))))

View File

@@ -1,12 +0,0 @@
# -*- mode: snippet -*-
# key: cla-
# contributor: Translated from TextMate Snippet
# name: class .. < DelegateClass .. initialize .. end
## condition: "source.ruby"
# --
class ${1:`(yas/ruby-infer-class-name)`} < DelegateClass(${2:ParentClass})
def initialize${3:$(if (string= yas/text "") "" "(")}${3:args}${3:$(if (string= yas/text "") "" ")")}
super(${4:del_obj})
$0
end
end

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: class .. < ParentClass .. initialize .. end
## condition: "source.ruby"
# --
class ${1:`(yas/ruby-infer-class-name)`} < ${2:ParentClass}
def initialize${3:$(if (string= yas/text "") "" "(")}${3:args}${3:$(if (string= yas/text "") "" ")")}
$0
end
end

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: ClassName = Struct .. do .. end
## condition: "source.ruby"
# --
${1:`(yas/ruby-infer-class-name)`} = Struct.new(:${2:attr_names}) do
def ${3:method_name}
$0
end
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: class .. end
## condition: "source.ruby"
# --
class ${1:`(yas/ruby-infer-class-name)`}
$0
end

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: class .. initialize .. end
## condition: "source.ruby"
# --
class ${1:`(yas/ruby-infer-class-name)`}
def initialize${2:$(if (string= yas/text "") "" "(")}${2:args}${2:$(if (string= yas/text "") "" ")")}
$0
end
end

View File

@@ -1,21 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: class BlankSlate .. initialize .. end
## condition: "source.ruby"
# --
class ${1:BlankSlate}
instance_methods.each { |meth| undef_method(meth) unless meth =~ /\A__/ }
def initialize${2:$(if (string= yas/text "") "" "(")}${2:args}${2:$(if (string= yas/text "") "" ")")}
@${3:delegate} = ${4:delegate_object}
$0
end
def method_missing(meth, *args, &block)
@$3.send(meth, *args, &block)
end
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: cla
# contributor: Translated from TextMate Snippet
# name: class << self .. end
## condition: "source.ruby"
# --
class << ${1:self}
$0
end

View File

@@ -1,20 +0,0 @@
# -*- mode: snippet -*-
# key: mod
# contributor: Translated from TextMate Snippet
# name: module .. ClassMethods .. end
## condition: "source.ruby"
# --
module ${1:`(yas/ruby-infer-class-name)`}
module ClassMethods
$0
end
module InstanceMethods
end
def self.included(receiver)
receiver.extend ClassMethods
receiver.send :include, InstanceMethods
end
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: mod
# contributor: Translated from TextMate Snippet
# name: module .. end
## condition: "source.ruby"
# --
module ${1:`(yas/ruby-infer-class-name)`}
$0
end

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: mod
# contributor: Translated from TextMate Snippet
# name: module .. module_function .. end
## condition: "source.ruby"
# --
module ${1:`(yas/ruby-infer-class-name)`}
module_function
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: dow
# contributor: Translated from TextMate Snippet
# name: downto(0) { |n| .. }
## condition: "source.ruby"
# --
downto(${1:0}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: loo
# contributor: Translated from TextMate Snippet
# name: loop { .. }
## condition: "source.ruby"
# --
loop { $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: ste
# contributor: Translated from TextMate Snippet
# name: step(2) { |e| .. }
## condition: "source.ruby"
# --
step(${1:2}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: tim
# contributor: Translated from TextMate Snippet
# name: times { |n| .. }
## condition: "source.ruby"
# --
times { ${1:$(if (string= yas/text "") "" "|")}${1:n}${1:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: upt
# contributor: Translated from TextMate Snippet
# name: upto(1.0/0.0) { |n| .. }
## condition: "source.ruby"
# --
upto(${1:1.0/0.0}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: ife
# contributor: Translated from TextMate Snippet
# name: if … else … end
## condition: "source.ruby"
# --
if ${1:condition}
$2
else
$3
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: if
# contributor: Translated from TextMate Snippet
# name: if … end
## condition: "source.ruby"
# --
if ${1:condition}
$0
end

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# key: case
# contributor: Translated from TextMate Snippet
# name: case … end
## condition: "source.ruby"
# --
case ${1:object}
when ${2:condition}
$0
end

View File

@@ -1,17 +0,0 @@
# -*- mode: snippet -*-
# key: begin
# contributor: Translated from TextMate Snippet
# name: begin … rescue … end
## binding: "C-c C-w"
# condition: (not (yas/ruby-in-comment-p))
# --
begin
`(or yas/selected-text
(and cua-mode
(prog1
(get-register ?0)
(set-register ?0 nil)))
(car kill-ring))`$3
rescue ${1:Exception}${2:$(if (string= yas/text "") "" " => ")}${2:e}
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: end
# contributor: Translated from TextMate Snippet
# name: __END__
# condition: (not (yas/ruby-end-is-block-end-p))
# --
__END__

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: app
# contributor: Translated from TextMate Snippet
# name: application { .. }
## condition: "source.ruby"
# --
if __FILE__ == \$PROGRAM_NAME
$0
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: def
# contributor: Translated from TextMate Snippet
# name: def … end
## condition: "source.ruby"
# --
def ${1:method_name}
$0
end

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# key: elsif
# contributor: Translated from TextMate Snippet
# name: elsif ...
## condition: "source.ruby"
# --
elsif ${1:condition}
$0

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: req
# contributor: Translated from TextMate Snippet
# name: require ".."
## condition: "source.ruby"
# --
require "$0"

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: reqg-
# contributor: Translated from TextMate Snippet
# name: require_gem ".."
## condition: "source.ruby"
# --
require "$0"

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: unless
# contributor: Translated from TextMate Snippet
# name: unless … end
## condition: "source.ruby"
# --
unless ${1:condition}
$0
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: until
# contributor: Translated from TextMate Snippet
# name: until ... end
## condition: "source.ruby"
# --
until ${1:condition}
$0
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: usai
# contributor: Translated from TextMate Snippet
# name: usage_if()
## condition: "source.ruby"
# --
if ARGV.$1
abort "Usage: #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}"
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: usau
# contributor: Translated from TextMate Snippet
# name: usage_unless()
## condition: "source.ruby"
# --
unless ARGV.$1
abort "Usage: #{\$PROGRAM_NAME} ${2:ARGS_GO_HERE}"
end

View File

@@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# key: rb
# contributor: Translated from TextMate Snippet
# name: #!/usr/bin/env ruby
# --
#!/usr/bin/env ruby`yas/ruby-shebang-args`

View File

@@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# key: rb
# contributor: Translated from TextMate Snippet
# name: #!/usr/bin/ruby
# --
#!/usr/bin/ruby`yas/ruby-shebang-args`

View File

@@ -1,6 +0,0 @@
# -*- mode: snippet -*-
# key: rb
# contributor: Translated from TextMate Snippet
# name: #!/usr/bin/local/ruby
# --
#!/usr/local/bin/ruby`yas/ruby-shebang-args`

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# key: when
# contributor: Translated from TextMate Snippet
# name: when …
## condition: "source.ruby"
# --
when ${1:condition}
$0

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: while
# contributor: Translated from TextMate Snippet
# name: while ... end
## condition: "source.ruby"
# --
while ${1:condition}
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: ea
# contributor: Translated from TextMate Snippet
# name: each { |e| .. }
## condition: "source.ruby"
# --
each { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eab
# contributor: Translated from TextMate Snippet
# name: each_byte { |byte| .. }
## condition: "source.ruby"
# --
each_byte { |${1:byte}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eac-
# contributor: Translated from TextMate Snippet
# name: each_char { |chr| .. }
## condition: "source.ruby"
# --
each_char { |${1:chr}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eac-
# contributor: Translated from TextMate Snippet
# name: each_cons(..) { |group| .. }
## condition: "source.ruby"
# --
each_cons(${1:2}) { |${2:group}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eai
# contributor: Translated from TextMate Snippet
# name: each_index { |i| .. }
## condition: "source.ruby"
# --
each_index { |${1:i}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eak
# contributor: Translated from TextMate Snippet
# name: each_key { |key| .. }
## condition: "source.ruby"
# --
each_key { |${1:key}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eal
# contributor: Translated from TextMate Snippet
# name: each_line { |line| .. }
## condition: "source.ruby"
# --
each_line$1 { |${2:line}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eap
# contributor: Translated from TextMate Snippet
# name: each_pair { |name, val| .. }
## condition: "source.ruby"
# --
each_pair { |${1:name}, ${2:val}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eas-
# contributor: Translated from TextMate Snippet
# name: each_slice(..) { |group| .. }
## condition: "source.ruby"
# --
each_slice(${1:2}) { |${2:group}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eav
# contributor: Translated from TextMate Snippet
# name: each_value { |val| .. }
## condition: "source.ruby"
# --
each_value { |${1:val}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: eawi
# contributor: Translated from TextMate Snippet
# name: each_with_index { |e, i| .. }
## condition: "source.ruby"
# --
each_with_index { |${1:e}, ${2:i}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: inj
# contributor: Translated from TextMate Snippet
# name: inject(init) { |mem, var| .. }
## condition: "source.ruby"
# --
inject${1:$(if (string= yas/text "") "" "(")}${1:init}${1:$(if (string= yas/text "") "" ")")} { |${2:mem}, ${3:var}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: map
# contributor: Translated from TextMate Snippet
# name: map { |e| .. }
## condition: "source.ruby"
# --
map { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: mapwi-
# contributor: Translated from TextMate Snippet
# name: map_with_index { |e, i| .. }
## condition: "source.ruby"
# --
enum_with_index.map { |${1:e}, ${2:i}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: reve
# contributor: Translated from TextMate Snippet
# name: reverse_each { |e| .. }
## condition: "source.ruby"
# --
reverse_each { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: Dir
# contributor: Translated from TextMate Snippet
# name: Dir.glob("..") { |file| .. }
## condition: "source.ruby"
# --
Dir.glob(${1:"${2:dir/glob/*}"}) { |${3:file}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: Dir
# contributor: Translated from TextMate Snippet
# name: Dir[".."]
## condition: "source.ruby"
# --
Dir[${1:"${2:glob/**/*.rb}"}]

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: File
# contributor: Translated from TextMate Snippet
# name: File.foreach ("..") { |line| .. }
## condition: "source.ruby"
# --
File.foreach(${1:"${2:path/to/file}"}) { |${3:line}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: File
# contributor: Translated from TextMate Snippet
# name: File.open("..") { |file| .. }
## condition: "source.ruby"
# --
File.open(${1:"${2:path/to/file}"}${3:$(if (string-match "^[rwab+]+$" yas/text) ", '" "")}${3:w}${3:$(if (string-match "^[rwab+]+$" yas/text) "'" "")}) { |${4:file}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: File
# contributor: Translated from TextMate Snippet
# name: File.read("..")
## condition: "source.ruby"
# --
File.read(${1:"${2:path/to/file}"})

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: dir
# contributor: Translated from TextMate Snippet
# name: directory()
## condition: "source.ruby"
# --
File.dirname(__FILE__)

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: ope
# contributor: Translated from TextMate Snippet
# name: open("path/or/url", "w") { |io| .. }
## condition: "source.ruby"
# --
open(${1:"${2:path/or/url/or/pipe}"}${3:$(if (string-match "^[rwab+]+$" yas/text) ", '" "")}${3:w}${3:$(if (string-match "^[rwab+]+$" yas/text) "'" "")}) { |${4:io}| $0 }

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# key: opt
# contributor: Translated from TextMate Snippet
# name: option(..)
## condition: "source.ruby"
# --
opts.on( "-${1:o}", "--${2:long-option-name}"${3:$(if (string= yas/text "") "" ", ")}${3:String},
"${4:Option description.}" ) do |${6:opt}|
$0
end

View File

@@ -1,33 +0,0 @@
# -*- mode: snippet -*-
# key: optp
# contributor: Translated from TextMate Snippet
# name: option_parse { .. }
## condition: "source.ruby"
# --
require "optparse"
options = {${1::default => "args"}}
ARGV.options do |opts|
opts.banner = "Usage: #{File.basename(\$PROGRAM_NAME)} [OPTIONS]${2:$(if (string= yas/text "") "" " ")}${2:OTHER_ARGS}"
opts.separator ""
opts.separator "Specific Options:"
$0
opts.separator "Common Options:"
opts.on( "-h", "--help",
"Show this message." ) do
puts opts
exit
end
begin
opts.parse!
rescue
puts opts
exit
end
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: patfh
# contributor: Translated from TextMate Snippet
# name: path_from_here( .. )
## condition: "source.ruby"
# --
File.join(File.dirname(__FILE__), *%w[${1:rel path here}])

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: unif
# contributor: Translated from TextMate Snippet
# name: unix_filter { .. }
## condition: "source.ruby"
# --
ARGF.each_line$1 do |${2:line}|
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: Hash
# contributor: Translated from TextMate Snippet
# name: Hash.new { |hash, key| hash[key] = .. }
## condition: "source.ruby"
# --
Hash.new { |${1:hash}, ${2:key}| ${1:hash}[${2:key}] = $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: :
# contributor: Translated from TextMate Snippet
# name: Hash Pair — :key => "value"
## condition: "source.ruby"
# --
:${1:key} => ${2:"${3:value}"}${4:, }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# contributor: Translated from TextMate Snippet
# name: Hash Pointer — =>
## binding: "^l"
## condition: "source.ruby"
# --
=>

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: clafn
# contributor: Translated from TextMate Snippet
# name: class_from_name()
## condition: "source.ruby"
# --
split("::").inject(Object) { |par, const| par.const_get(const) }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: deec
# contributor: Translated from TextMate Snippet
# name: deep_copy(..)
## condition: "source.ruby"
# --
Marshal.load(Marshal.dump(${0:obj_to_copy}))

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: sinc
# contributor: Translated from TextMate Snippet
# name: singleton_class()
## condition: "source.ruby"
# --
class << self; self end

View File

@@ -1,8 +0,0 @@
# -*- mode: snippet -*-
# contributor: Translated from TextMate Snippet
# name: Insert ERbs <% .. %> or <%= .. %>
# expand-env: ((yas/wrap-around-region t))
## binding: "C-c <"
## condition: "text.html, source.yaml, meta.erb"
# --
<%= $0 %>

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: am
# contributor: Translated from TextMate Snippet
# name: alias_method ..
## condition: "source.ruby"
# --
alias_method :${1:new_name}, :${0:old_name}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: rw
# contributor: Translated from TextMate Snippet
# name: attr_accessor ..
## condition: "source.ruby"
# --
attr_accessor :${1:attr_names}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: r
# contributor: Translated from TextMate Snippet
# name: attr_reader ..
## condition: "source.ruby"
# --
attr_reader :${0:attr_names}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: w
# contributor: Translated from TextMate Snippet
# name: attr_writer ..
## condition: "source.ruby"
# --
attr_writer :${0:attr_names}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: defmm
# contributor: Translated from TextMate Snippet
# name: def method_missing .. end
## condition: "source.ruby"
# --
def method_missing(meth, *args, &blk)
$0
end

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: defs
# contributor: Translated from TextMate Snippet
# name: def self .. end
## condition: "source.ruby"
# --
def self.${1:class_method_name}
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: defd
# contributor: Translated from TextMate Snippet
# name: def_delegator ..
## condition: "source.ruby"
# --
def_delegator :${1:@del_obj}, :${2:del_meth}, :${3:new_name}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: defds
# contributor: Translated from TextMate Snippet
# name: def_delegators ..
## condition: "source.ruby"
# --
def_delegators :${1:@del_obj}, :${0:del_methods}

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: Forw-
# contributor: Translated from TextMate Snippet
# name: extend Forwardable
## condition: "source.ruby"
# --
extend Forwardable

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: Comp
# contributor: Translated from TextMate Snippet
# name: include Comparable ..
## condition: "source.ruby"
# --
include Comparable
def <=>(other)
$0
end

View File

@@ -1,11 +0,0 @@
# -*- mode: snippet -*-
# key: Enum
# contributor: Translated from TextMate Snippet
# name: include Enumerable ..
## condition: "source.ruby"
# --
include Enumerable
def each(&block)
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: ran
# contributor: Translated from TextMate Snippet
# name: randomize()
## condition: "source.ruby"
# --
sort_by { rand }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: sor
# contributor: Translated from TextMate Snippet
# name: sort { |a, b| .. }
## condition: "source.ruby"
# --
sort { |a, b| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: sorb
# contributor: Translated from TextMate Snippet
# name: sort_by { |e| .. }
## condition: "source.ruby"
# --
sort_by { |${1:e}| $0 }

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: =b
# contributor: Translated from TextMate Snippet
# name: New Block
## condition: "source.ruby"
# --
`(if (save-restriction (widen) (eq 1 (line-number-at-pos))) "\n\n" "\n")`=begin rdoc
$0
=end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: y
# contributor: Translated from TextMate Snippet
# name: :yields:
# condition: (yas/ruby-in-comment-p)
# --
:yields: ${1:arguments}

View File

@@ -1,9 +0,0 @@
# -*- mode: snippet -*-
# key: nam
# contributor: Translated from TextMate Snippet
# name: namespace :.. do .. end
## condition: "source.ruby"
# --
namespace :${1:${TM_FILENAME/\.\w+//}} do
$0
end

View File

@@ -1,10 +0,0 @@
# -*- mode: snippet -*-
# key: tas
# contributor: Translated from TextMate Snippet
# name: task :task_name => [:dependent, :tasks] do .. end
## condition: "source.ruby"
# --
desc "${1:Task description}"
task :${2:${3:task_name} => ${4:[:${5:dependent, :tasks}]}} do
$0
end

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: all
# contributor: Translated from TextMate Snippet
# name: all? { |e| .. }
## condition: "source.ruby"
# --
all? { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: any
# contributor: Translated from TextMate Snippet
# name: any? { |e| .. }
## condition: "source.ruby"
# --
any? { |${1:e}| $0 }

View File

@@ -1,7 +0,0 @@
# -*- mode: snippet -*-
# key: cl
# contributor: Translated from TextMate Snippet
# name: classify { |e| .. }
## condition: "source.ruby"
# --
classify { |${1:e}| $0 }

Some files were not shown because too many files have changed in this diff Show More