lib/runcible/base.rb in runcible-1.12.0 vs lib/runcible/base.rb in runcible-2.0.0

- old
+ new

@@ -73,12 +73,12 @@ log_exception raise e end def get_response(client, path, *args) - client[path].send(*args) do |response, request, result, &_block| - resp = response.return!(request, result) + client[path].send(*args) do |response, _request, _result, &_block| + resp = response.return! log_debug return resp end end @@ -130,23 +130,15 @@ elsif body.is_a? Array body = body.map do |i| i.respond_to?(:with_indifferent_access) ? i.with_indifferent_access : i end end - response = rest_client_response(body, response.net_http_res, response.args) + response = Runcible::Response.new(body, response) rescue JSON::ParserError log_exception end return response - end - - def rest_client_response(body, net_http_res, args) - if Gem.loaded_specs['rest-client'].version < Gem::Version.create('1.8.0') - RestClient::Response.create(body, net_http_res, args) - else - RestClient::Response.create(body, net_http_res, args, nil) - end end def required_params(local_names, binding, keys_to_remove = []) local_names = local_names.each_with_object({}) do |v, acc| value = binding.eval(v.to_s) unless v == :_