Skip to content

Instantly share code, notes, and snippets.

@ProfAvery
Created September 26, 2019 06:51
Show Gist options
  • Save ProfAvery/f521c53e66586338bac53cf9fe1e6974 to your computer and use it in GitHub Desktop.
Save ProfAvery/f521c53e66586338bac53cf9fe1e6974 to your computer and use it in GitHub Desktop.
Allow nil to be passed to and from Ruby XML-RPC servers
require 'xmlrpc/server'
def suppress_warnings
previous_VERBOSE, $VERBOSE = $VERBOSE, nil
yield
$VERBOSE = previous_VERBOSE
end
suppress_warnings do
XMLRPC::Config::ENABLE_NIL_PARSER = true
XMLRPC::Config::ENABLE_NIL_CREATE = true
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment