csvbuilder-importer 0.1.0 → 0.1.2

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
  SHA256:
3
- metadata.gz: 39d99815d9abc078be2c260b184249698061567e187610a592dff015fd0b8689
4
- data.tar.gz: 9986a911e0afcfd82910e69c275b3f9082d10c2cf59d0597335310e491d2004a
3
+ metadata.gz: 960969ebb5e955cbf5668f047863b5d4dd3acb34b65d8cbc7c3e2f127aa17351
4
+ data.tar.gz: fa5ce80706924c46497d6ca0a85cb0a976c9093c49bf43b4a8a8c6084e31eb69
5
5
  SHA512:
6
- metadata.gz: 1b6f735481aa24e1f06e2fb34dd6f9c7be5f09b31f9571d5542a2ac7eb1040d22144969fd2ac4fae5b3e3b0033546d49efac75fc0e514a056303653aa20c76bc
7
- data.tar.gz: e43129b44151125b09f64d7aa6f14ae67c430e456a88a8858874f058a4f0b93af134c2bc05ded31d000e134caa4bbc23b9655ab718d4e4046c8880043d61d2f9
6
+ metadata.gz: c613dd08d3fcca5a01f53f5802839add01d9430d307972e790b1a20b5b399ff889bd98301e7f4bf6aa193d9338077f6f3c8e9ddf37343c62142fdad928e0c0de
7
+ data.tar.gz: 42601bfcb177f735ec954a09054e8ad9d68db42b1589268a22f9de7b6ba9260c44363f66cb1e29dd22263ce3d625c0ebcb09123c7935cfa0d8f3622486db8de4
data/Gemfile CHANGED
@@ -15,4 +15,4 @@ gem "rubocop-performance"
15
15
  gem "rubocop-rake"
16
16
  gem "rubocop-rspec"
17
17
 
18
- gem "csvbuilder-core", path: "../csvbuilder-core"
18
+ # gem "csvbuilder-core", path: "../csvbuilder-core"
@@ -26,27 +26,26 @@ module Csvbuilder
26
26
  end
27
27
 
28
28
  def attribute_objects
29
- @attribute_objects ||= _attribute_objects(errors)
29
+ @attribute_objects ||= _attribute_objects
30
+ end
31
+
32
+ def read_attribute_for_validation(attr)
33
+ source_row[self.class.column_names.index(attr)]
30
34
  end
31
35
 
32
36
  protected
33
37
 
34
- def _attribute_objects(attributes_errors = {})
38
+ def _attribute_objects
35
39
  index = -1
36
40
 
37
41
  array_to_block_hash(self.class.column_names) do |column_name|
38
- Attribute.new(column_name, source_row[index += 1], attributes_errors[column_name], self)
42
+ Attribute.new(column_name, source_row[index += 1], errors.to_hash[column_name], self)
39
43
  end
40
44
  end
41
45
 
42
46
  class_methods do
43
47
  def define_attribute_method(column_name)
44
- # return if super { original_attribute(column_name) }.nil?
45
- super do
46
- return unless @attribute_objects
47
-
48
- @attribute_objects[column_name].try(:value)
49
- end
48
+ return if super { original_attribute(column_name) }.nil?
50
49
  end
51
50
  end
52
51
  end
@@ -9,7 +9,7 @@ module Csvbuilder
9
9
 
10
10
  def initialize(column_name, source_value, attribute_errors, row_model)
11
11
  @source_value = source_value
12
- @attribute_errors = attribute_errors
12
+ @attribute_errors = attribute_errors || []
13
13
 
14
14
  super(column_name, row_model)
15
15
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Csvbuilder
4
4
  module Importer
5
- VERSION = "0.1.0"
5
+ VERSION = "0.1.2"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvbuilder-importer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Azemar
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2022-12-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activemodel
@@ -42,16 +42,16 @@ dependencies:
42
42
  name: csvbuilder-core
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - '='
45
+ - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: 0.1.1
47
+ version: '0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - '='
52
+ - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: 0.1.1
54
+ version: '0'
55
55
  description: Help handle CSVs in a more efficient way
56
56
  email:
57
57
  - joel.azemar@gmail.com
@@ -65,7 +65,6 @@ files:
65
65
  - CHANGELOG.md
66
66
  - CODE_OF_CONDUCT.md
67
67
  - Gemfile
68
- - Gemfile.lock
69
68
  - LICENSE.txt
70
69
  - README.md
71
70
  - Rakefile
data/Gemfile.lock DELETED
@@ -1,92 +0,0 @@
1
- PATH
2
- remote: ../csvbuilder-core
3
- specs:
4
- csvbuilder-core (0.1.1)
5
- activesupport (~> 6.1)
6
-
7
- PATH
8
- remote: .
9
- specs:
10
- csvbuilder-importer (0.1.0)
11
- activemodel (~> 6.1)
12
- activesupport (~> 6.1)
13
- csvbuilder-core (= 0.1.1)
14
-
15
- GEM
16
- remote: https://rubygems.org/
17
- specs:
18
- activemodel (6.1.7)
19
- activesupport (= 6.1.7)
20
- activesupport (6.1.7)
21
- concurrent-ruby (~> 1.0, >= 1.0.2)
22
- i18n (>= 1.6, < 2)
23
- minitest (>= 5.1)
24
- tzinfo (~> 2.0)
25
- zeitwerk (~> 2.3)
26
- ast (2.4.2)
27
- concurrent-ruby (1.1.10)
28
- diff-lcs (1.5.0)
29
- i18n (1.12.0)
30
- concurrent-ruby (~> 1.0)
31
- json (2.6.3)
32
- minitest (5.16.3)
33
- parallel (1.22.1)
34
- parser (3.1.3.0)
35
- ast (~> 2.4.1)
36
- rainbow (3.1.1)
37
- rake (13.0.6)
38
- regexp_parser (2.6.1)
39
- rexml (3.2.5)
40
- rspec (3.12.0)
41
- rspec-core (~> 3.12.0)
42
- rspec-expectations (~> 3.12.0)
43
- rspec-mocks (~> 3.12.0)
44
- rspec-core (3.12.0)
45
- rspec-support (~> 3.12.0)
46
- rspec-expectations (3.12.0)
47
- diff-lcs (>= 1.2.0, < 2.0)
48
- rspec-support (~> 3.12.0)
49
- rspec-mocks (3.12.0)
50
- diff-lcs (>= 1.2.0, < 2.0)
51
- rspec-support (~> 3.12.0)
52
- rspec-support (3.12.0)
53
- rubocop (1.40.0)
54
- json (~> 2.3)
55
- parallel (~> 1.10)
56
- parser (>= 3.1.2.1)
57
- rainbow (>= 2.2.2, < 4.0)
58
- regexp_parser (>= 1.8, < 3.0)
59
- rexml (>= 3.2.5, < 4.0)
60
- rubocop-ast (>= 1.23.0, < 2.0)
61
- ruby-progressbar (~> 1.7)
62
- unicode-display_width (>= 1.4.0, < 3.0)
63
- rubocop-ast (1.24.0)
64
- parser (>= 3.1.1.0)
65
- rubocop-performance (1.15.1)
66
- rubocop (>= 1.7.0, < 2.0)
67
- rubocop-ast (>= 0.4.0)
68
- rubocop-rake (0.6.0)
69
- rubocop (~> 1.0)
70
- rubocop-rspec (2.15.0)
71
- rubocop (~> 1.33)
72
- ruby-progressbar (1.11.0)
73
- tzinfo (2.0.5)
74
- concurrent-ruby (~> 1.0)
75
- unicode-display_width (2.3.0)
76
- zeitwerk (2.6.6)
77
-
78
- PLATFORMS
79
- x86_64-darwin-21
80
-
81
- DEPENDENCIES
82
- csvbuilder-core!
83
- csvbuilder-importer!
84
- rake
85
- rspec
86
- rubocop
87
- rubocop-performance
88
- rubocop-rake
89
- rubocop-rspec
90
-
91
- BUNDLED WITH
92
- 2.3.22