tapsoob 0.4.2 → 0.4.7
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 +4 -4
- data/lib/tapsoob/data_stream.rb +1 -1
- data/lib/tapsoob/operation.rb +3 -2
- data/lib/tapsoob/utils.rb +9 -4
- data/lib/tapsoob/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: cc84752fc2a91822aa3bc16f26c08caeeb65908cef115a65a926ef8b20234af2
|
4
|
+
data.tar.gz: d8a7436afa147cb420c18552e3dcbbed8e1255a74176463ddaa6a51bf23fc8be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 639660bd7c1d819d8cace1b1270356628c2e4c7784c65ec828ad71e59316e651d94c10068c45d9185ad5a89115e31d237d33300452b8cf30d1a11198d437361b
|
7
|
+
data.tar.gz: 0c5f443dc175183a43ae68573f3c32775e9ca339e29a467d9b9303d684b4d3a4b533fd2509065f18266cf17f7e71fb39a69f6d44c13acbc46215f916fc55e769
|
data/lib/tapsoob/data_stream.rb
CHANGED
data/lib/tapsoob/operation.rb
CHANGED
@@ -227,8 +227,6 @@ module Tapsoob
|
|
227
227
|
Tapsoob::Utils.export_rows(dump_path, stream.table_name, rows)
|
228
228
|
end
|
229
229
|
end
|
230
|
-
break if stream.complete?
|
231
|
-
progress.inc(size) if progress && !exiting?
|
232
230
|
stream.error = false
|
233
231
|
self.stream_state = stream.to_hash
|
234
232
|
rescue Tapsoob::CorruptedData => e
|
@@ -236,6 +234,9 @@ module Tapsoob
|
|
236
234
|
stream.error = true
|
237
235
|
next
|
238
236
|
end
|
237
|
+
|
238
|
+
progress.inc(size) if progress && !exiting?
|
239
|
+
break if stream.complete?
|
239
240
|
end
|
240
241
|
|
241
242
|
progress.finish if progress
|
data/lib/tapsoob/utils.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# -*- encoding : utf-8 -*-
|
2
2
|
require 'zlib'
|
3
|
+
require 'active_support/core_ext/file/atomic.rb'
|
3
4
|
|
4
5
|
require 'tapsoob/errors'
|
5
6
|
require 'tapsoob/chunksize'
|
@@ -143,11 +144,15 @@ Data : #{data}
|
|
143
144
|
data = row_data
|
144
145
|
if File.exists?(File.join(dump_path, "data", "#{table}.json"))
|
145
146
|
previous_data = JSON.parse(File.read(File.join(dump_path, "data", "#{table}.json")))
|
146
|
-
data[:data] = previous_data["data"] + row_data[:data]
|
147
|
-
end
|
147
|
+
data[:data] = (previous_data["data"].nil? ? row_data[:data] : previous_data["data"] + row_data[:data])
|
148
148
|
|
149
|
-
|
150
|
-
|
149
|
+
File.atomic_write(File.join(dump_path, "data", "#{table}.json")) do |file|
|
150
|
+
file.write(JSON.generate(data))
|
151
|
+
end
|
152
|
+
else
|
153
|
+
File.open(File.join(dump_path, "data", "#{table}.json"), 'w') do |file|
|
154
|
+
file.write(JSON.generate(data))
|
155
|
+
end
|
151
156
|
end
|
152
157
|
end
|
153
158
|
|
data/lib/tapsoob/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tapsoob
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Félix Bellanger
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2021-
|
12
|
+
date: 2021-07-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: ripl
|