* Small change to textmate_import.rb to import (commented) "scope" directive

* Reimported the HTML and Ruby bundle with the previous fix
* Applied Rob Christie's patches of issues 109 and 110

  0001-Deleted-because-this-is-supported-via-dwim-with-rcod.patch
  0002-Updated-snippets.patch
  0003-Added-setup.el-file-that-must-be-loaded-prior-to-loa.patch
  0004-ruby-mode-class-and-module-snippets-updated.patch
  0005-changes-to-counting-snippets-and-some-declaration-sn.patch

  patching some things manually. Thanks a lot Rob!
This commit is contained in:
capitaomorte 2009-10-13 13:28:14 +00:00
parent a18e5fda5d
commit deb0755824
144 changed files with 217 additions and 76 deletions

View File

@ -2,5 +2,6 @@
# key: Array # key: Array
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: Array.new(10) { |i| .. } # name: Array.new(10) { |i| .. }
## condition: "source.ruby"
# -- # --
Array.new(${1:10}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } Array.new(${1:10}) { ${2:$(if (string= yas/text "") "" "|")}${2:i}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@ -2,5 +2,6 @@
# key: deli # key: deli
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: delete_if { |e| .. } # name: delete_if { |e| .. }
## condition: "source.ruby"
# -- # --
delete_if { |${1:e}| $0 } delete_if { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: fil # key: fil
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: fill(range) { |i| .. } # name: fill(range) { |i| .. }
## condition: "source.ruby"
# -- # --
fill(${1:range}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:i}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } fill(${1:range}) { ${2:$(if (string= yas/text "") "" "|")}${2:variable}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

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

View File

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

View File

@ -2,7 +2,8 @@
# key: do # key: do
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: Insert do |variable| … end # name: Insert do |variable| … end
## condition: "source.ruby"
# -- # --
do ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")} do${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1: |)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}
$0 $0
end end

View File

@ -2,6 +2,6 @@
# key: lam # key: lam
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: lambda { |args| .. } # name: lambda { |args| .. }
# expand-env: ((yas/wrap-around-region t)) ## condition: "source.ruby"
# -- # --
lambda { ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")} $0 } lambda { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:args}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }

View File

@ -2,6 +2,6 @@
# key: { # key: {
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: Insert { |variable| … } # name: Insert { |variable| … }
# expand-env: ((yas/wrap-around-region t)) ## condition: "source.ruby - string - comment"
# -- # --
{ ${1:$(if (string= yas/text "") "" "|")}${1:variable}${1:$(if (string= yas/text "") "" "|")} $0 } { ${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:variable}${1/(^(?<var>\s*[a-z_][a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}${2:`yas/selected-text`}

View File

@ -2,13 +2,11 @@
# key: cla- # key: cla-
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: class .. < DelegateClass .. initialize .. end # name: class .. < DelegateClass .. initialize .. end
## condition: "source.ruby"
# -- # --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < DelegateClass(${2:ParentClass}) class ${1:`(yas/ruby-infer-class-name)`} < DelegateClass(${2:ParentClass})
def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/} def initialize${3:$(if (string= yas/text "") "" "(")}${3:args}${3:$(if (string= yas/text "") "" ")")}
super(${4:del_obj}) super(${4:del_obj})
$0 $0
end end
end end

View File

@ -2,11 +2,10 @@
# key: cla # key: cla
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: class .. < ParentClass .. initialize .. end # name: class .. < ParentClass .. initialize .. end
## condition: "source.ruby"
# -- # --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} < ${2:ParentClass} class ${1:`(yas/ruby-infer-class-name)`} < ${2:ParentClass}
def initialize${3/(^.*?\S.*)|.*/(?1:\()/}${3:args}${3/(^.*?\S.*)|.*/(?1:\))/} def initialize${3:$(if (string= yas/text "") "" "(")}${3:args}${3:$(if (string= yas/text "") "" ")")}
$0 $0
end end
end end

View File

@ -2,11 +2,10 @@
# key: cla # key: cla
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: ClassName = Struct .. do .. end # name: ClassName = Struct .. do .. end
## condition: "source.ruby"
# -- # --
${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} = Struct.new(:${2:attr_names}) do ${1:`(yas/ruby-infer-class-name)`} = Struct.new(:${2:attr_names}) do
def ${3:method_name} def ${3:method_name}
$0 $0
end end
end end

View File

@ -2,7 +2,8 @@
# key: cla # key: cla
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: class .. end # name: class .. end
## condition: "source.ruby"
# -- # --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} class ${1:`(yas/ruby-infer-class-name)`}
$0 $0
end end

View File

@ -2,11 +2,11 @@
# key: cla # key: cla
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: class .. initialize .. end # name: class .. initialize .. end
## condition: "source.ruby"
# -- # --
class ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} class ${1:`(yas/ruby-infer-class-name)`}
def initialize${2/(^.*?\S.*)|.*/(?1:\()/}${2:args}${2/(^.*?\S.*)|.*/(?1:\))/} def initialize${2:$(if (string= yas/text "") "" "(")}${2:args}${2:$(if (string= yas/text "") "" ")")}
$0 $0
end end
end end

View File

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

View File

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

View File

@ -2,8 +2,9 @@
# key: mod # key: mod
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: module .. ClassMethods .. end # name: module .. ClassMethods .. end
## condition: "source.ruby"
# -- # --
module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} module ${1:`(yas/ruby-infer-class-name)`}
module ClassMethods module ClassMethods
$0 $0
end end

View File

@ -2,7 +2,8 @@
# key: mod # key: mod
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: module .. end # name: module .. end
## condition: "source.ruby"
# -- # --
module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} module ${1:`(yas/ruby-infer-class-name)`}
$0 $0
end end

View File

@ -2,8 +2,9 @@
# key: mod # key: mod
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: module .. module_function .. end # name: module .. module_function .. end
## condition: "source.ruby"
# -- # --
module ${1:${TM_FILENAME/(?:\A|_)([A-Za-z0-9]+)(?:\.rb)?/(?2::\u$1)/g}} module ${1:`(yas/ruby-infer-class-name)`}
module_function module_function
$0 $0

View File

@ -2,5 +2,6 @@
# key: dow # key: dow
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: downto(0) { |n| .. } # name: downto(0) { |n| .. }
## condition: "source.ruby"
# -- # --
downto(${1:0}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } downto(${1:0}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@ -2,5 +2,6 @@
# key: loo # key: loo
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: loop { .. } # name: loop { .. }
## condition: "source.ruby"
# -- # --
loop { $0 } loop { $0 }

View File

@ -2,5 +2,6 @@
# key: ste # key: ste
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: step(2) { |e| .. } # name: step(2) { |e| .. }
## condition: "source.ruby"
# -- # --
step(${1:2}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } step(${1:2}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@ -2,5 +2,6 @@
# key: tim # key: tim
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: times { |n| .. } # name: times { |n| .. }
## condition: "source.ruby"
# -- # --
times { ${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${1:n}${1/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } times { ${1:$(if (string= yas/text "") "" "|")}${1:n}${1:$(if (string= yas/text "") "" "|")} $0 }

View File

@ -2,5 +2,6 @@
# key: upt # key: upt
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: upto(1.0/0.0) { |n| .. } # name: upto(1.0/0.0) { |n| .. }
## condition: "source.ruby"
# -- # --
upto(${1:1.0/0.0}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:n}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } upto(${1:1.0/0.0}) { ${2:$(if (string= yas/text "") "" "|")}${2:n}${2:$(if (string= yas/text "") "" "|")} $0 }

View File

@ -2,5 +2,6 @@
# key: rb # key: rb
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: #!/usr/bin/env ruby -wKU # name: #!/usr/bin/env ruby -wKU
## condition: "source.ruby"
# -- # --
#!/usr/bin/env ruby${TM_RUBY_SWITCHES: -wKU} #!/usr/bin/env ruby -wKU

View File

@ -2,6 +2,7 @@
# key: ife # key: ife
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: if … else … end # name: if … else … end
## condition: "source.ruby"
# -- # --
if ${1:condition} if ${1:condition}
$2 $2

View File

@ -2,6 +2,7 @@
# key: if # key: if
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: if … end # name: if … end
## condition: "source.ruby"
# -- # --
if ${1:condition} if ${1:condition}
$0 $0

View File

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

View File

@ -2,10 +2,11 @@
# key: begin # key: begin
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: begin … rescue … end # name: begin … rescue … end
# binding: "^W" ## binding: "^W"
## condition: "source.ruby - comment"
# -- # --
${TM_SELECTED_TEXT/([\t ]*).*/$1/m}begin begin
${3:${TM_SELECTED_TEXT/(\A.*)|(.+)|\n\z/(?1:$0:(?2:\t$0))/g}} `(or yas/selected-text (car kill-ring))`$3
${TM_SELECTED_TEXT/([\t ]*).*/$1/m}rescue ${1:Exception}${2/.+/ => /}${2:e} rescue ${1:Exception}${2:$(if (string= yas/text "") "" " => ")}${2:e}
${TM_SELECTED_TEXT/([\t ]*).*/$1/m} $0 $0
${TM_SELECTED_TEXT/([\t ]*).*/$1/m}end end

View File

@ -2,5 +2,6 @@
# key: end # key: end
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: __END__ # name: __END__
## condition: "source.ruby"
# -- # --
__END__ __END__

View File

@ -2,6 +2,7 @@
# key: app # key: app
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: application { .. } # name: application { .. }
## condition: "source.ruby"
# -- # --
if __FILE__ == \$PROGRAM_NAME if __FILE__ == \$PROGRAM_NAME
$0 $0

View File

@ -2,6 +2,7 @@
# key: def # key: def
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: def … end # name: def … end
## condition: "source.ruby"
# -- # --
def ${1:method_name} def ${1:method_name}
$0 $0

View File

@ -2,6 +2,7 @@
# key: elsif # key: elsif
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: elsif ... # name: elsif ...
## condition: "source.ruby"
# -- # --
elsif ${1:condition} elsif ${1:condition}
$0 $0

View File

@ -2,5 +2,6 @@
# key: req # key: req
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: require ".." # name: require ".."
## condition: "source.ruby"
# -- # --
require "$0" require "$0"

View File

@ -2,5 +2,6 @@
# key: reqg- # key: reqg-
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: require_gem ".." # name: require_gem ".."
## condition: "source.ruby"
# -- # --
require "$0" require "$0"

View File

@ -2,6 +2,7 @@
# key: unless # key: unless
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: unless … end # name: unless … end
## condition: "source.ruby"
# -- # --
unless ${1:condition} unless ${1:condition}
$0 $0

View File

@ -2,6 +2,7 @@
# key: until # key: until
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: until ... end # name: until ... end
## condition: "source.ruby"
# -- # --
until ${1:condition} until ${1:condition}
$0 $0

View File

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

View File

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

View File

@ -2,6 +2,7 @@
# key: when # key: when
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: when … # name: when …
## condition: "source.ruby"
# -- # --
when ${1:condition} when ${1:condition}
$0 $0

View File

@ -2,6 +2,7 @@
# key: while # key: while
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: while ... end # name: while ... end
## condition: "source.ruby"
# -- # --
while ${1:condition} while ${1:condition}
$0 $0

View File

@ -2,5 +2,6 @@
# key: ea # key: ea
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each { |e| .. } # name: each { |e| .. }
## condition: "source.ruby"
# -- # --
each { |${1:e}| $0 } each { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: eab # key: eab
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each_byte { |byte| .. } # name: each_byte { |byte| .. }
## condition: "source.ruby"
# -- # --
each_byte { |${1:byte}| $0 } each_byte { |${1:byte}| $0 }

View File

@ -2,5 +2,6 @@
# key: eac- # key: eac-
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each_char { |chr| .. } # name: each_char { |chr| .. }
## condition: "source.ruby"
# -- # --
each_char { |${1:chr}| $0 } each_char { |${1:chr}| $0 }

View File

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

View File

@ -2,5 +2,6 @@
# key: eai # key: eai
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each_index { |i| .. } # name: each_index { |i| .. }
## condition: "source.ruby"
# -- # --
each_index { |${1:i}| $0 } each_index { |${1:i}| $0 }

View File

@ -2,5 +2,6 @@
# key: eak # key: eak
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each_key { |key| .. } # name: each_key { |key| .. }
## condition: "source.ruby"
# -- # --
each_key { |${1:key}| $0 } each_key { |${1:key}| $0 }

View File

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

View File

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

View File

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

View File

@ -2,5 +2,6 @@
# key: eav # key: eav
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: each_value { |val| .. } # name: each_value { |val| .. }
## condition: "source.ruby"
# -- # --
each_value { |${1:val}| $0 } each_value { |${1:val}| $0 }

View File

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

View File

@ -2,5 +2,6 @@
# key: inj # key: inj
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: inject(init) { |mem, var| .. } # name: inject(init) { |mem, var| .. }
## condition: "source.ruby"
# -- # --
inject${1/.+/(/}${1:init}${1/.+/)/} { |${2:mem}, ${3:var}| $0 } inject${1/.+/(/}${1:init}${1/.+/)/} { |${2:mem}, ${3:var}| $0 }

View File

@ -2,5 +2,6 @@
# key: map # key: map
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: map { |e| .. } # name: map { |e| .. }
## condition: "source.ruby"
# -- # --
map { |${1:e}| $0 } map { |${1:e}| $0 }

View File

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

View File

@ -2,5 +2,6 @@
# key: reve # key: reve
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: reverse_each { |e| .. } # name: reverse_each { |e| .. }
## condition: "source.ruby"
# -- # --
reverse_each { |${1:e}| $0 } reverse_each { |${1:e}| $0 }

View File

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

View File

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

View File

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

View File

@ -2,5 +2,6 @@
# key: File # key: File
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: File.open("..") { |file| .. } # name: File.open("..") { |file| .. }
## condition: "source.ruby"
# -- # --
File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 } File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 }

View File

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

View File

@ -2,5 +2,6 @@
# key: dir # key: dir
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: directory() # name: directory()
## condition: "source.ruby"
# -- # --
File.dirname(__FILE__) File.dirname(__FILE__)

View File

@ -2,5 +2,6 @@
# key: ope # key: ope
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: open("path/or/url", "w") { |io| .. } # name: open("path/or/url", "w") { |io| .. }
## condition: "source.ruby"
# -- # --
open(${1:"${2:path/or/url/or/pipe}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:io}| $0 } open(${1:"${2:path/or/url/or/pipe}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:io}| $0 }

View File

@ -2,6 +2,7 @@
# key: optp # key: optp
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: option_parse { .. } # name: option_parse { .. }
## condition: "source.ruby"
# -- # --
require "optparse" require "optparse"

View File

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

View File

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

View File

@ -2,6 +2,7 @@
# key: opt # key: opt
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: option(..) # name: option(..)
## condition: "source.ruby"
# -- # --
opts.on( "-${1:o}", "--${2:long-option-name}"${3/^\s*$|(.*\S.*)/(?1:, )/}${3:String}, opts.on( "-${1:o}", "--${2:long-option-name}"${3/^\s*$|(.*\S.*)/(?1:, )/}${3:String},
"${4:Option description.}" ) do |${6:opt}| "${4:Option description.}" ) do |${6:opt}|

View File

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

View File

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

View File

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

View File

@ -2,5 +2,6 @@
# key: clafn # key: clafn
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: class_from_name() # name: class_from_name()
## condition: "source.ruby"
# -- # --
split("::").inject(Object) { |par, const| par.const_get(const) } split("::").inject(Object) { |par, const| par.const_get(const) }

View File

@ -2,5 +2,6 @@
# key: deec # key: deec
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: deep_copy(..) # name: deep_copy(..)
## condition: "source.ruby"
# -- # --
Marshal.load(Marshal.dump(${0:obj_to_copy})) Marshal.load(Marshal.dump(${0:obj_to_copy}))

View File

@ -2,5 +2,6 @@
# key: sinc # key: sinc
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: singleton_class() # name: singleton_class()
## condition: "source.ruby"
# -- # --
class << self; self end class << self; self end

View File

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

View File

@ -2,5 +2,6 @@
# key: am # key: am
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: alias_method .. # name: alias_method ..
## condition: "source.ruby"
# -- # --
alias_method :${1:new_name}, :${0:old_name} alias_method :${1:new_name}, :${0:old_name}

View File

@ -2,5 +2,6 @@
# key: rw # key: rw
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: attr_accessor .. # name: attr_accessor ..
## condition: "source.ruby"
# -- # --
attr_accessor :${0:attr_names} attr_accessor :${1:attr_names}

View File

@ -2,5 +2,6 @@
# key: r # key: r
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: attr_reader .. # name: attr_reader ..
## condition: "source.ruby"
# -- # --
attr_reader :${0:attr_names} attr_reader :${0:attr_names}

View File

@ -2,5 +2,6 @@
# key: w # key: w
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: attr_writer .. # name: attr_writer ..
## condition: "source.ruby"
# -- # --
attr_writer :${0:attr_names} attr_writer :${0:attr_names}

View File

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

View File

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

View File

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

View File

@ -2,5 +2,6 @@
# key: defds # key: defds
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: def_delegators .. # name: def_delegators ..
## condition: "source.ruby"
# -- # --
def_delegators :${1:@del_obj}, :${0:del_methods} def_delegators :${1:@del_obj}, :${0:del_methods}

View File

@ -2,5 +2,6 @@
# key: Forw- # key: Forw-
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: extend Forwardable # name: extend Forwardable
## condition: "source.ruby"
# -- # --
extend Forwardable extend Forwardable

View File

@ -2,6 +2,7 @@
# key: Comp # key: Comp
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: include Comparable .. # name: include Comparable ..
## condition: "source.ruby"
# -- # --
include Comparable include Comparable

View File

@ -2,6 +2,7 @@
# key: Enum # key: Enum
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: include Enumerable .. # name: include Enumerable ..
## condition: "source.ruby"
# -- # --
include Enumerable include Enumerable

View File

@ -2,5 +2,6 @@
# key: ran # key: ran
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: randomize() # name: randomize()
## condition: "source.ruby"
# -- # --
sort_by { rand } sort_by { rand }

View File

@ -2,5 +2,6 @@
# key: sor # key: sor
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: sort { |a, b| .. } # name: sort { |a, b| .. }
## condition: "source.ruby"
# -- # --
sort { |a, b| $0 } sort { |a, b| $0 }

View File

@ -2,5 +2,6 @@
# key: sorb # key: sorb
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: sort_by { |e| .. } # name: sort_by { |e| .. }
## condition: "source.ruby"
# -- # --
sort_by { |${1:e}| $0 } sort_by { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: y # key: y
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: :yields: # name: :yields:
## condition: "source.ruby comment"
# -- # --
:yields: ${0:arguments} :yields: ${0:arguments}

View File

@ -2,6 +2,7 @@
# key: =b # key: =b
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: New Block # name: New Block
## condition: "source.ruby"
# -- # --
`[[ $TM_LINE_INDEX != 0 ]] && echo; echo`=begin rdoc `[[ $TM_LINE_INDEX != 0 ]] && echo; echo`=begin rdoc
$0 $0

View File

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

View File

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

View File

@ -2,5 +2,6 @@
# key: all # key: all
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: all? { |e| .. } # name: all? { |e| .. }
## condition: "source.ruby"
# -- # --
all? { |${1:e}| $0 } all? { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: any # key: any
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: any? { |e| .. } # name: any? { |e| .. }
## condition: "source.ruby"
# -- # --
any? { |${1:e}| $0 } any? { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: cl # key: cl
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: classify { |e| .. } # name: classify { |e| .. }
## condition: "source.ruby"
# -- # --
classify { |${1:e}| $0 } classify { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: col # key: col
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: collect { |e| .. } # name: collect { |e| .. }
## condition: "source.ruby"
# -- # --
collect { |${1:e}| $0 } collect { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: det # key: det
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: detect { |e| .. } # name: detect { |e| .. }
## condition: "source.ruby"
# -- # --
detect { |${1:e}| $0 } detect { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: fet # key: fet
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: fetch(name) { |key| .. } # name: fetch(name) { |key| .. }
## condition: "source.ruby"
# -- # --
fetch(${1:name}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:key}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 } fetch(${1:name}) { ${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:|)/}${2:key}${2/(^(?<var>\s*(?:\*|\*?[a-z_])[a-zA-Z0-9_]*\s*)(,\g<var>)*,?\s*$)|.*/(?1:| )/}$0 }

View File

@ -2,5 +2,6 @@
# key: fin # key: fin
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: find { |e| .. } # name: find { |e| .. }
## condition: "source.ruby"
# -- # --
find { |${1:e}| $0 } find { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: fina # key: fina
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: find_all { |e| .. } # name: find_all { |e| .. }
## condition: "source.ruby"
# -- # --
find_all { |${1:e}| $0 } find_all { |${1:e}| $0 }

View File

@ -2,5 +2,6 @@
# key: gre # key: gre
# contributor: Translated from TextMate Snippet # contributor: Translated from TextMate Snippet
# name: grep(/pattern/) { |match| .. } # name: grep(/pattern/) { |match| .. }
## condition: "source.ruby"
# -- # --
grep(${1:/${2:pattern}/}) { |${3:match}| $0 } grep(${1:/${2:pattern}/}) { |${3:match}| $0 }

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