arc-furnace 0.1.8 → 0.1.9

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: 16e3d18410f3a87ee22a40c1f58d5d3ae1b6fd7a
4
- data.tar.gz: c910de2e2455ebe7bc5a50a1ab5c03bb197d7a13
3
+ metadata.gz: 1205226cf5fe45f7525dd6d690e2ae8d07bab716
4
+ data.tar.gz: 15d4d0c2b54119a385893a89a91df1d44418e29d
5
5
  SHA512:
6
- metadata.gz: 78c1d5a8af9e8f3d24b10fbb38b86cb253945f7feacb1dd1edf1b7f8b54575d313b6a674a45c28a2c25b1848ef265d6a244909b9c052e4a2c62001836e1feb73
7
- data.tar.gz: 2a9fa8297a8eb2754c9dfa717740a373a06f3ae9fb267077e85974ecc341f574dcc1138b9566362edab0ebcd329c14803eae9865b4f2ce98d01fa47520cf3d06
6
+ metadata.gz: acb8f99017c98ec54321bd37357693e964e28a11a02202438770dee5fd5ab6c91bffd87f5caaf583f68db53865cb4aa0c98d8201e46c00dd6d03efba51c895c6
7
+ data.tar.gz: 785065af27031e11f505a3593342be406c1035a8b05efdd0872a4d62d5af14515fe49c42e1918eb98d8c8b74bd74bc4bb65e57b0fbc3588f116c0284cf559045
@@ -0,0 +1,12 @@
1
+ require 'arc-furnace/sink'
2
+
3
+ module ArcFurnace
4
+ # This sink does nothing, nothing!
5
+ class NullSink < Sink
6
+
7
+ def row(row)
8
+ #nothing
9
+ end
10
+
11
+ end
12
+ end
@@ -108,7 +108,7 @@ module ArcFurnace
108
108
  ALLOWABLE_PARAM_TYPES.include?(param.first)
109
109
  end.map(&:second)
110
110
  # Allow params to be passed that are not in the initializer
111
- instance = type.new(resolved_params.slice(*key_parameters))
111
+ instance = create_instance_with_error_handling(type, resolved_params, key_parameters)
112
112
  instance.params = resolved_params
113
113
  instance
114
114
  end
@@ -153,7 +153,7 @@ module ArcFurnace
153
153
  dsl_class.intermediates_map.each do |key, instance|
154
154
  intermediates_map[key] = instance_exec(&instance) if instance
155
155
  end
156
- @sink_node = exec_with_error_handling(&dsl_class.sink_node)
156
+ @sink_node = instance_exec(&dsl_class.sink_node)
157
157
  @sink_source = intermediates_map[dsl_class.sink_source]
158
158
  end
159
159
 
@@ -175,16 +175,10 @@ module ArcFurnace
175
175
  self.params[key] || self.intermediates_map[key] || (raise "When processing node #{node_id}: Unknown key #{key}!")
176
176
  end
177
177
 
178
- def exec_with_error_handling(&block)
179
- instance_exec(&block) if block_given?
178
+ def create_instance_with_error_handling(type, resolved_params, key_parameters)
179
+ type.new(resolved_params.slice(*key_parameters))
180
180
  rescue CSV::MalformedCSVError
181
- params = sink_source.params
182
- raise "File #{find_root_source(params).file.path} cannot be processed."
183
- end
184
-
185
- def find_root_source(params)
186
- source = params[:source]
187
- source = params[:source] while source.params[:source]
181
+ raise "File #{resolved_params[:filename]} cannot be processed."
188
182
  end
189
183
  end
190
184
  end
@@ -1,3 +1,3 @@
1
1
  module ArcFurnace
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: arc-furnace
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Daniel Spangenberger
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2015-12-14 00:00:00.000000000 Z
12
+ date: 2016-01-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -148,6 +148,7 @@ files:
148
148
  - lib/arc-furnace/multi_csv_source.rb
149
149
  - lib/arc-furnace/node.rb
150
150
  - lib/arc-furnace/nodes.rb
151
+ - lib/arc-furnace/null_sink.rb
151
152
  - lib/arc-furnace/outer_join.rb
152
153
  - lib/arc-furnace/pipeline.rb
153
154
  - lib/arc-furnace/private_attr.rb