The equivalent is pretty straight-forward:
history_url.gsub!(/COMPONENT_NAME/, component_name)
The gsub!
method replaces all instances of the given pattern with the second argument and stores the result in the original variable as it is an in-place modifier. gsub
by comparison returns a modified copy.