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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f44bc455c56121e98574eec9b504efbc5eb81649
4
- data.tar.gz: 2f2176f8005b98e3e98e212900b84a0543431e4f
3
+ metadata.gz: cdbf816d489067e98ddf890834db3e5b33dc642b
4
+ data.tar.gz: 7f89a9363155021e12340b55fc4bf9352d46b903
5
5
  SHA512:
6
- metadata.gz: 9b0d6f4d04a55d8d71d437f41903b652aa1dd6f240072bb4da36dc15d45d061ce7140e9464a69dd0cc24018cc77c3c832a01912164abaab05ebd756f2d6aef1f
7
- data.tar.gz: 340bb8f0cd0be037dde1262a59990bcfbc9ed1bccf865c6fcefb1567fbeb6353b879f91e5bf4271453aaa60af3c96fddfe043365ececbe3491504848c93c9d62
6
+ metadata.gz: 3d1313e8cfcdc2947413d4c6f8cfee0a5760cba39e13ee7920b68bc4bdec7a40d3c6f5cd1a058eefc4e3c069b5f00e7a4349eb6209ce86a403ff7f8557f723c2
7
+ data.tar.gz: e2bfdec507468c0f42c1fc2a8369404250872920faca084cf840c9f88d7b8dd851a4de9cdcb4d98275474c015697b8862cfc39bcd76fa3d19f385705ef7deb73
@@ -1,7 +1,7 @@
1
1
 
2
2
  Gem::Specification.new do |spec|
3
3
  spec.name = "embulk-filter-ruby_proc"
4
- spec.version = "0.4.0"
4
+ spec.version = "0.4.1"
5
5
  spec.authors = ["joker1007"]
6
6
  spec.summary = "Ruby Proc filter plugin for Embulk"
7
7
  spec.description = "Filter each record by ruby proc"
@@ -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.flat_map do |pr|
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.0
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-10 00:00:00.000000000 Z
11
+ date: 2016-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: embulk