nd_sync 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: 1d0aed4d787144688f5724075f552fb90d6ea48e
4
- data.tar.gz: 2b3f8eda58da146fa9430948f37319c67ab41942
3
+ metadata.gz: 6646e32177aa52c7e5899647656c29329ebaad9d
4
+ data.tar.gz: e665f4fb6c5727bbeaa7cd68cf7f34c778a39874
5
5
  SHA512:
6
- metadata.gz: ce0c50d0c5fef26e25a8ca16115cb000991425b7c87197714561eeebe7cef451fa7cc38061c1b80e48d59ad815d52e01123fcc608cee9ae97ce4c84b27584aa2
7
- data.tar.gz: 31bb939ebbf10114342493b1d71a73894e8a885a4084c03f0f2127aecfef4807b93d0be071004b3d197dbe917cfaf676b8a384d54d7955aa3c10e6377942ec7d
6
+ metadata.gz: 07ba8f37f670adf5722312eaf072a2b4355fb775f94c7c5d32f0819c8600ab27a76a9396a069525ed57d141f6bf3e719163a5f51a3dc9da29a8aab101b6b1a45
7
+ data.tar.gz: e66ae84e9b28c14eebe1181d5cfc78cab83da171bfdb1239dbff3bdf3e1c378a08b23cd3bccaccbc527d6ec63eaa163a70279cbf0cc61d9c764de79d129c0e66
@@ -18,12 +18,15 @@ module NdSync
18
18
  end
19
19
 
20
20
  def receive(locals)
21
- response = post(:batch, {}, to_batch(transcribe_all(locals)))
22
- JSON.parse(response.body).each_with_index do |remote_hash, idx|
21
+ JSON.parse(post_batch(locals).body).each_with_index do |remote_hash, idx|
23
22
  locals[idx].transmitted_to new(remote_hash)
24
23
  end
25
24
  end
26
25
 
26
+ def post_batch(locals)
27
+ post(:batch, {}, to_batch(transcribe_all(locals)))
28
+ end
29
+
27
30
  def to_batch(collection)
28
31
  Jbuilder.encode do |json|
29
32
  json.set! collection_name do
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'nd_sync'
3
- s.version = '0.0.3'
3
+ s.version = '0.0.4'
4
4
  s.date = '2014-09-01'
5
5
  s.summary = "Synchronizing local and remote objects."
6
6
  s.description = "Synchronizes database with RESTful web service."
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: nd_sync
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
  - Diego Aguir Selzlein