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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 72ce354cca9d3d6e3051b5a75969652bfd894069
4
- data.tar.gz: 01064c899a466d791956896e7ef8d6434f9b37a6
3
+ metadata.gz: 1829b93bc9f82a36aa5cd054daf80fedeab148f7
4
+ data.tar.gz: ef4c0be801366148c4886abd1ff07a62fd03e5b4
5
5
  SHA512:
6
- metadata.gz: c3dcfe66b97a900b4d805dd59fd2285e5a01c7210d1d7b5261fb2e37a16ba05dfd5f13a39124b405f1c57c3f4413ee8a751dd09510d179ca688fed57f19f2e6f
7
- data.tar.gz: a7607106f1421c42739050f9d63d78d0bc24d37b7e0948b836dcdf1c3d5ec0cc98c7191106783fa2b8c45e0982945339ccba5b82512b03e34aba504677c19d6a
6
+ metadata.gz: 228683577e300af294661c84166b6aad293ff1d34810194fd51305a457f2341f68a1d1d8188f64b2e47417f040519b3fee5f31fb89cc7260a23c919dea645bea
7
+ data.tar.gz: e3e0afa82fa08efbde36eb700aaabe5ccab275d9c4e3001493c9c699cb198a6398b498202a1015d2265407044d8ac1f9c866fa318d599c00a12a5bea0eed30d8
@@ -1,5 +1,13 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.2.14
4
+
5
+ Bugfixes:
6
+
7
+ - Patch was partially implemented in 2014, but never completed. It should be working now (thanks to Joel Low)
8
+
9
+ # Changelog
10
+
3
11
  ## 1.2.13
4
12
 
5
13
  Bugfixes:
@@ -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
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.2.13"
2
+ VERSION = "1.2.14"
3
3
  end
@@ -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.13
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-19 00:00:00.000000000 Z
11
+ date: 2016-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler