arc-furnace 0.1.25 → 0.1.26

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: e723d42b0fa3af1f831ad911727f45c3b0e9ea7e
4
- data.tar.gz: 2919ac307cf0d1ce66819a6dc313ecfb30ee3b4b
3
+ metadata.gz: d8616333ef28ee9771d48ce344eb65cee268fa7c
4
+ data.tar.gz: 8cffb861684c0bceb62a3e6c7e4f01544a4f7661
5
5
  SHA512:
6
- metadata.gz: 12b1522b91125be54dff5bc0bcf16f436996117869b7aa7d994fe7ddc5397402c05076c003ce86b78ef1b01f11321828422762117a9e019fbe00c9e2fa4b1500
7
- data.tar.gz: 2dd01fbf315cc3f42ce35298b89e7f6e6270cbf7f0d8e4c229a7cd9fa730e9c5ceb3e8148484dc9841e00bb3176cc2f70a5cb289a56a3d06cd43eda069564a15
6
+ metadata.gz: fbc864ac6041d62b326206394cca3fe700727fc6dd935b60c1233c45b5030302599bec7dd14941f8278b607025abb04f2369d0bc0c3a1923f5414c323d5de88a
7
+ data.tar.gz: 812167e9e9a3a892db6d1329baee88fa8251f0368d4e6dc0cd309f1ccccc6b6170d0b8697fe084f8e97bbdd69cd3c668fddfe9dd94664c2a95364eea2b0756f0
@@ -5,20 +5,23 @@ require 'csv'
5
5
  module ArcFurnace
6
6
  class CSVSource < EnumeratorSource
7
7
  include CSVToHashWithDuplicateHeaders
8
- attr_reader :value, :file
8
+ attr_reader :value, :file, :csv
9
9
 
10
- def initialize(filename: , encoding: 'UTF-8')
11
- @file = File.open(filename, encoding: encoding)
10
+ def initialize(filename: nil, csv: nil, encoding: 'UTF-8')
11
+ @file = File.open(filename, encoding: encoding) if filename
12
+ @csv = csv
12
13
  super()
13
14
  end
14
15
 
15
16
  def finalize
16
- file.close
17
+ file.close if file
17
18
  end
18
19
 
19
20
  def build_enumerator
20
21
  Enumerator.new do |yielder|
21
- CSV.new(file, headers: true).each { |row| yielder << csv_to_hash_with_duplicates(row) }
22
+ (csv ? csv : CSV.new(file, headers: true)).each do |row|
23
+ yielder << csv_to_hash_with_duplicates(row)
24
+ end
22
25
  end
23
26
  end
24
27
  end
@@ -1,3 +1,3 @@
1
1
  module ArcFurnace
2
- VERSION = "0.1.25"
2
+ VERSION = "0.1.26"
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.25
4
+ version: 0.1.26
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: 2018-01-16 00:00:00.000000000 Z
12
+ date: 2018-03-08 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: msgpack
@@ -229,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
229
229
  version: '0'
230
230
  requirements: []
231
231
  rubyforge_project:
232
- rubygems_version: 2.6.12
232
+ rubygems_version: 2.4.5.1
233
233
  signing_key:
234
234
  specification_version: 4
235
235
  summary: Melds and transforms data from multiple sources into a single stream