Skip to content

Commit

Permalink
add postfix template for ruby
Browse files Browse the repository at this point in the history
  • Loading branch information
mattn committed Jul 4, 2016
1 parent 4237a9c commit 759ac67
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions template/ruby/pattern.stpl
@@ -0,0 +1,31 @@
^\s*\zs\(\S.*\)\.each$
{{$1}}.each do |x|
{{_cursor_}}
end

^\s*\zs\(\S.*\)\.eachb$
{{$1}}.each {|x|
{{_cursor_}}
}

^\s*\zs\(\S.*\)\.eachi$
{{$1}}.each_with_index do |x,i|
{{_cursor_}}
end

^\s*\zs\(\S.*\)\.eachbi$
{{$1}}.each_with_index {|x,i|
{{_cursor_}}
}

^\s*\zs\(\S.*\)\.map$
{{$1}}.map do |x|
{{_cursor_}}
end

^\s*\zs\(\S.*\)\.mapb$
{{$1}}.map {|x|
{{_cursor_}}
}


0 comments on commit 759ac67

Please sign in to comment.