teapi 0.0.3 → 0.0.4

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: 35d6852fbee1e3842f870c98058b6a9a44e8e628
4
- data.tar.gz: c0f199565bf9ea85bc6993ccb961c2b6fb45c522
3
+ metadata.gz: d9efba70f47e061c23daf22609ca3de99ca12d04
4
+ data.tar.gz: d2d16fa7c2e0cbb040450a502ac292a476d528f4
5
5
  SHA512:
6
- metadata.gz: 533a0e4be5f692d9bcec02fa24f660443be2772a18dcb46266d7bba0ac89de6b72e507ff007f37a6fecb0617cad3a3f7d6b4615f2187dd06f63044ef8b63405e
7
- data.tar.gz: a31bb5bdc83ec8d14981b742b9caf638732fa82c3e53c713ac4bd36902324049efaed31953a1bfd2018b6102d133d6b77b68e12d23c1a187972cdbe1d6a54009
6
+ metadata.gz: 593ea60d31c235c808969579b78b7629a27dc294e719e263950481c5caa78be98bc1bc9d8eb95d96cd238cb9b0beb1322b03c88f0d66d4615eec5563dab664ef
7
+ data.tar.gz: aeb8df18626a7df99e5aaf0c94b1d0a46acb6c788c5dea40178678e8d7cdb9c4236cfc1a06b8bae0344edde729488d9f2cd35b095ecd4e48eb64b647b02a0277
@@ -26,7 +26,7 @@ module Teapi #:nodoc
26
26
 
27
27
  # Issues a POST request to the teapi.io service
28
28
  # @param resource [Symbol] name of resource
29
- # @param body [Hash] to send to the service
29
+ # @param body [String] to send to the service
30
30
  def post(resource, body)
31
31
  assert_configured()
32
32
  sender.request(:post, resource, {body: body})
@@ -34,7 +34,7 @@ module Teapi #:nodoc
34
34
 
35
35
  # Issues a PUT request to the teapi.io service
36
36
  # @param resource [Symbol] name of resource
37
- # @param body [Hash] to send to the service
37
+ # @param body [String] to send to the service
38
38
  def put(resource, body)
39
39
  assert_configured()
40
40
  sender.request(:put, resource, {body: body})
@@ -42,7 +42,7 @@ module Teapi #:nodoc
42
42
 
43
43
  # Issues a DELETE request to the teapi.io service
44
44
  # @param resource [Symbol] name of resource
45
- # @param body [Hash] to send to the service
45
+ # @param body [String] to send to the service
46
46
  def delete(resource, body)
47
47
  assert_configured()
48
48
  sender.request(:delete, resource, {body: body})
@@ -22,10 +22,6 @@ module Teapi
22
22
  'Date' => d,
23
23
  'Authorization' => sign(url, d, args),
24
24
  })
25
- if args[:body] != nil && args[:body].length > 1024 then
26
- args[:body] = gzip(args[:body])
27
- args[:headers]['Content-Encoding'] = 'gzip'
28
- end
29
25
  scheme = @configuration.secure ? "https" : "http"
30
26
  res = HTTParty.send(method, "#{scheme}://#{@configuration.host}#{url}", args)
31
27
  if res.code == 401 && res.parsed_response.include?('date') && date.nil?
@@ -40,13 +36,5 @@ module Teapi
40
36
  signature = OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @configuration.sync_secret, data)
41
37
  "HMAC-SHA256 Credential=#{@configuration.sync_key},Signature=#{signature}"
42
38
  end
43
-
44
- def gzip(body)
45
- io = StringIO.new("w")
46
- gz = Zlib::GzipWriter.new(io)
47
- gz.write(body)
48
- gz.close
49
- io.string
50
- end
51
39
  end
52
40
  end
@@ -1,3 +1,3 @@
1
1
  module Teapi
2
- VERSION = '0.0.3'
2
+ VERSION = '0.0.4'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teapi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Karl Seguin
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-18 00:00:00.000000000 Z
11
+ date: 2014-12-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty