yasnippet/extras/imported/ruby-mode/Files/open(pathorurl, w) do doc .. end (ope).yasnippet

7 lines
331 B
Plaintext

# -*- 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 }