This commit is contained in:
2024-04-30 07:08:23 +02:00
commit a711247971
2043 changed files with 16874 additions and 0 deletions

5
snippets/ruby-mode/# Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: # =>
# group : general
# --
# =>

7
snippets/ruby-mode/=b Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: =begin rdoc ... =end
# group : general
# --
=begin rdoc
$0
=end

9
snippets/ruby-mode/Comp Normal file
View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: include Comparable; def <=> ... end
# group : definitions
# --
include Comparable
def <=> other
$0
end

10
snippets/ruby-mode/Enum Normal file
View File

@@ -0,0 +1,10 @@
# -*- mode: snippet -*-
# name: include Enumerable
# key: Enum
# group: collections
# --
include Enumerable
def each${1:(&block)}
$0
end

5
snippets/ruby-mode/GLOB Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: GLOB
# key: $
# --
$${1:GLOBAL} = $0

5
snippets/ruby-mode/all Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: all? { |...| ... }
# group : collections
# --
all? { |${e}| $0 }

5
snippets/ruby-mode/am Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: alias_method new, old
# group : definitions
# --
alias_method :${new_name}, :${old_name}

5
snippets/ruby-mode/any Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: any? { |...| ... }
# group : collections
# --
any? { |${e}| $0 }

7
snippets/ruby-mode/app Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if __FILE__ == $PROGRAM_NAME ... end
# group : general
# --
if __FILE__ == $PROGRAM_NAME
$0
end

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: attribute
# key: @
# --
@${1:attr} = $0

5
snippets/ruby-mode/bang Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: #!
# key: #!
# --
#!/usr/bin/env ruby

10
snippets/ruby-mode/bench Normal file
View File

@@ -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

7
snippets/ruby-mode/bm Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: Benchmark.bmbm(...) do ... end
# group : general
# --
Benchmark.bmbm(${1:10}) do |x|
$0
end

8
snippets/ruby-mode/case Normal file
View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: case ... end
# group : general
# --
case ${1:object}
when ${2:condition}
$0
end

7
snippets/ruby-mode/cla Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: class << self ... end
# group : definitions
# --
class << ${self}
$0
end

12
snippets/ruby-mode/cls Normal file
View File

@@ -0,0 +1,12 @@
# -*- mode: snippet -*-
# 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

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: collect { |...| ... }
# group : collections
# --
collect { |${e}| $0 }

5
snippets/ruby-mode/dee Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: deep_copy(...)
# group : general
# --
Marshal.load(Marshal.dump($0))

7
snippets/ruby-mode/def Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: def ... end
# key: def
# --
def ${1:method}${2:(${3:args})}
$0
end

5
snippets/ruby-mode/deli Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: delete_if { |...| ... }
# group : collections
# --
delete_if { |${e}| $0 }

5
snippets/ruby-mode/det Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: detect { |...| ... }
# group : collections
# --
detect { |${e}| $0 }

7
snippets/ruby-mode/dow Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: downto(...) { |n| ... }
# group : control structure
# --
downto(${0}) { |${n}|
$0
}

5
snippets/ruby-mode/ea Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: each { |...| ... }
# group : collections
# --
each { |${e}| $0 }

5
snippets/ruby-mode/eac Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: each_cons(...) { |...| ... }
# group : collections
# --
each_cons(${1:2}) { |${group}| $0 }

5
snippets/ruby-mode/eai Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: each_index { |i| ... }
# group : collections
# --
each_index { |${i}| $0 }

5
snippets/ruby-mode/eav Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: each_value { |val| ... }
# group : collections
# --
each_value { |${val}| $0 }

5
snippets/ruby-mode/eawi Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: each_with_index { |e, i| ... }
# group : collections
# --
each_with_index { |${e}, ${i}| $0 }

7
snippets/ruby-mode/for Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for
# key: for
# --
for ${1:el} in ${2:collection}
$0
end

7
snippets/ruby-mode/forin Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: for ... in ...; ... end
# group : control structure
# --
for ${1:element} in ${2:collection}
$0
end

View File

@@ -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

7
snippets/ruby-mode/if Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: if ... end
# group : control structure
# --
if ${1:condition}
$0
end

9
snippets/ruby-mode/ife Normal file
View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: if ... else ... end
# group : control structure
# --
if ${1:condition}
$2
else
$3
end

7
snippets/ruby-mode/inc Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: include Module
# key: inc
# group: general
# --
include ${1:Module}
$0

7
snippets/ruby-mode/init Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: init
# key: init
# --
def initialize(${1:args})
$0
end

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: inject(...) { |...| ... }
# group : collections
# --
inject(${1:0}) { |${2:injection}, ${3:element}| $0 }

5
snippets/ruby-mode/map Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: map { |...| ... }
# group : collections
# --
map { |${e}| $0 }

7
snippets/ruby-mode/mm Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: def method_missing ... end
# group : definitions
# --
def method_missing(method, *args)
$0
end

14
snippets/ruby-mode/mod Normal file
View File

@@ -0,0 +1,14 @@
# -*- mode: snippet -*-
# name: module ... end
# contributor: hitesh <hitesh.jasani@gmail.com>, jimeh <contact@jimeh.me>
# key: mod
# --
module ${1:`(let ((fn (capitalize (file-name-nondirectory
(file-name-sans-extension
(or (buffer-file-name)
(buffer-name (current-buffer))))))))
(while (string-match "_" fn)
(setq fn (replace-match "" nil nil fn)))
fn)`}
$0
end

6
snippets/ruby-mode/proc Normal file
View File

@@ -0,0 +1,6 @@
# -*- mode: snippet -*-
# name: Proc.new { |...| ... }
# key: proc
# contributor: Valery Zajkov
# --
Proc.new { |${1:argument}| $0 }

5
snippets/ruby-mode/pry Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: binding.pry
# key: pry
# --
require 'pry'; binding.pry

5
snippets/ruby-mode/r Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: attr_reader ...
# group : definitions
# --
attr_reader :

5
snippets/ruby-mode/rb Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: /usr/bin/ruby -wU
# group : general
# --
#!/usr/bin/ruby -wU

5
snippets/ruby-mode/red Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: reduce(...) { |...| ... }
# group : collections
# --
reduce(${1:0}) { |${2:accumulator}, ${3:element}| $0 }

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: reject { |...| ... }
# group : collections
# --
reject { |${1:element}| $0 }

5
snippets/ruby-mode/rel Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: require_relative
# group : general
# --
require_relative '$0'

5
snippets/ruby-mode/req Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: require "..."
# group : general
# --
require '$0'

5
snippets/ruby-mode/rpry Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: binding.pry_remote
# key: rpry
# --
require 'pry-remote'; binding.remote_pry

5
snippets/ruby-mode/rw Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: attr_accessor ...
# group : definitions
# --
attr_accessor :

View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: select { |...| ... }
# group : collections
# --
select { |${1:element}| $0 }

5
snippets/ruby-mode/str Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: str
# key: s
# --
#{$0}

View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: test class
# key: tc
# --
class TC_${1:Class} < Test::Unit::TestCase
$0
end

5
snippets/ruby-mode/tim Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: times { |n| ... }
# group : control structure
# --
times { |${n}| $0 }

8
snippets/ruby-mode/to_ Normal file
View File

@@ -0,0 +1,8 @@
# -*- mode: snippet -*-
# name: to_
# key: to_
# --
def to_s
"${1:string}"
end
$0

5
snippets/ruby-mode/tu Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: tu
# key: tu
# --
require 'test/unit'

View File

@@ -0,0 +1,9 @@
# -*- mode: snippet -*-
# name: unless ... end
# group: control structure
# key: unless
# contributor: Valery Zajkov
# --
unless ${1:condition}
$0
end

7
snippets/ruby-mode/until Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: until ... end
# group: control structure
# --
until ${condition}
$0
end

7
snippets/ruby-mode/upt Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: upto(...) { |n| ... }
# group : control structure
# --
upto(${n}) { |${i}|
$0
}

5
snippets/ruby-mode/w Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: attr_writer ...
# group : definitions
# --
attr_writer :

7
snippets/ruby-mode/when Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: when ... end
# group : control structure
# --
when ${condition}
$0
end

7
snippets/ruby-mode/while Normal file
View File

@@ -0,0 +1,7 @@
# -*- mode: snippet -*-
# name: while ... end
# group : control structure
# --
while ${condition}
$0
end

5
snippets/ruby-mode/y Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: :yields: arguments (rdoc)
# group : general
# --
:yields: $0

5
snippets/ruby-mode/zip Normal file
View File

@@ -0,0 +1,5 @@
# -*- mode: snippet -*-
# name: zip(...) { |...| ... }
# group : collections
# --
zip(${enums}) { |${row}| $0 }