class Sonarqube::Client
Wrapper for the Sonarqube
REST API.
Public Instance Methods
inspect()
click to toggle source
Text representation of the client, masking private token.
@return [String]
Calls superclass method
# File lib/sonarqube/client.rb, line 18 def inspect inspected = super inspected.sub! @private_token, only_show_last_four_chars(@private_token) if @private_token inspected end
url_encode(url)
click to toggle source
Utility method for URL encoding of a string. Copied from ruby-doc.org/stdlib-2.7.0/libdoc/erb/rdoc/ERB/Util.html
@return [String]
# File lib/sonarqube/client.rb, line 28 def url_encode(url) url.to_s.b.gsub(/[^a-zA-Z0-9_\-.~]/n) { |m| sprintf('%%%02X', m.unpack1('C')) } # rubocop:disable Style/FormatString, Style/FormatStringToken end
Private Instance Methods
only_show_last_four_chars(token)
click to toggle source
# File lib/sonarqube/client.rb, line 34 def only_show_last_four_chars(token) "#{'*' * (token.size - 4)}#{token[-4..-1]}" end