flexirest 1.3.8 → 1.3.9

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
  SHA1:
3
- metadata.gz: 6204a41748bf45aed4d2e5b0fb2a7783f4bd1dae
4
- data.tar.gz: 4c67ff1d1d1638025e9e3227995e2c2150eac37c
3
+ metadata.gz: 8a9faf13ef3eccc8b4e00f771eac639c048eebac
4
+ data.tar.gz: 97436ce0b23e2edf6c56c88cf32f3bea86f86d3d
5
5
  SHA512:
6
- metadata.gz: e6bb1518bb126d2ca26a2ab63b770cd5712c503fb0bdcc9e7050802ec5d814e94025485ce0ab33df96a32e26c29878ed7c525d02bf88b1556c2aa892ea7c6695
7
- data.tar.gz: 5415aa9e6eaea1ca97b8a4b28cdc318c9550923c7dfb8ac9d182fa03e102dd3c184a79bb934b27211984375d70f72f858ce01d846c8261f1a061013989a79ffc
6
+ metadata.gz: 01e5b88653f5b6f0c943dd0c742dd1320b27371b244bda060ad7af86cf5ec0df8f41ce9a2a42137a7849e4460af72f3c85bf379eb923592003d061c964319b30
7
+ data.tar.gz: cd4c7b5d05801455c9956d0edd64134471525f8900d594b0d0b9b99b1042059f2db7009f7b56d85d5b14f7ef65708be42b2c10118c5dba86b8d13fefbc01406b
data/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.9
4
+
5
+ Feature:
6
+
7
+ - Proxying now works for PATCH requests, along with the existing GET, POST, PUT and DELETE (thanks to Andrew Schaper for the PR).
8
+
3
9
  ## 1.3.8
4
10
 
5
11
  Bugfix:
@@ -17,6 +17,10 @@ module Flexirest
17
17
  def put(match, &block)
18
18
  add_mapping(:put, match, block)
19
19
  end
20
+
21
+ def patch(match, &block)
22
+ add_mapping(:patch, match, block)
23
+ end
20
24
 
21
25
  def delete(match, &block)
22
26
  add_mapping(:delete, match, block)
@@ -1,3 +1,3 @@
1
1
  module Flexirest
2
- VERSION = "1.3.8"
2
+ VERSION = "1.3.9"
3
3
  end
@@ -30,6 +30,11 @@ class ProxyExample < Flexirest::ProxyBase
30
30
  body "MY-BODY-CONTENT"
31
31
  passthrough
32
32
  end
33
+
34
+ patch "/partial_update" do
35
+ body "MY-BODY-CONTENT"
36
+ passthrough
37
+ end
33
38
 
34
39
  delete '/remove' do
35
40
  passthrough
@@ -81,6 +86,7 @@ class ProxyClientExample < Flexirest::Base
81
86
  get :change_xml_format, "/change-xml-format"
82
87
  post :create, "/create"
83
88
  put :update, "/update"
89
+ patch :partial_update, "/partial_update"
84
90
  get :not_proxied, "/not_proxied"
85
91
  delete :remove, "/remove"
86
92
  get :hal_test, "/hal_test/:id"
@@ -106,8 +112,13 @@ describe Flexirest::Base do
106
112
  expect_any_instance_of(Flexirest::Connection).to receive(:post).with("/create", {age:12, first_name:"John"}.to_query, instance_of(Hash)).and_return(OpenStruct.new(body:"{\"result\":true}", status:200, headers:{}))
107
113
  ProxyClientExample.create(fname:"John", lname:"Smith")
108
114
  end
115
+
116
+ it "has access to raw body content for PATCH requests" do
117
+ expect_any_instance_of(Flexirest::Connection).to receive(:patch).with("/partial_update", "MY-BODY-CONTENT", instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", status:200, response_headers:{})))
118
+ ProxyClientExample.partial_update(fname:"John", lname:"Smith")
119
+ end
109
120
 
110
- it "has access to raw body content for requests" do
121
+ it "has access to raw body content for PUT requests" do
111
122
  expect_any_instance_of(Flexirest::Connection).to receive(:put).with("/update", "MY-BODY-CONTENT", instance_of(Hash)).and_return(::FaradayResponseMock.new(OpenStruct.new(body:"{\"result\":true}", status:200, response_headers:{})))
112
123
  ProxyClientExample.update(fname:"John", lname:"Smith")
113
124
  end
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.8
4
+ version: 1.3.9
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-04-07 00:00:00.000000000 Z
11
+ date: 2016-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler