cleaver_client 0.0.2 → 0.0.3

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.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cleaver_client.rb +19 -2
  3. metadata +1 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: eb051c9481a15c822452f1e1ef5178baea3bc0c2
4
- data.tar.gz: c1057e2212820cf569f78b4d16bbc3e3a6a9a842
3
+ metadata.gz: 476d2bf05f34c86f053a4f0160099d757dfd19c2
4
+ data.tar.gz: 6bb240ce31727dbb957994c23dc625fe58655889
5
5
  SHA512:
6
- metadata.gz: 1d89b6bff0f9a8665391f08568aa18d459a42a54b52d47ad823d5bdead8a34ea4ddc850c356b657f7233acde2b2f60b19304e2e7752eb8fc264c4d0789c2e44d
7
- data.tar.gz: af1687d075792383adb56fbdd86622d5735fbd8883ac928022242574d4843553c2959f4bd751c2930eb984f8d5a0173e16c881a08d9b29e2dd9479feb476d919
6
+ metadata.gz: 33f1bae295a9c09f073e7c4944a821feb10acbefa35f4351d12171cb9c3d3d20fc401da8c792151066b53296329a2b6776f762041831973707824a2678e6cacf
7
+ data.tar.gz: bea8ac382bfac77284de950d6e475f40ec772755728acbe6fa97c6db013d7c38b17bfcb8effef9422fc726ce65668046890bd972ab053d8570680c8f57e6fa76
@@ -6,6 +6,20 @@ class Hash
6
6
  end
7
7
  end
8
8
 
9
+ module RestClient2
10
+ include RestClient
11
+
12
+ def self.get(url, headers={}, &block)
13
+ Request.execute(:method => :get, :url => url, :headers => headers,
14
+ :timeout => nil, :open_timeout => nil, &block)
15
+ end
16
+
17
+ def self.post(url, payload, headers={}, &block)
18
+ Request.execute(:method => :post, :url => url, :payload => payload, :headers => headers,
19
+ :timeout => nil, :open_timeout => nil, &block)
20
+ end
21
+ end
22
+
9
23
  #This class creates a new cleaver client instance
10
24
  class CleaverClient
11
25
 
@@ -68,8 +82,11 @@ class CleaverClient
68
82
  if strategy == :get
69
83
  response = RestClient.get "#{@api_url}/#{uri}", params: data.to_json, :content_type => :json, :accept => :json
70
84
  else
71
- response = RestClient.send strategy, "#{@api_url}/#{uri}/", data.to_json, :content_type => :json, :accept => :json
72
- end
85
+ p strategy
86
+ p "#{@api_ur}/#{uri}/"
87
+ p data.to_json
88
+ response = RestClient2.send strategy, "#{@api_url}/#{uri}/", data.to_json, :content_type => :json, :accept => :json
89
+ end
73
90
  response = JSON.parse response
74
91
  response
75
92
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cleaver_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - rekero
@@ -56,4 +56,3 @@ signing_key:
56
56
  specification_version: 4
57
57
  summary: Cleaver API client
58
58
  test_files: []
59
- has_rdoc: