flexirest 1.2.13 → 1.2.14
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 +8 -0
- data/lib/flexirest/connection.rb +12 -0
- data/lib/flexirest/request.rb +2 -0
- data/lib/flexirest/version.rb +1 -1
- data/spec/lib/connection_spec.rb +9 -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: 1829b93bc9f82a36aa5cd054daf80fedeab148f7
|
4
|
+
data.tar.gz: ef4c0be801366148c4886abd1ff07a62fd03e5b4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 228683577e300af294661c84166b6aad293ff1d34810194fd51305a457f2341f68a1d1d8188f64b2e47417f040519b3fee5f31fb89cc7260a23c919dea645bea
|
7
|
+
data.tar.gz: e3e0afa82fa08efbde36eb700aaabe5ccab275d9c4e3001493c9c699cb198a6398b498202a1015d2265407044d8ac1f9c866fa318d599c00a12a5bea0eed30d8
|
data/CHANGELOG.md
CHANGED
data/lib/flexirest/connection.rb
CHANGED
@@ -57,6 +57,18 @@ module Flexirest
|
|
57
57
|
end
|
58
58
|
end
|
59
59
|
|
60
|
+
def patch(path, data, options={})
|
61
|
+
set_defaults(options)
|
62
|
+
make_safe_request(path) do
|
63
|
+
@session.patch(path) do |req|
|
64
|
+
set_per_request_timeout(req, options) if options[:timeout]
|
65
|
+
req.headers = req.headers.merge(options[:headers])
|
66
|
+
req.body = data
|
67
|
+
sign_request(req, options[:api_auth])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
end
|
71
|
+
|
60
72
|
def post(path, data, options={})
|
61
73
|
set_defaults(options)
|
62
74
|
make_safe_request(path) do
|
data/lib/flexirest/request.rb
CHANGED
@@ -339,6 +339,8 @@ module Flexirest
|
|
339
339
|
response = connection.put(@url, @body, request_options)
|
340
340
|
when :post
|
341
341
|
response = connection.post(@url, @body, request_options)
|
342
|
+
when :patch
|
343
|
+
response = connection.patch(@url, @body, request_options)
|
342
344
|
when :delete
|
343
345
|
response = connection.delete(@url, request_options)
|
344
346
|
else
|
data/lib/flexirest/version.rb
CHANGED
data/spec/lib/connection_spec.rb
CHANGED
@@ -79,6 +79,15 @@ describe Flexirest::Connection do
|
|
79
79
|
expect(result.body).to eq("{result:true}")
|
80
80
|
end
|
81
81
|
|
82
|
+
it "should pass a PUT request through to Faraday" do
|
83
|
+
stub_request(:patch, "www.example.com/foo").
|
84
|
+
with(body: "body").
|
85
|
+
to_return(body: "{result:true}", :headers => @default_headers)
|
86
|
+
|
87
|
+
result = @connection.patch("/foo", "body")
|
88
|
+
expect(result.body).to eq("{result:true}")
|
89
|
+
end
|
90
|
+
|
82
91
|
it "should pass a POST request through to Faraday" do
|
83
92
|
stub_request(:post, "www.example.com/foo").
|
84
93
|
with(body: "body", :headers => @default_headers).
|
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.2.
|
4
|
+
version: 1.2.14
|
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-01-
|
11
|
+
date: 2016-01-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|