Skip to content

Commit

Permalink
changed to when ... then syntax in #match_substitute
Browse files Browse the repository at this point in the history
  • Loading branch information
tobsch committed Sep 16, 2011
1 parent 2fd0966 commit c8f3740
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions lib/vaporizer.rb
Expand Up @@ -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
Expand Down

0 comments on commit c8f3740

Please sign in to comment.