Project

General

Profile

Revision ce4e7bc9

Added by Justin Sherrill almost 7 years ago

Fixes #13700 - Updating to support rest-client 1.8.0

View differences:

lib/runcible/base.rb
132 132
            i.respond_to?(:with_indifferent_access) ? i.with_indifferent_access : i
133 133
          end
134 134
        end
135
        response = RestClient::Response.create(body, response.net_http_res, response.args)
135
        response = rest_client_response(body, response.net_http_res, response.args)
136 136
      rescue JSON::ParserError
137 137
        log_exception
138 138
      end
......
140 140
      return response
141 141
    end
142 142

  
143
    def rest_client_response(body, net_http_res, args)
144
      if Gem.loaded_specs['rest-client'].version < Gem::Version.create('1.8.0')
145
        RestClient::Response.create(body, net_http_res, args)
146
      else
147
        RestClient::Response.create(body, net_http_res, args, nil)
148
      end
149
    end
150

  
143 151
    def required_params(local_names, binding, keys_to_remove = [])
144 152
      local_names = local_names.each_with_object({}) do |v, acc|
145 153
        value = binding.eval(v.to_s) unless v == :_

Also available in: Unified diff