webspicy 0.21.1 → 0.21.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97689918c57ae657af0489045046119ff923943a8ba2e3e6f5006493536060fa
4
- data.tar.gz: 6009c0c1f38ca121052be22e0f88d9e08f829e7e740c987b4c2ccb0f520262d6
3
+ metadata.gz: f4ed553ffebc5521719b8ae05848942894671b9fc5599af596697bb774d3503d
4
+ data.tar.gz: 40c18bb7c4f4e6549a81d9cff8f671d5dc239bca5bf44a7f205c08cde901af09
5
5
  SHA512:
6
- metadata.gz: ca096e985a59b6dcbc553e86dc7e731515a2dcd23200e850aa355a2d693b30df2b2cf40ebe0db03637aa72096f76a13d7473d6a40b6c022c0eb37a4282268da1
7
- data.tar.gz: 2c6fef230643fbf20507346bf5321f4738ab2bb91388045494ee64fce22fcc6819b7d67b7a46fadc566cfc9093fcbd40097575ecf4ea96f9494fa9ac158611c3
6
+ metadata.gz: 0f5ca666ad6d74f5a070671bf7ec97e9f40922322b24fdbfb20767afe08b2bbd31db7801b2c5d580d6e9a5adcbc44040a5431f23943941a9828c9cea04c40b4b
7
+ data.tar.gz: cbf46a595dc6365e65b38442097f617c5f845a7daea54c18aeac2a374dec46949061b5a534577a57ba68ea19bfe627abae2e6f2b9b0fa59f1ffa35ac5494316d
@@ -2,7 +2,7 @@ module Webspicy
2
2
  module Version
3
3
  MAJOR = 0
4
4
  MINOR = 21
5
- TINY = 1
5
+ TINY = 2
6
6
  end
7
7
  VERSION = "#{Version::MAJOR}.#{Version::MINOR}.#{Version::TINY}"
8
8
  end
@@ -55,8 +55,8 @@ module Webspicy
55
55
  def options(url, params = {}, headers = nil, body = nil)
56
56
  info_request("OPTIONS", url, params, headers, body)
57
57
 
58
- params = querystring_params(params)
59
- http_opts = http_options(params: params)
58
+ url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
59
+ http_opts = http_options
60
60
  @last_response = HTTP[headers || {}].options(url, http_opts)
61
61
 
62
62
  debug_response(@last_response)
@@ -67,8 +67,8 @@ module Webspicy
67
67
  def get(url, params = {}, headers = nil, body = nil)
68
68
  info_request("GET", url, params, headers, body)
69
69
 
70
- params = querystring_params(params)
71
- http_opts = http_options(params: params)
70
+ url = url + "?" + Rack::Utils.build_query(params) if !params.empty?
71
+ http_opts = http_options
72
72
  @last_response = HTTP[headers || {}].get(url, http_opts)
73
73
 
74
74
  debug_response(@last_response)
@@ -111,6 +111,7 @@ module Webspicy
111
111
  def patch(url, params = {}, headers = nil, body = nil)
112
112
  info_request("PATCH", url, params, headers, body)
113
113
 
114
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
114
115
  headers ||= {}
115
116
  headers['Content-Type'] ||= 'application/json'
116
117
  http_opts = http_options(body: params.to_json)
@@ -124,6 +125,7 @@ module Webspicy
124
125
  def put(url, params = {}, headers = nil, body = nil)
125
126
  info_request("PUT", url, params, headers, body)
126
127
 
128
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
127
129
  headers ||= {}
128
130
  headers['Content-Type'] ||= 'application/json'
129
131
  http_opts = http_options(body: params.to_json)
@@ -137,6 +139,7 @@ module Webspicy
137
139
  def post_form(url, params = {}, headers = nil, body = nil)
138
140
  info_request("POST", url, params, headers, body)
139
141
 
142
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
140
143
  http_opts = http_options(form: params)
141
144
  @last_response = HTTP[headers || {}].post(url, http_opts)
142
145
 
@@ -148,6 +151,7 @@ module Webspicy
148
151
  def delete(url, params = {}, headers = nil, body = nil)
149
152
  info_request("DELETE", url, params, headers, body)
150
153
 
154
+ url = url + "?" + Rack::Utils.build_query(params) if body && !params.empty?
151
155
  http_opts = http_options(body: params.to_json)
152
156
  @last_response = HTTP[headers || {}].delete(url, http_opts)
153
157
 
@@ -156,7 +160,7 @@ module Webspicy
156
160
  @last_response
157
161
  end
158
162
 
159
- def http_options(extra)
163
+ def http_options(extra = {})
160
164
  if config.insecure
161
165
  ctx = OpenSSL::SSL::SSLContext.new
162
166
  ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webspicy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.21.1
4
+ version: 0.21.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bernard Lambeau
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-07-19 00:00:00.000000000 Z
11
+ date: 2022-07-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake