Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Put deprecation warning together in one line #288

Merged
merged 1 commit into from
Nov 7, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions lib/committee/middleware/request_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,7 @@ def handle_exception(e, env)
if @error_handler.arity > 1
@error_handler.call(e, env)
else
warn <<-MESSAGE
[DEPRECATION] Using `error_handler.call(exception)` is deprecated and will be change to
`error_handler.call(exception, request.env)` in next major version.
MESSAGE

warn '[DEPRECATION] Using `error_handler.call(exception)` is deprecated and will be change to `error_handler.call(exception, request.env)` in next major version.'
@error_handler.call(e)
end
end
Expand Down
6 changes: 1 addition & 5 deletions lib/committee/middleware/response_validation.rb
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,7 @@ def handle_exception(e, env)
if @error_handler.arity > 1
@error_handler.call(e, env)
else
warn <<-MESSAGE
[DEPRECATION] Using `error_handler.call(exception)` is deprecated and will be change to
`error_handler.call(exception, request.env)` in next major version.
MESSAGE

warn '[DEPRECATION] Using `error_handler.call(exception)` is deprecated and will be change to `error_handler.call(exception, request.env)` in next major version.'
@error_handler.call(e)
end
end
Expand Down
7 changes: 1 addition & 6 deletions lib/committee/test/methods.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,7 @@ def schema_validator
def old_behavior
old_assert_behavior = committee_options.fetch(:old_assert_behavior, nil)
if old_assert_behavior.nil?
warn <<-MSG
[DEPRECATION] now assert_schema_conform check response schema only.
but we will change check request and response in future major version.
so if you want to conform response only, please use assert_response_schema_confirm,
or you can suppress this message and keep old behavior by setting old_assert_behavior=true.
MSG
warn '[DEPRECATION] now assert_schema_conform check response schema only. but we will change check request and response in future major version. so if you want to conform response only, please use assert_response_schema_confirm, or you can suppress this message and keep old behavior by setting old_assert_behavior=true.'
old_assert_behavior = true
end
old_assert_behavior
Expand Down