Permalink
Browse files

changed to when ... then syntax in #match_substitute

  • Loading branch information...
1 parent 2fd0966 commit c8f374017560e465420f8c051261f2b595a12cb1 @tobsch committed Sep 16, 2011
Showing with 5 additions and 10 deletions.
  1. +5 −10 lib/vaporizer.rb
View
@@ -45,16 +45,11 @@ def local_or_external_path(path)
def match_substitute(string, match)
string.gsub(/\$([`&0-9'$])/) do |sub|
case $1
- when "`"
- match.pre_match
- when "&"
- match[0]
- when "0".."9"
- match[$1.to_i]
- when "'"
- match.post_match
- when "$"
- '$'
+ when "`" then match.pre_match
+ when "&" then match[0]
+ when "0".."9" then match[$1.to_i]
+ when "'" then match.post_match
+ when "$" then '$'
end
end
end

0 comments on commit c8f3740

Please sign in to comment.