tallty_import_export 1.0.33 → 1.0.35
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/tallty_import_export/export.rb +2 -2
- data/lib/tallty_import_export/import.rb +11 -7
- data/lib/tallty_import_export/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: 25de46efb361ea554c4cef13898a6f14ac03e8b56cb5ca7fcbadb72ae40dcfcd
|
4
|
+
data.tar.gz: 0346d65fe26f1c9ee4357aa8b5850a86f9007c5b6da719b8b604a46ef6fe1fea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82b4c135ba29f61e1c1dbd4640b9a8c29639d9ad699474d2a02a11c6db8462269cfe46d9679fc6721258ab2a1b6cbfdc3fb59353de149d21f4cb541b62f206f3
|
7
|
+
data.tar.gz: 54d41b0b50c542827f8350d531aff8dfb80e202b2605cc9dc3cf1d6b49f8764ef7f8b367bf52782a9401c482eb2bd9cf3c684768e73bda935c7c8a8adea5c0cb
|
@@ -141,7 +141,7 @@ module TalltyImportExport
|
|
141
141
|
end
|
142
142
|
|
143
143
|
def process_options options = {}
|
144
|
-
options = export_options.merge(options).with_indifferent_access
|
144
|
+
options = export_options.merge(options.compact_blank!).with_indifferent_access
|
145
145
|
|
146
146
|
@row_height ||= options.delete(:row_height) || 25
|
147
147
|
@width ||= (options.delete(:width) || 20).to_f
|
@@ -157,7 +157,7 @@ module TalltyImportExport
|
|
157
157
|
end
|
158
158
|
|
159
159
|
def export_headers_result
|
160
|
-
@headers ||= export_headers
|
160
|
+
@headers ||= export_headers
|
161
161
|
end
|
162
162
|
|
163
163
|
def export_headers **args
|
@@ -53,7 +53,7 @@ module TalltyImportExport
|
|
53
53
|
end
|
54
54
|
|
55
55
|
def process_options options
|
56
|
-
options = import_options.merge(options).with_indifferent_access
|
56
|
+
options = import_options.merge(options.compact_blank!).with_indifferent_access
|
57
57
|
@headers = options.delete(:headers) || import_headers
|
58
58
|
@primary_keys = options.delete(:primary_keys) || @headers.map { |header| header[:primary_key] ? header[:key].to_sym : nil }.compact
|
59
59
|
@skip_keys = options.delete(:skip_keys) || @headers.map { |header| header[:skip] ? header[:key].to_sym : nil }.compact
|
@@ -113,13 +113,17 @@ module TalltyImportExport
|
|
113
113
|
# TODO: 这里,对于import_headers,后面还是不要传参数了
|
114
114
|
# 需要合并proc,前端没有办法把proc传过来
|
115
115
|
def import_headers_result
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
116
|
+
if @headers.present?
|
117
|
+
import_header_hash = import_headers.to_h { |header| [header.with_indifferent_access[:key], header] }.with_indifferent_access
|
118
|
+
@headers.map do |header|
|
119
|
+
key = header[:key]
|
120
|
+
if import_header_hash.dig(key, :proc).present?
|
121
|
+
header[:proc] = import_header_hash.dig(key, :proc)
|
122
|
+
end
|
123
|
+
header
|
121
124
|
end
|
122
|
-
|
125
|
+
else
|
126
|
+
@headers = import_headers
|
123
127
|
end
|
124
128
|
rescue
|
125
129
|
@headers
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tallty_import_export
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.35
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- liyijie
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-
|
11
|
+
date: 2021-12-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zip-zip
|