Skip to content
This repository has been archived by the owner on Aug 14, 2020. It is now read-only.

Commit

Permalink
s/clean/clear/g (make @saghul even happier)
Browse files Browse the repository at this point in the history
  • Loading branch information
ibc committed Feb 5, 2013
1 parent 31114a0 commit 8bc45d1
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
--------------------------------------
Expand Down
16 changes: 8 additions & 8 deletions lib/oversip/sip/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion lib/oversip/sip/uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions test/test_uri.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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

0 comments on commit 8bc45d1

Please sign in to comment.