teapi 0.0.4 → 0.0.5

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: d9efba70f47e061c23daf22609ca3de99ca12d04
4
- data.tar.gz: d2d16fa7c2e0cbb040450a502ac292a476d528f4
3
+ metadata.gz: 648c3666c46b3a7ef72d0edfc6306d9aecae4b92
4
+ data.tar.gz: afb4b3bb50d6e73e3188bdf9d876c7115062001c
5
5
  SHA512:
6
- metadata.gz: 593ea60d31c235c808969579b78b7629a27dc294e719e263950481c5caa78be98bc1bc9d8eb95d96cd238cb9b0beb1322b03c88f0d66d4615eec5563dab664ef
7
- data.tar.gz: aeb8df18626a7df99e5aaf0c94b1d0a46acb6c788c5dea40178678e8d7cdb9c4236cfc1a06b8bae0344edde729488d9f2cd35b095ecd4e48eb64b647b02a0277
6
+ metadata.gz: 718bfc80548f7dbf99ed0684adf3d1c5604baa13422c5a7d56325020d58589f00d94eed32865572a9f8fb16eeda91884e6da8913a53e2467c97440fc106cd61e
7
+ data.tar.gz: a8a6340e339575451e9c4173469b23179337004dfe5f266b46920924d61eae08f03fb1d28518aa2b1abb2931e6313ea8e3485f8a4106c00d943a27f49c9e7bf5
@@ -8,7 +8,7 @@ module Teapi
8
8
  def self.create(type, doc, meta = nil)
9
9
  d = {type: type, doc: doc}
10
10
  d[:meta] = meta unless meta.nil?
11
- Teapi.post(:documents, Oj.dump(d, mode: :compat))
11
+ Teapi.post(:documents, Oj.dump(d, mode: :compat, time_format: :ruby))
12
12
  end
13
13
 
14
14
  # updates the document belonging to the given type
@@ -18,14 +18,14 @@ module Teapi
18
18
  def self.update(type, doc, meta = nil)
19
19
  d = {type: type, doc: doc}
20
20
  d[:meta] = meta unless meta.nil?
21
- Teapi.put(:documents, Oj.dump(d, mode: :compat))
21
+ Teapi.put(:documents, Oj.dump(d, mode: :compat, time_format: :ruby))
22
22
  end
23
23
 
24
24
  # deletes the document, by its id, belonging to the given type
25
25
  # @param type [String] the document's type
26
26
  # @param doc [Hash] the document to update
27
27
  def self.delete(type, id)
28
- Teapi.delete(:documents, Oj.dump({type: type, id: id}, mode: :compat))
28
+ Teapi.delete(:documents, Oj.dump({type: type, id: id}, mode: :compat, time_format: :ruby))
29
29
  end
30
30
 
31
31
  # bulk updates a type
@@ -34,7 +34,7 @@ module Teapi
34
34
  # @param deleted [Array[Hash]] an array of document [{id: 343}, {id: 9920},...]
35
35
  def self.bulk(type, created_or_updated, deleted)
36
36
  return if (created_or_updated.nil? || created_or_updated.length == 0) && (deleted.nil? || deleted.length == 0)
37
- Teapi.post(:documents, Oj.dump({type: type, deletes: deleted, upserts: created_or_updated}, mode: :compat))
37
+ Teapi.post(:documents, Oj.dump({type: type, deletes: deleted, upserts: created_or_updated}, mode: :compat, time_format: :ruby))
38
38
  end
39
39
  end
40
40
  end
@@ -17,7 +17,7 @@ module Teapi
17
17
 
18
18
  def request(method, resource, args = {}, date = nil)
19
19
  url = BASE_URL + resource.to_s
20
- d = date || Time.now.httpdate
20
+ d = date || Time.now.utc.httpdate
21
21
  args[:headers] = (args[:headers] || {}).merge({
22
22
  'Date' => d,
23
23
  'Authorization' => sign(url, d, args),
@@ -1,3 +1,3 @@
1
1
  module Teapi
2
- VERSION = '0.0.4'
2
+ VERSION = '0.0.5'
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.4
4
+ version: 0.0.5
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-22 00:00:00.000000000 Z
11
+ date: 2014-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty