mirror of
https://github.com/lostisland/faraday.git
synced 2025-10-15 00:01:36 -04:00
14 lines
242 B
Ruby
14 lines
242 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) {
|
|
match, = $&, '' =~ /a/
|
|
yield(match)
|
|
}
|
|
end
|
|
end
|