lib/runcible/base.rb in runcible-2.8.1 vs lib/runcible/base.rb in runcible-2.9.0
- old
+ new
@@ -28,10 +28,11 @@
def path(*args)
self.class.path(*args)
end
# rubocop:disable Metrics/AbcSize:
+ # rubocop:disable PerceivedComplexity
def call(method, path, options = {})
self.logs = []
clone_config = self.config.clone
#on occation path will already have prefix (sync cancel)
path = clone_config[:api_path] + path unless path.start_with?(clone_config[:api_path])
@@ -65,11 +66,12 @@
client = RestClient::Resource.new(clone_config[:url], client_options)
args = [method]
args << generate_payload(options) if [:post, :put].include?(method)
args << headers
+ starting_arg = options[:no_log_payload] == true ? 2 : 1
+ self.logs << ([method.upcase, URI.join(client.url, path)] + args[starting_arg..-1]).join(': ')
- self.logs << ([method.upcase, URI.join(client.url, path)] + args[1..-1]).join(': ')
response = get_response(client, path, *args)
processed = process_response(response)
self.logs << "Response: #{response.code}: #{response.body}"
log_info
processed