tallty_import_export 1.0.18 → 1.0.22
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e281a3f593eedd9a07fe79f779c95a389d02cc5f5296e799bf7c29d42f31b126
|
4
|
+
data.tar.gz: 6a7b95014024711b1eeb6136f3eafc55f51f54dcfb10f750dbf34fb73dc74c34
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a1f2f542f68b84527e1321bf143525765568470a767bacdf3a9e8d43f14efa435e3b98e53a551b9ad14442fbd38c1175ff04c0c6d930e27aa08eb5e99e0bc122
|
7
|
+
data.tar.gz: 5fa2f4f7286b75fb5e9d14450c1233bdf95bbdb10433d1dbe66f5cf7effbe4eccb07c7414d74ac30f54642415679a4308f05bcbe7f82161713985bb8d346a5fa
|
@@ -165,7 +165,7 @@ module TalltyImportExport
|
|
165
165
|
end
|
166
166
|
|
167
167
|
def try_chain record, arr
|
168
|
-
arr.
|
168
|
+
arr.reduce(record) { |r, m| r.try(m) || r.try(:[], m) }
|
169
169
|
end
|
170
170
|
|
171
171
|
def try_method record, method
|
@@ -179,9 +179,9 @@ module TalltyImportExport
|
|
179
179
|
when 'string'
|
180
180
|
data.to_s
|
181
181
|
when 'datetime'
|
182
|
-
data ? data.strftime('%F %H:%M') : nil
|
182
|
+
data ? data.in_time_zone.strftime('%F %H:%M') : nil
|
183
183
|
when 'date'
|
184
|
-
data ? data.strftime('%F') : nil
|
184
|
+
data ? data.in_time_zone.strftime('%F') : nil
|
185
185
|
else
|
186
186
|
data
|
187
187
|
end
|
@@ -79,7 +79,7 @@ module TalltyImportExport
|
|
79
79
|
|
80
80
|
def convert_data line_info
|
81
81
|
line_info.with_indifferent_access.reduce({}) do |h, (k, v)|
|
82
|
-
header =
|
82
|
+
header = import_headers_result.find do |_header|
|
83
83
|
_header[:key].to_sym == k.to_sym
|
84
84
|
end
|
85
85
|
# header[:convert] = handle_xxx
|
@@ -90,9 +90,7 @@ module TalltyImportExport
|
|
90
90
|
h[header[:json]][k] = val
|
91
91
|
elsif header[:finder]
|
92
92
|
$SAFE = 2
|
93
|
-
|
94
|
-
eval_val = eval eval_string
|
95
|
-
h[k.to_sym] = eval_val
|
93
|
+
h[k.to_sym] = eval header[:finder]
|
96
94
|
else
|
97
95
|
h[k.to_sym] = val
|
98
96
|
end
|
@@ -106,7 +104,7 @@ module TalltyImportExport
|
|
106
104
|
end
|
107
105
|
|
108
106
|
def import_headers_result
|
109
|
-
@headers
|
107
|
+
@headers ||= import_headers
|
110
108
|
end
|
111
109
|
|
112
110
|
def import_headers **args
|
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.22
|
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-07-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: zip-zip
|