dato 0.7.0 → 0.7.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/dato/local/loader.rb +17 -0
- data/lib/dato/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72cf7ee954d8a8d7cd830e96740e32cb6aa2bf3de95d6d665dcc9d59956313f4
|
4
|
+
data.tar.gz: df97ce29199800559fcfef471a70e76cb75bc50d84175d55c9db35f8d53e685e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8605bfa3d4c080d249c13958e48fce6b39ecdf632269d8786b8c10767dc6f1ef53434b82bac04b2ef922a9fe6ddebda56848bb75387c7fb825c7fbf300d91a8a
|
7
|
+
data.tar.gz: 2f0db7c66bfd1c84f0a93a6fdecdaaf5289401b92cef4644a2ee722e863866c40a3fe45337298e4adb1af342e2551173b1e3fd08535d178c74d8efde500d4ac2
|
data/lib/dato/local/loader.rb
CHANGED
@@ -45,6 +45,7 @@ module Dato
|
|
45
45
|
|
46
46
|
pusher.subscribe("private-site-#{site_id}")
|
47
47
|
|
48
|
+
bind_on_site_upsert(&block)
|
48
49
|
bind_on_item_destroy(&block)
|
49
50
|
bind_on_item_upsert(&block)
|
50
51
|
bind_on_item_type_upsert(&block)
|
@@ -61,6 +62,22 @@ module Dato
|
|
61
62
|
|
62
63
|
private
|
63
64
|
|
65
|
+
def bind_on_site_upsert(&block)
|
66
|
+
bind_on("site:upsert", block) do |data|
|
67
|
+
threads = [
|
68
|
+
Thread.new { Thread.current[:output] = site },
|
69
|
+
Thread.new { Thread.current[:output] = all_items }
|
70
|
+
]
|
71
|
+
|
72
|
+
results = threads.map do |t|
|
73
|
+
t.join
|
74
|
+
t[:output]
|
75
|
+
end
|
76
|
+
|
77
|
+
@entities_repo = EntitiesRepo.new(*results)
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
64
81
|
def bind_on_item_upsert(&block)
|
65
82
|
event_type = preview_mode ? 'preview_mode' : 'published_mode'
|
66
83
|
|
data/lib/dato/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: dato
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Stefano Verna
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-03-
|
11
|
+
date: 2019-03-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|