From 8bc45d1f3efc6712443674c403651967dbfcee19 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?I=C3=B1aki=20Baz=20Castillo?= Date: Tue, 5 Feb 2013 11:03:19 +0100 Subject: [PATCH] s/clean/clear/g (make @saghul even happier) --- CHANGELOG.md | 4 +++- lib/oversip/sip/client.rb | 16 ++++++++-------- lib/oversip/sip/uri.rb | 2 +- test/test_uri.rb | 6 +++--- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 8c17080..4fd9558 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -15,10 +15,12 @@ Version devel (not yet released) - [(4b7c47f)](https://github.com/versatica/OverSIP/commit/4b7c47fd27e5186c71541952a1bb28af35cfcaa5) New method `OverSIP::SIP::Uri#has_param?(param)`. -- [(774de3b)](https://github.com/versatica/OverSIP/commit/774de3b537fb6afdc71adb1047184cf0785c495c) New instance methods `clean_on_xxxxxx()` and `clean_callbacks()` to clean existing callbacks in `OverSIP::SIP::Proxy` and `OverSIP::SIP::Uac`. +- [(774de3b)](https://github.com/versatica/OverSIP/commit/774de3b537fb6afdc71adb1047184cf0785c495c) New instance methods `clear_on_xxxxxx()` and `clear_callbacks()` to clear existing callbacks in `OverSIP::SIP::Proxy` and `OverSIP::SIP::Uac`. - [(e58974f)](https://github.com/versatica/OverSIP/commit/e58974feea8cd7962ea3efa8d8476f4bd54e52f9) New design of `OverSIP::Modules::OutboundMangling` module: `add_outbound_to_contact()` now requires passing an `OverSIP::SIP::Proxy` as argument rather than a request, and it internally adds the callback to the 2XX response (for reverting the custom ;ov-ob param) so `remove_outbound_from_contact()` is no longer required and has been removed. +- [(31114a0)](https://github.com/versatica/OverSIP/commit/31114a091c9649574af0710f23e459f0bd488757) Added `OverSIP::SIP::Uri#clear_params()` which removes all the params from the URI. + Version 1.3.7 (released in 2013-01-28) -------------------------------------- diff --git a/lib/oversip/sip/client.rb b/lib/oversip/sip/client.rb index d8938d0..c49b0bd 100644 --- a/lib/oversip/sip/client.rb +++ b/lib/oversip/sip/client.rb @@ -48,35 +48,35 @@ def on_target &block @on_target_cbs << block end - def clean_on_provisional_response + def clear_on_provisional_response @on_provisional_response_cbs.clear end - def clean_on_success_response + def clear_on_success_response @on_success_response_cbs.clear end - def clean_on_failure_response + def clear_on_failure_response @on_failure_response_cbs.clear end - def clean_on_canceled + def clear_on_canceled @on_canceled_cbs.clear end - def clean_on_invite_timeout + def clear_on_invite_timeout @on_invite_timeout_cbs.clear end - def clean_on_error + def clear_on_error @on_error_cbs.clear end - def clean_on_target + def clear_on_target @on_target_cbs.clear end - def clean_callbacks + def clear_callbacks @on_provisional_response_cbs.clear @on_success_response_cbs.clear @on_failure_response_cbs.clear diff --git a/lib/oversip/sip/uri.rb b/lib/oversip/sip/uri.rb index 7eb6929..621f281 100644 --- a/lib/oversip/sip/uri.rb +++ b/lib/oversip/sip/uri.rb @@ -98,7 +98,7 @@ def del_param k false end - def clean_params + def clear_params return nil if unknown_scheme? return false unless @params @params.clear diff --git a/test/test_uri.rb b/test/test_uri.rb index 42732d4..a3368a1 100644 --- a/test/test_uri.rb +++ b/test/test_uri.rb @@ -23,7 +23,7 @@ def test_sip_uri assert_equal aor, uri.aor assert_equal full_uri, uri.to_s - uri.clean_params + uri.clear_params assert_equal({}, uri.params) assert_equal "sips:i%C3%B1aki@aliax.net:5060?X-Header-1=qwe&X-Header-2=asd", uri.to_s @@ -45,7 +45,7 @@ def test_tel_uri assert_equal aor, uri.aor assert_equal full_uri, uri.to_s - uri.clean_params + uri.clear_params assert_equal({}, uri.params) assert_equal aor, uri.to_s @@ -63,6 +63,6 @@ def test_http_uri assert_true uri.unknown_scheme? assert_nil uri.aor assert_equal full_uri, uri.to_s - assert_nil uri.clean_params + assert_nil uri.clear_params end end