mirror of
https://github.com/lostisland/faraday.git
synced 2025-11-29 00:03:35 -05:00
10 lines
209 B
Ruby
10 lines
209 B
Ruby
# 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 |