tapsoob 0.4.7 → 0.4.13

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
  SHA256:
3
- metadata.gz: cc84752fc2a91822aa3bc16f26c08caeeb65908cef115a65a926ef8b20234af2
4
- data.tar.gz: d8a7436afa147cb420c18552e3dcbbed8e1255a74176463ddaa6a51bf23fc8be
3
+ metadata.gz: 4e222b69d72cdf605c2282625a4e3fae78310395ebb04c888e21c5a43a87bb62
4
+ data.tar.gz: dc997c5a29cf63de0e6f00b93542d582c58018fc655b4841387e98d9ec55ba80
5
5
  SHA512:
6
- metadata.gz: 639660bd7c1d819d8cace1b1270356628c2e4c7784c65ec828ad71e59316e651d94c10068c45d9185ad5a89115e31d237d33300452b8cf30d1a11198d437361b
7
- data.tar.gz: 0c5f443dc175183a43ae68573f3c32775e9ca339e29a467d9b9303d684b4d3a4b533fd2509065f18266cf17f7e71fb39a69f6d44c13acbc46215f916fc55e769
6
+ metadata.gz: 309414b198731e14731810757ff8d32a084b70652e24d4aaa06268478a59cfd884c22126177dad428022ca07794834acf49f17e804e534f533d5739a25cc7691
7
+ data.tar.gz: 203243740782fa1aa6f711edf99cd3d1143e024ce0322dec33d9c1ee271865b05b863def2dd16334a72fd6639b07d599d3743bae39cbce8b5e3f42846f2184e9
@@ -159,8 +159,8 @@ module Tapsoob
159
159
 
160
160
  unless @complete
161
161
  yield rows if block_given?
162
- state[:offset] += rows[:data].size
163
- rows[:data].size
162
+ state[:offset] += (rows[:data].size.nil? ? 0 : rows[:data].size)
163
+ rows[:data].size || 0
164
164
  else
165
165
  0
166
166
  end
data/lib/tapsoob/utils.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  require 'zlib'
3
- require 'active_support/core_ext/file/atomic.rb'
3
+ #require 'active_support/core_ext/file/atomic.rb'
4
4
 
5
5
  require 'tapsoob/errors'
6
6
  require 'tapsoob/chunksize'
@@ -144,15 +144,11 @@ Data : #{data}
144
144
  data = row_data
145
145
  if File.exists?(File.join(dump_path, "data", "#{table}.json"))
146
146
  previous_data = JSON.parse(File.read(File.join(dump_path, "data", "#{table}.json")))
147
- data[:data] = (previous_data["data"].nil? ? row_data[:data] : previous_data["data"] + row_data[:data])
147
+ data[:data] = previous_data["data"] + row_data[:data]
148
+ end
148
149
 
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
150
+ File.open(File.join(dump_path, "data", "#{table}.json"), 'w') do |file|
151
+ file.write(JSON.generate(data))
156
152
  end
157
153
  end
158
154
 
@@ -1,4 +1,4 @@
1
1
  # -*- encoding : utf-8 -*-
2
2
  module Tapsoob
3
- VERSION = "0.4.7".freeze
3
+ VERSION = "0.4.13".freeze
4
4
  end
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.7
4
+ version: 0.4.13
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-07-01 00:00:00.000000000 Z
12
+ date: 2021-07-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ripl