Module: Seahorse::Util Private
- Defined in:
- lib/seahorse/util.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Class Method Summary collapse
- .uri_escape(string) ⇒ Object private
- .uri_path_escape(path) ⇒ Object private
Class Method Details
.uri_escape(string) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/seahorse/util.rb', line 8 def uri_escape(string) CGI.escape(string.to_s.encode('UTF-8')).gsub('+', '%20').gsub('%7E', '~') end |
.uri_path_escape(path) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/seahorse/util.rb', line 12 def uri_path_escape(path) path.gsub(/[^\/]+/) { |part| uri_escape(part) } end |