flexirest 1.3.26 → 1.3.27
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/flexirest.gemspec +1 -0
- data/lib/flexirest/request.rb +3 -1
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/request_spec.rb +6 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 41037b044f911e96fa8ef57aaacae1c8ab7b4c46
|
4
|
+
data.tar.gz: fa0e305dfa953cab72072df58e10d8fbad96bef9
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aea60eaa4a88d43f48c87d3e7753660f7042b1cfc7ddc682454c21c9bbab28db9fcb29839a703409326166f9e02bc80479900d791b47aec0c782829e1bd440e5
|
7
|
+
data.tar.gz: c7f4e0e891019152782e07fc3546bccdab28a401ccb40e3b37d922d89cfe65ff2980260e5f03595273271caf13f1f40ebc501d3359c910145cec19618c742eaf
|
data/CHANGELOG.md
CHANGED
data/flexirest.gemspec
CHANGED
@@ -46,5 +46,6 @@ Gem::Specification.new do |spec|
|
|
46
46
|
if Gem::Version.new(RUBY_VERSION) < Gem::Version.new('2.0.0')
|
47
47
|
spec.add_runtime_dependency "json", "< 2.0.0"
|
48
48
|
spec.add_runtime_dependency "tins", "~> 1.6.0"
|
49
|
+
spec.add_runtime_dependency "term-ansicolor", "~> 1.3.2"
|
49
50
|
end
|
50
51
|
end
|
data/lib/flexirest/request.rb
CHANGED
@@ -287,7 +287,9 @@ module Flexirest
|
|
287
287
|
end
|
288
288
|
|
289
289
|
def prepare_request_body(params = nil)
|
290
|
-
if
|
290
|
+
if http_method == :get
|
291
|
+
@body = ""
|
292
|
+
elsif request_body_type == :form_encoded
|
291
293
|
@body ||= (params || @post_params || {}).to_query
|
292
294
|
headers["Content-Type"] ||= "application/x-www-form-urlencoded"
|
293
295
|
elsif request_body_type == :json
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/request_spec.rb
CHANGED
@@ -238,6 +238,12 @@ describe Flexirest::Request do
|
|
238
238
|
ExampleClient.update id:1234, debug:true, test:'foo'
|
239
239
|
end
|
240
240
|
|
241
|
+
it "should not pass through an encoded empty body parameter" do
|
242
|
+
expect_any_instance_of(Flexirest::Connection).to receive(:get).with("/1234", an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", response_headers:{})))
|
243
|
+
ExampleClient.request_body_type :json
|
244
|
+
ExampleClient.find id:1234
|
245
|
+
end
|
246
|
+
|
241
247
|
it "allows forcing a request_body_type per request" do
|
242
248
|
expect_any_instance_of(Flexirest::Connection).to receive(:post).with("/encoding", %q({"id":1234,"test":"something"}), an_instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", response_headers:{})))
|
243
249
|
ExampleClient.request_body_type :form_encoded # Should be ignored and the per_method :json used
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flexirest
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.27
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andy Jeffries
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-11-
|
11
|
+
date: 2016-11-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|