mirror of
https://github.com/joaotavora/yasnippet.git
synced 2025-12-17 02:44:17 +00:00
Last commit before tagging and releasing
This commit is contained in:
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: Dir
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Dir.glob("..") { |file| .. }
|
||||
# --
|
||||
Dir.glob(${1:"${2:dir/glob/*}"}) { |${3:file}| $0 }
|
||||
6
extras/imported/ruby-mode/Files/Dir["__"].yasnippet
Normal file
6
extras/imported/ruby-mode/Files/Dir["__"].yasnippet
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: Dir
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: Dir[".."]
|
||||
# --
|
||||
Dir[${1:"${2:glob/**/*.rb}"}]
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: File
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: File.foreach ("..") { |line| .. }
|
||||
# --
|
||||
File.foreach(${1:"${2:path/to/file}"}) { |${3:line}| $0 }
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: File
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: File.open("..") { |file| .. }
|
||||
# --
|
||||
File.open(${1:"${2:path/to/file}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:file}| $0 }
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: File
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: File.read("..")
|
||||
# --
|
||||
File.read(${1:"${2:path/to/file}"})
|
||||
6
extras/imported/ruby-mode/Files/directory().yasnippet
Normal file
6
extras/imported/ruby-mode/Files/directory().yasnippet
Normal file
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: dir
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: directory()
|
||||
# --
|
||||
File.dirname(__FILE__)
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: ope
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: open("path/or/url", "w") { |io| .. }
|
||||
# --
|
||||
open(${1:"${2:path/or/url/or/pipe}"}${3/(^[rwab+]+$)|.*/(?1:, ")/}${3:w}${3/(^[rwab+]+$)|.*/(?1:")/}) { |${4:io}| $0 }
|
||||
@@ -0,0 +1,32 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: optp
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: option_parse { .. }
|
||||
# --
|
||||
require "optparse"
|
||||
|
||||
options = {${1::default => "args"}}
|
||||
|
||||
ARGV.options do |opts|
|
||||
opts.banner = "Usage: #{File.basename(\$PROGRAM_NAME)} [OPTIONS]${2/^\s*$|(.*\S.*)/(?1: )/}${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
|
||||
@@ -0,0 +1,6 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: patfh
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: path_from_here( .. )
|
||||
# --
|
||||
File.join(File.dirname(__FILE__), *%w[${1:rel path here}])
|
||||
@@ -0,0 +1,8 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: unif
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: unix_filter { .. }
|
||||
# --
|
||||
ARGF.each_line$1 do |${2:line}|
|
||||
$0
|
||||
end
|
||||
9
extras/imported/ruby-mode/Files/untitled.yasnippet
Normal file
9
extras/imported/ruby-mode/Files/untitled.yasnippet
Normal file
@@ -0,0 +1,9 @@
|
||||
# -*- mode: snippet -*-
|
||||
# key: opt
|
||||
# contributor: Translated from TextMate Snippet
|
||||
# name: option(..)
|
||||
# --
|
||||
opts.on( "-${1:o}", "--${2:long-option-name}"${3/^\s*$|(.*\S.*)/(?1:, )/}${3:String},
|
||||
"${4:Option description.}" ) do |${6:opt}|
|
||||
$0
|
||||
end
|
||||
Reference in New Issue
Block a user