shadow_cabinet 0.1.0 → 0.1.1

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: 7c7d851f2e66541dedd6f0ee304a55c2cd6951a3
4
- data.tar.gz: f2cd55dca943163cfd9073a1a3a332cc7560854d
3
+ metadata.gz: c44deaa7aadd38cd40b6a6befdc6a52935196129
4
+ data.tar.gz: d31e296b01b54f233ce316c896dc2dd111d808c5
5
5
  SHA512:
6
- metadata.gz: 2bc35e6ff56f09b8134d3f22b5290de521d3c2823d6ca751d114138aadd7532f1b1e67938b710e3cbbd37999b4dc32014bc20942ed225a3dd8da5026c680f777
7
- data.tar.gz: b223b04db5624e6081477f26010dedf4b9e2d2afb5baf56e0145e0d3a331f9bc6072495f0bcad1a54cbd9c84e9b2c9942073140bedccca5ac3d9209df33c08e9
6
+ metadata.gz: 18ecfa417d78f384d8b8df4af4c57e59d4159df981aadc11985575ad7ef79597d327493a369648fe7f35888fcbd5f4da0a9e04ba0ed5e1d55c335636be5382b8
7
+ data.tar.gz: bc032e5b03497928b02bd8c51d197fc47639c89505ee4b4c04a7bedcac789b42a0b92f5d47e047c205207fc5722405ee403aa6a1379b3ff500bcb457308653bc
@@ -47,6 +47,18 @@ module ShadowCabinet
47
47
  result.body
48
48
  end
49
49
 
50
+ def patch(path:, params: {}, data: nil)
51
+ result = make_request(
52
+ verb: :patch,
53
+ request_url: construct_url(path: path, params: params),
54
+ data: data
55
+ )
56
+
57
+ raise result.error if result.error_present?
58
+
59
+ result.body
60
+ end
61
+
50
62
  def delete(path:, params: {})
51
63
  result = make_request(
52
64
  verb: :delete,
@@ -0,0 +1,25 @@
1
+ require 'shadow_cabinet/client/base'
2
+ require 'shadow_cabinet/client/real/request/base'
3
+
4
+ module ShadowCabinet
5
+ module Client
6
+ class Real < Base
7
+ module Request
8
+ # Implementation for the HTTP PUT verb
9
+ class Patch < Base
10
+
11
+ def perform
12
+ response = connector.patch(path, data) do |req|
13
+ params.keys.each do |key|
14
+ req.params[key] = params[key]
15
+ end
16
+ end
17
+
18
+ process_response(response)
19
+ end
20
+
21
+ end
22
+ end
23
+ end
24
+ end
25
+ end
@@ -1,4 +1,5 @@
1
1
  require 'shadow_cabinet/client/base'
2
+ require 'shadow_cabinet/client/real/request/patch'
2
3
  require 'shadow_cabinet/client/real/request/put'
3
4
 
4
5
  module ShadowCabinet
@@ -6,6 +7,7 @@ module ShadowCabinet
6
7
  class Real < Base
7
8
  module Request
8
9
  KNOWN = {
10
+ patch: Patch,
9
11
  put: Put,
10
12
  }
11
13
 
@@ -1,3 +1,3 @@
1
1
  module ShadowCabinet
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
@@ -8,7 +8,7 @@ module ShadowCabinet
8
8
 
9
9
  def self.update_box(api, id, content)
10
10
  begin
11
- data = api.put(
11
+ data = api.patch(
12
12
  path: "/boxes/#{id}",
13
13
  data: {
14
14
  "box" => {
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shadow_cabinet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dennis Walters
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-10-19 00:00:00.000000000 Z
11
+ date: 2017-10-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: addressable
@@ -104,6 +104,7 @@ files:
104
104
  - lib/shadow_cabinet/client/real.rb
105
105
  - lib/shadow_cabinet/client/real/request.rb
106
106
  - lib/shadow_cabinet/client/real/request/base.rb
107
+ - lib/shadow_cabinet/client/real/request/patch.rb
107
108
  - lib/shadow_cabinet/client/real/request/put.rb
108
109
  - lib/shadow_cabinet/client/result.rb
109
110
  - lib/shadow_cabinet/version.rb