From 63551117aac15a93e7b32b31b096484b0ed59cf2 Mon Sep 17 00:00:00 2001 From: Mike Foley Date: Tue, 26 Feb 2013 15:51:09 -0800 Subject: [PATCH 1/2] added each_with_object Ruby snippets --- snippets/ruby.snippets | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 0365ec2..879677c 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -289,6 +289,12 @@ snippet eawid each_with_index do |${1:e},${2:i}| ${3} end +snippet eawo + each_with_object(${1:init}) { |${2:e}, ${3:var}| ${4} } +snippet eawod + each_with_object(${1:init}) do |${2:e}, ${3:var}| + ${4} + end snippet reve reverse_each { |${1:e}| ${2} } snippet reved From 0ccc49e39d813829d5b5d84d237bbed05e620024 Mon Sep 17 00:00:00 2001 From: Mike Foley Date: Tue, 26 Feb 2013 15:51:33 -0800 Subject: [PATCH 2/2] added a space to each_with_index Ruby snippet, to be consistent with similar snippets --- snippets/ruby.snippets | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/snippets/ruby.snippets b/snippets/ruby.snippets index 879677c..8805430 100644 --- a/snippets/ruby.snippets +++ b/snippets/ruby.snippets @@ -286,7 +286,7 @@ snippet eavd snippet eawi each_with_index { |${1:e}, ${2:i}| ${3} } snippet eawid - each_with_index do |${1:e},${2:i}| + each_with_index do |${1:e}, ${2:i}| ${3} end snippet eawo