1.9.3からgsubの第二引数にhashを渡せるようになっていたことを今日知りました。
gsubのマニュアル
時々erbを使うほどでも無いテンプレートの変数置換で
replace_hash = {
  "#to#"   => "taro",
  "#from#" => "jiro"
}
template = <<EOS
hello, #to#.
message from #from#.
EOS
というのがある場合、
puts template.gsub(/#.*#/) {|matched|
  replace_hash[matched]
}
# =>hello, taro.
#  message from jiro.
というようなコードをよく書いていたのですが、これが単純に
puts template.gsub(/#.*#/, replace_hash)
# =>hello, taro.
#  message from jiro.
これで、同じことができます。
やっぱりマニュアルは日頃からよく読んでおかないといけませんね。