nutella_lib 0.4.24 → 0.4.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/util/mongo_persisted_hash.rb +8 -3
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c8350b0d60a7ecfa57ae8f2c794a4d9f1e52461e
|
4
|
+
data.tar.gz: e88f23e2a3a4cb9af2e5e3b2e4e583370cfbbdf0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ae8e248442adf73196a6c70cef6621a7e6affd28717786e7f9cfec32d6daa89db945ca613b0e177ee1f36304e2ac10136f694266da52f4b0b4d5d879cdbce06
|
7
|
+
data.tar.gz: 6c801b3f4804aac7f64cf7437283fddb147325a1559877a683c36197f0aff67335b3bb69112d7620d86581ab4402c233cd661134004c443a6c39698574e4c74d
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.4.
|
1
|
+
0.4.25
|
@@ -127,14 +127,17 @@ class MongoPersistedHash
|
|
127
127
|
@r = @collection.find({_id: @doc_id}).limit(1).first
|
128
128
|
}
|
129
129
|
end
|
130
|
-
@r.nil?
|
130
|
+
if(@r.nil?)
|
131
|
+
@r = {'_id' => @doc_id};
|
132
|
+
end
|
133
|
+
@r
|
131
134
|
end
|
132
135
|
|
133
136
|
|
134
137
|
def store_hash(hash)
|
135
138
|
@s.synchronize {
|
136
139
|
@r = hash
|
137
|
-
if(@auto_save)
|
140
|
+
if(@auto_save and !@r.empty?)
|
138
141
|
@collection.find({'_id' => @doc_id}).find_one_and_replace(@r, :upsert => :true)
|
139
142
|
end
|
140
143
|
}
|
@@ -142,7 +145,9 @@ class MongoPersistedHash
|
|
142
145
|
|
143
146
|
def save
|
144
147
|
@s.synchronize {
|
145
|
-
|
148
|
+
if(defined? @r and !@r.empty?)
|
149
|
+
@collection.find({'_id' => @doc_id}).find_one_and_replace(@r, :upsert => :true)
|
150
|
+
end
|
146
151
|
}
|
147
152
|
end
|
148
153
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: nutella_lib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Alessandro Gnoli
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-10-
|
11
|
+
date: 2015-10-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mqtt
|