Fix already initialized constant warning (#26542)

lolsob-rspec
Claire 2023-08-18 16:06:46 +02:00 committed by GitHub
parent c2ef995baa
commit f37cc8c15b
1 changed files with 3 additions and 5 deletions

View File

@ -2,9 +2,7 @@
# Monkey patching until https://github.com/httprb/http/pull/757 is merged
unless HTTP::Request::METHODS.include?(:purge)
module HTTP
class Request
METHODS = METHODS.dup.push(:purge).freeze
end
end
methods = HTTP::Request::METHODS.dup
HTTP::Request.send(:remove_const, :METHODS)
HTTP::Request.const_set(:METHODS, methods.push(:purge).freeze)
end