fork(1) download
  1. h = {"{{width}}"=>10, "{{length}}"=>20}
  2. s = "The dimension of the square is {{width}} and {{length}}"
  3. puts s.gsub(/\{\{(?:width|length)\}\}/, h)
Success #stdin #stdout 0.01s 6332KB
stdin
Standard input is empty
stdout
The dimension of the square is 10 and 20