PageRenderTime 44ms CodeModel.GetById 21ms RepoModel.GetById 0ms app.codeStats 0ms

/ruby-mode/Declarations/Wrap in Begin … Rescue … End.yasnippet

http://github.com/ridgetang/snippets
Unknown | 10 lines | 10 code | 0 blank | 0 comment | 0 complexity | e1ec6b75d32378c8e50f14eb9d081223 MD5 | raw file
  1. # -*- mode: snippet -*-
  2. # key: begin
  3. # contributor: Translated from TextMate Snippet
  4. # name: begin rescue end
  5. # --
  6. ${TM_SELECTED_TEXT/([\t ]*).*/$1/m}begin
  7. ${3:${TM_SELECTED_TEXT/(\A.*)|(.+)|\n\z/(?1:$0:(?2:\t$0))/g}}
  8. ${TM_SELECTED_TEXT/([\t ]*).*/$1/m}rescue ${1:Exception}${2/.+/ => /}${2:e}
  9. ${TM_SELECTED_TEXT/([\t ]*).*/$1/m} $0
  10. ${TM_SELECTED_TEXT/([\t ]*).*/$1/m}end