embulk-filter-ruby_proc 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/embulk-filter-ruby_proc.gemspec +1 -1
- data/lib/embulk/filter/ruby_proc.rb +12 -2
- 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: cdbf816d489067e98ddf890834db3e5b33dc642b
|
4
|
+
data.tar.gz: 7f89a9363155021e12340b55fc4bf9352d46b903
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3d1313e8cfcdc2947413d4c6f8cfee0a5760cba39e13ee7920b68bc4bdec7a40d3c6f5cd1a058eefc4e3c069b5f00e7a4349eb6209ce86a403ff7f8557f723c2
|
7
|
+
data.tar.gz: e2bfdec507468c0f42c1fc2a8369404250872920faca084cf840c9f88d7b8dd851a4de9cdcb4d98275474c015697b8862cfc39bcd76fa3d19f385705ef7deb73
|
@@ -72,8 +72,18 @@ module Embulk
|
|
72
72
|
if @row_procs.empty?
|
73
73
|
record_hashes = [hashrize(record)]
|
74
74
|
else
|
75
|
-
record_hashes = @row_procs.
|
76
|
-
pr.call(hashrize(record))
|
75
|
+
record_hashes = @row_procs.each_with_object([]) do |pr, arr|
|
76
|
+
result = pr.call(hashrize(record))
|
77
|
+
case result
|
78
|
+
when Array
|
79
|
+
result.each do |r|
|
80
|
+
arr << r
|
81
|
+
end
|
82
|
+
when Hash
|
83
|
+
arr << result
|
84
|
+
else
|
85
|
+
raise "row proc return value must be a Array or Hash"
|
86
|
+
end
|
77
87
|
end
|
78
88
|
end
|
79
89
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: embulk-filter-ruby_proc
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- joker1007
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-04-
|
11
|
+
date: 2016-04-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: embulk
|