mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-04 00:02:03 -04:00
16 lines
250 B
Ruby
16 lines
250 B
Ruby
# frozen_string_literal: true
|
|
|
|
# emulates ActiveSupport::SafeBuffer#gsub
|
|
FakeSafeBuffer = Struct.new(:string) do
|
|
def to_s
|
|
self
|
|
end
|
|
|
|
def gsub(regex)
|
|
string.gsub(regex) do
|
|
match, = $&, '' =~ /a/
|
|
yield(match)
|
|
end
|
|
end
|
|
end
|