csv_step_importer 0.5.1 → 0.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b7e2c4a498a92662b67a12b4b17ce08a401204a193d892d13a1c25b3d178a3b2
4
- data.tar.gz: ebdc0151205c42a65e71d374adf0eb09180ce0ebb2f9d4021ee8c148edd97aca
3
+ metadata.gz: 4607aee34ae2673b6d4dbeb654042e2917d7dcc0965f62030434d707b8f847fb
4
+ data.tar.gz: dd303682285db6cbbcc45bfed4c3e14c52f1e854bd5be77d55631ffd01844c3e
5
5
  SHA512:
6
- metadata.gz: 1884d27ba49352713d9ffc9c9fd47c3b8d6fc5086241c1cfd25d124500ff0104b1a21d3c84b6f9d24586eee286f807b8f3652c2ef5f73215182646309786e346
7
- data.tar.gz: 63d613b8c3c6a8577b0ab0928b41b41fdcdec78ab95310f72f735fc910b3b3edb82fc5266efed3019ea5cf7266f3b635710ded380aeabb9d86c6ae4df9324669
6
+ metadata.gz: 2f313f3bc80835acf005a86ec0ad33dc55a105cd947954fc37966d9904c0498e628c5cb068f1901735618b37d7b348356a213ce8e91d6231ba3f3e3592f255d3
7
+ data.tar.gz: a2d6d39c12721924474c1e1528afb4aaaa4bb4ab875efa4c1309b09ec0595e3559c2140463fb130e2c5154123d1c54e2c0447f96511b56e3112f7bfcf4358722
@@ -4,7 +4,7 @@ module CSVStepImporter
4
4
  class File < CSVStepImporter::Node
5
5
  class CSVFileNotFoundError < CSVImportError; end
6
6
 
7
- attr_accessor :chunk_class, :csv_options, :path, :row_class, :processor_classes, :csv_load_error
7
+ attr_accessor :chunk_class, :csv_options, :headers, :path, :row_class, :processor_classes, :csv_load_error
8
8
 
9
9
  validates :chunk_class, presence: true
10
10
  validates :csv_options, presence: true
@@ -32,6 +32,7 @@ module CSVStepImporter
32
32
  raise CSVFileNotFoundError.new unless ::File.exists? path
33
33
 
34
34
  ::SmarterCSV.process(path, **csv_options.deep_dup) do |rows|
35
+ self.headers ||= rows.first&.keys
35
36
  add_children chunk_class.new parent: self, rows: rows, row_class: row_class, processor_classes: processor_classes
36
37
  end
37
38
  rescue EOFError
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CSVStepImporter
4
- VERSION = "0.5.1"
4
+ VERSION = "0.5.2"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csv_step_importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian-Manuel Butzke