how to get rid of ruby's warning: already initialized constant

ruby, xml-rpc

Solution

The easy way:

v, $VERBOSE = $VERBOSE, nil
# code goes here
$VERBOSE = v

Problem

I'm trying to redefine a gem's constant dynamically so I don't need to modify the gem itself. ``` require 'xmlrpc/client' XMLRPC::Config.const_set("ENABLE_NIL_PARSER", true) warning: already initialized constant ENABLE_NIL_PARSER ``` Is it possible to get rid of the warning?

Original source

Related problems