Silence the MultiJson deprecation warning in every test run
sinatra/json defaults its :json_encoder to MultiJson and calls .encode on it, which newer multi_json versions deprecate in favor of a constant this app has no other use for (sinatra-contrib 4.2.1, the current release, still calls the old one -- not something fixable by bumping a version). Every use of the json helper here is a plain hash/array, so pointing :json_encoder at stdlib JSON instead sidesteps multi_json entirely.
This commit is contained in:
1 parent
bf17e00463
commit
750f6c8fb0
1 file changed
+7
@@ -16,6 +16,13 @@ module Maptool
|
|||||||
set :public_folder, File.join(__dir__, "public")
|
set :public_folder, File.join(__dir__, "public")
|
||||||
set :views, File.join(__dir__, "views")
|
set :views, File.join(__dir__, "views")
|
||||||
|
|
||||||
|
# sinatra/json defaults to MultiJson, whose `encode` (what
|
||||||
|
# sinatra-contrib 4.2.1 actually calls) is deprecated in newer
|
||||||
|
# multi_json versions in favor of a constant this app has no other use
|
||||||
|
# for — stdlib JSON already does the same job and every use of the
|
||||||
|
# `json` helper below is a plain hash/array, nothing MultiJson-specific.
|
||||||
|
set :json_encoder, JSON
|
||||||
|
|
||||||
# A persistent secret across restarts/redeploys — otherwise every deploy
|
# A persistent secret across restarts/redeploys — otherwise every deploy
|
||||||
# would invalidate every logged-in session's cookie (see
|
# would invalidate every logged-in session's cookie (see
|
||||||
# docs/deployment.adoc). Falls back to a random one so the app still
|
# docs/deployment.adoc). Falls back to a random one so the app still
|
||||||
|
|||||||
Reference in new issue
Block a user