class ActiveSupport::SafeBuffer

def set_block_back_references(block, match_data)

def set_block_back_references(block, match_data)
  block.binding.eval("proc { |m| $~ = m }").call(match_data)
rescue ArgumentError
  # Can't create binding from C level Proc
end