csvbuilder-collection 0.1.1 → 0.2.0

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: a01050edde5a0362b58855be25461b46f8d4deab1b9917c06a9a62da1c095c75
4
- data.tar.gz: 78f3fadc2176d4f27d0c9063c2d68284db1c3db73fcefbcb840b124c3b61e50b
3
+ metadata.gz: bb1863fff226d4affdeca5ba147a79cede94eeaec6df640d868d834d6e71d98d
4
+ data.tar.gz: e49db83ce9a8c36846de4b8a6a72fcf0024d7812ad07cfcdee673e58d5cf8f28
5
5
  SHA512:
6
- metadata.gz: b0a8d384e897616dc425e318bad67ac9e916bae819d6a63b10f1655efe8abf5810f7f144c0b75d80403a1484c8b6b1b09f7aa34eaeb2c111885c7c5b9dc166c6
7
- data.tar.gz: c5a1b47af1e31f0b1ae4b6e245c85fb4a27b6d1ed3770d4fc4928dc7c4f29fbe663ba718cabd6679c9ea6b4b7eb16ae732cda86c9318df9a1ce064fa262ad86e
6
+ metadata.gz: 7c87bf0f60530f035775200df6d7414b987a542a992f66c081e7c03b1677767bde6243bf95f96863097e3694980b1417224590efa1c34fb21a25099b8ed1467e
7
+ data.tar.gz: 2f0a532c6b3db4eb90c89816a48e6ec463e1b62d93252ed163b122a6dd181ea9fc3c194bcde29e1ddaa19d8f2bb9d4597a06e283432e0f4205665a665e025911
data/.rubocop.yml CHANGED
@@ -1,13 +1,13 @@
1
1
  inherit_from: .rubocop_todo.yml
2
2
 
3
- require:
3
+ plugins:
4
4
  - rubocop-performance
5
5
  - rubocop-rake
6
6
  - rubocop-rspec
7
7
 
8
8
  AllCops:
9
9
  NewCops: enable
10
- TargetRubyVersion: 2.6
10
+ TargetRubyVersion: 3.4
11
11
 
12
12
  Style/StringLiterals:
13
13
  Enabled: true
@@ -18,4 +18,4 @@ Style/StringLiteralsInInterpolation:
18
18
  EnforcedStyle: double_quotes
19
19
 
20
20
  Layout/LineLength:
21
- Max: 120
21
+ Max: 135
data/.rubocop_todo.yml CHANGED
@@ -1,16 +1,87 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-12-16 15:23:18 UTC using RuboCop version 1.40.0.
3
+ # on 2025-03-02 07:09:13 UTC using RuboCop version 1.73.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
9
  # Offense count: 1
10
+ # This cop supports safe autocorrection (--autocorrect).
11
+ # Configuration parameters: Max, AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, AllowedPatterns, SplitStrings.
12
+ # URISchemes: http, https
13
+ Layout/LineLength:
14
+ Exclude:
15
+ - 'spec/integrations/import/dynamic-columns/import_by_static_columns_spec.rb'
16
+
17
+ # Offense count: 1
18
+ # Configuration parameters: AllowedMethods, AllowedPatterns, CountRepeatedAttributes.
19
+ Metrics/AbcSize:
20
+ Max: 20
21
+
22
+ # Offense count: 2
23
+ # Configuration parameters: CountComments, CountAsOne, AllowedMethods, AllowedPatterns.
24
+ Metrics/MethodLength:
25
+ Max: 17
26
+
27
+ # Offense count: 3
28
+ # Configuration parameters: EnforcedStyle, CheckMethodNames, CheckSymbols, AllowedIdentifiers, AllowedPatterns.
29
+ # SupportedStyles: snake_case, normalcase, non_integer
30
+ # AllowedIdentifiers: capture3, iso8601, rfc1123_date, rfc822, rfc2822, rfc3339, x86_64
31
+ Naming/VariableNumber:
32
+ Exclude:
33
+ - 'spec/integrations/import/dynamic-columns/import_by_static_columns_spec.rb'
34
+
35
+ # Offense count: 1
36
+ RSpec/AnyInstance:
37
+ Exclude:
38
+ - 'spec/integrations/import/dynamic-columns/import_by_static_columns_spec.rb'
39
+
40
+ # Offense count: 9
41
+ # Configuration parameters: IgnoredMetadata.
42
+ RSpec/DescribeClass:
43
+ Exclude:
44
+ - '**/spec/features/**/*'
45
+ - '**/spec/requests/**/*'
46
+ - '**/spec/routing/**/*'
47
+ - '**/spec/system/**/*'
48
+ - '**/spec/views/**/*'
49
+ - 'spec/integrations/export/dynamic-columns/aliasing_as_export_spec.rb'
50
+ - 'spec/integrations/export/dynamic-columns/export_spec.rb'
51
+ - 'spec/integrations/export/dynamic-columns/formatted_dynamic_column_cells_export_spec.rb'
52
+ - 'spec/integrations/export/dynamic-columns/formatted_dynamic_column_headers_export_spec.rb'
53
+ - 'spec/integrations/import/dynamic-columns/formatted_dynamic_column_cells_spec.rb'
54
+ - 'spec/integrations/import/dynamic-columns/formatted_dynamic_column_headers_spec.rb'
55
+ - 'spec/integrations/import/dynamic-columns/import_by_static_columns_spec.rb'
56
+ - 'spec/integrations/import/dynamic-columns/import_spec.rb'
57
+ - 'spec/integrations/import/dynamic-columns/validate_dynamic_header_values_spec.rb'
58
+
59
+ # Offense count: 17
10
60
  # Configuration parameters: CountAsOne.
11
61
  RSpec/ExampleLength:
12
- Max: 8
62
+ Max: 31
13
63
 
14
- # Offense count: 1
64
+ # Offense count: 14
15
65
  RSpec/MultipleExpectations:
16
- Max: 3
66
+ Max: 14
67
+
68
+ # Offense count: 27
69
+ # Configuration parameters: AllowedGroups.
70
+ RSpec/NestedGroups:
71
+ Max: 6
72
+
73
+ # Offense count: 1
74
+ RSpec/RemoveConst:
75
+ Exclude:
76
+ - 'spec/integrations/import/dynamic-columns/import_by_static_columns_spec.rb'
77
+
78
+ # Offense count: 2
79
+ RSpec/RepeatedExample:
80
+ Exclude:
81
+ - 'spec/integrations/export/dynamic-columns/formatted_dynamic_column_cells_export_spec.rb'
82
+
83
+ # Offense count: 2
84
+ Style/OpenStructUse:
85
+ Exclude:
86
+ - 'spec/integrations/import/dynamic-columns/formatted_dynamic_column_cells_spec.rb'
87
+ - 'spec/integrations/import/dynamic-columns/formatted_dynamic_column_headers_spec.rb'
data/.tool-versions CHANGED
@@ -1 +1 @@
1
- ruby 2.7.6
1
+ ruby 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,10 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.2.0] - 2025-03-02 Sun 2 Mar 2025
4
+
5
+ - Using [csvbuilder-importer](https://github.com/joel/csvbuilder-importer/tree/v0.2.0)
6
+ - Check if the headers from the CSV match the Csvbuilder::Model headers definitions.
7
+
3
8
  ## [0.1.0] - 2022-12-16
4
9
 
5
10
  - Initial release
data/Gemfile CHANGED
@@ -15,6 +15,15 @@ gem "rubocop-performance"
15
15
  gem "rubocop-rake"
16
16
  gem "rubocop-rspec"
17
17
 
18
+ gem "activerecord"
19
+ gem "database_cleaner-active_record"
20
+
21
+ gem "ostruct"
22
+ gem "sqlite3"
23
+
18
24
  # gem "csvbuilder-core", path: "../csvbuilder-core"
19
- # gem "csvbuilder-importer", path: "../csvbuilder-importer"
25
+ # gem "csvbuilder-dynamic-columns-core", path: "../csvbuilder-dynamic-columns-core"
26
+ # gem "csvbuilder-dynamic-columns-exporter", path: "../csvbuilder-dynamic-columns-exporter"
27
+ # gem "csvbuilder-dynamic-columns-importer", path: "../csvbuilder-dynamic-columns-importer"
20
28
  # gem "csvbuilder-exporter", path: "../csvbuilder-exporter"
29
+ # gem "csvbuilder-importer", path: "../csvbuilder-importer"
data/Gemfile.lock ADDED
@@ -0,0 +1,171 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ csvbuilder-collection (0.2.0)
5
+ csv
6
+ csvbuilder-core (~> 0.1)
7
+ csvbuilder-dynamic-columns-core (~> 0.1)
8
+ csvbuilder-dynamic-columns-exporter (~> 0.1)
9
+ csvbuilder-dynamic-columns-importer (~> 0.1)
10
+ csvbuilder-exporter (~> 0.1)
11
+ csvbuilder-importer (~> 0.1)
12
+
13
+ GEM
14
+ remote: https://rubygems.org/
15
+ specs:
16
+ activemodel (7.2.2.1)
17
+ activesupport (= 7.2.2.1)
18
+ activerecord (7.2.2.1)
19
+ activemodel (= 7.2.2.1)
20
+ activesupport (= 7.2.2.1)
21
+ timeout (>= 0.4.0)
22
+ activesupport (7.2.2.1)
23
+ base64
24
+ benchmark (>= 0.3)
25
+ bigdecimal
26
+ concurrent-ruby (~> 1.0, >= 1.3.1)
27
+ connection_pool (>= 2.2.5)
28
+ drb
29
+ i18n (>= 1.6, < 2)
30
+ logger (>= 1.4.2)
31
+ minitest (>= 5.1)
32
+ securerandom (>= 0.3)
33
+ tzinfo (~> 2.0, >= 2.0.5)
34
+ ast (2.4.2)
35
+ base64 (0.2.0)
36
+ benchmark (0.4.0)
37
+ bigdecimal (3.1.9)
38
+ concurrent-ruby (1.3.5)
39
+ connection_pool (2.5.0)
40
+ csv (3.3.2)
41
+ csvbuilder-core (0.1.4)
42
+ activesupport (>= 5.2)
43
+ csv
44
+ csvbuilder-dynamic-columns-core (0.1.2)
45
+ activesupport (>= 5.2)
46
+ csv
47
+ csvbuilder-core
48
+ csvbuilder-dynamic-columns-exporter (0.1.3)
49
+ activesupport (>= 5.2)
50
+ csvbuilder-core (~> 0.1)
51
+ csvbuilder-dynamic-columns-core (~> 0.1)
52
+ csvbuilder-exporter (~> 0.1)
53
+ csvbuilder-dynamic-columns-importer (0.1.2)
54
+ activesupport (>= 5.2)
55
+ csvbuilder-core (~> 0.1)
56
+ csvbuilder-dynamic-columns-core (~> 0.1)
57
+ csvbuilder-importer (~> 0.1)
58
+ csvbuilder-exporter (0.1.1)
59
+ activemodel (>= 5.2)
60
+ activesupport (>= 5.2)
61
+ csv
62
+ csvbuilder-core
63
+ csvbuilder-importer (0.2.0)
64
+ activemodel (>= 5.2)
65
+ activesupport (>= 5.2)
66
+ csv
67
+ csvbuilder-core
68
+ database_cleaner-active_record (2.2.0)
69
+ activerecord (>= 5.a)
70
+ database_cleaner-core (~> 2.0.0)
71
+ database_cleaner-core (2.0.1)
72
+ diff-lcs (1.6.0)
73
+ drb (2.2.1)
74
+ i18n (1.14.7)
75
+ concurrent-ruby (~> 1.0)
76
+ json (2.10.1)
77
+ language_server-protocol (3.17.0.4)
78
+ lint_roller (1.1.0)
79
+ logger (1.6.6)
80
+ minitest (5.25.4)
81
+ ostruct (0.6.1)
82
+ parallel (1.26.3)
83
+ parser (3.3.7.1)
84
+ ast (~> 2.4.1)
85
+ racc
86
+ racc (1.8.1)
87
+ rainbow (3.1.1)
88
+ rake (13.2.1)
89
+ regexp_parser (2.10.0)
90
+ rspec (3.13.0)
91
+ rspec-core (~> 3.13.0)
92
+ rspec-expectations (~> 3.13.0)
93
+ rspec-mocks (~> 3.13.0)
94
+ rspec-core (3.13.3)
95
+ rspec-support (~> 3.13.0)
96
+ rspec-expectations (3.13.3)
97
+ diff-lcs (>= 1.2.0, < 2.0)
98
+ rspec-support (~> 3.13.0)
99
+ rspec-mocks (3.13.2)
100
+ diff-lcs (>= 1.2.0, < 2.0)
101
+ rspec-support (~> 3.13.0)
102
+ rspec-support (3.13.2)
103
+ rubocop (1.72.2)
104
+ json (~> 2.3)
105
+ language_server-protocol (~> 3.17.0.2)
106
+ lint_roller (~> 1.1.0)
107
+ parallel (~> 1.10)
108
+ parser (>= 3.3.0.2)
109
+ rainbow (>= 2.2.2, < 4.0)
110
+ regexp_parser (>= 2.9.3, < 3.0)
111
+ rubocop-ast (>= 1.38.0, < 2.0)
112
+ ruby-progressbar (~> 1.7)
113
+ unicode-display_width (>= 2.4.0, < 4.0)
114
+ rubocop-ast (1.38.1)
115
+ parser (>= 3.3.1.0)
116
+ rubocop-performance (1.24.0)
117
+ lint_roller (~> 1.1)
118
+ rubocop (>= 1.72.1, < 2.0)
119
+ rubocop-ast (>= 1.38.0, < 2.0)
120
+ rubocop-rake (0.7.1)
121
+ lint_roller (~> 1.1)
122
+ rubocop (>= 1.72.1)
123
+ rubocop-rspec (3.5.0)
124
+ lint_roller (~> 1.1)
125
+ rubocop (~> 1.72, >= 1.72.1)
126
+ ruby-progressbar (1.13.0)
127
+ securerandom (0.4.1)
128
+ sqlite3 (2.6.0-aarch64-linux-gnu)
129
+ sqlite3 (2.6.0-aarch64-linux-musl)
130
+ sqlite3 (2.6.0-arm-linux-gnu)
131
+ sqlite3 (2.6.0-arm-linux-musl)
132
+ sqlite3 (2.6.0-arm64-darwin)
133
+ sqlite3 (2.6.0-x86-linux-gnu)
134
+ sqlite3 (2.6.0-x86-linux-musl)
135
+ sqlite3 (2.6.0-x86_64-darwin)
136
+ sqlite3 (2.6.0-x86_64-linux-gnu)
137
+ sqlite3 (2.6.0-x86_64-linux-musl)
138
+ timeout (0.4.3)
139
+ tzinfo (2.0.6)
140
+ concurrent-ruby (~> 1.0)
141
+ unicode-display_width (3.1.4)
142
+ unicode-emoji (~> 4.0, >= 4.0.4)
143
+ unicode-emoji (4.0.4)
144
+
145
+ PLATFORMS
146
+ aarch64-linux-gnu
147
+ aarch64-linux-musl
148
+ arm-linux-gnu
149
+ arm-linux-musl
150
+ arm64-darwin
151
+ x86-linux-gnu
152
+ x86-linux-musl
153
+ x86_64-darwin
154
+ x86_64-linux-gnu
155
+ x86_64-linux-musl
156
+
157
+ DEPENDENCIES
158
+ activerecord
159
+ csvbuilder-collection!
160
+ database_cleaner-active_record
161
+ ostruct
162
+ rake
163
+ rspec
164
+ rubocop
165
+ rubocop-performance
166
+ rubocop-rake
167
+ rubocop-rspec
168
+ sqlite3
169
+
170
+ BUNDLED WITH
171
+ 2.6.2
data/README.md CHANGED
@@ -1,8 +1,15 @@
1
1
  # Csvbuilder
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/csvbuilder`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ [Csvbuilder](https://rubygems.org/gems/csvbuilder-collection) is a wrapper for a collection of libraries that lets you export and import CSV data easily.
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
5
+ It carries [integration specs](https://github.com/joel/csvbuilder/tree/main/spec/integrations) which are perfect for understanding all the feature of `csvbuilder` and having a concrete example of how each part work.
6
+
7
+ 1. [csvbuilder-core](https://rubygems.org/gems/csvbuilder-core)
8
+ 2. [csvbuilder-dynamic-columns-core](https://rubygems.org/gems/csvbuilder-dynamic-columns-core)
9
+
10
+ This library was written to be extendable in mind. The extremely modular set of libraries lets you extend your application's functionalities to best suit your need.
11
+
12
+ Feel free to install only what your application needs.
6
13
 
7
14
  ## Installation
8
15
 
@@ -16,7 +23,136 @@ If bundler is not being used to manage dependencies, install the gem by executin
16
23
 
17
24
  ## Usage
18
25
 
19
- TODO: Write usage instructions here
26
+ # Model
27
+
28
+ The library comes we a nice simple DSL. The model should correspond to the headers and cells of a CSV row.
29
+
30
+ ```ruby
31
+ class UserRowModel
32
+ include Csvbuilder::Model
33
+
34
+ column :first_name
35
+ column :last_name
36
+ end
37
+ ```
38
+
39
+ Generally, the defined columns will match your database columns. But it is definitely not necessary.
40
+
41
+ The model is meant to be the standard area for import and export. We'll see in the next section how those two differ.
42
+
43
+ [More on Model](https://github.com/joel/csvbuilder-core)
44
+
45
+ # Exporting
46
+
47
+ If you want to add a piece of information for export only, like in the following example, the Corporate Email, you can compute data in the Export Class.
48
+
49
+ ```ruby
50
+ class UserExportModel < UserRowModel
51
+ include Csvbuilder::Export
52
+
53
+ column :email, header: "Corporate Email"
54
+
55
+ def email
56
+ "#{first_name}.#{last_name}@example.co.uk".downcase
57
+ end
58
+ end
59
+ ```
60
+
61
+ ## How to export
62
+
63
+ You need to provide both object collection and exporter class as follow:
64
+
65
+ ```ruby
66
+ collection = [OpenStruct.new(first_name: "John", last_name: "Doe", full_name: "John Doe")]
67
+
68
+ exporter = Csvbuilder::Export::File.new(UserExportModel, context = {})
69
+
70
+ exporter.headers
71
+ # => "First Name", "Last Name", "Full Name", "Email"
72
+
73
+ exporter.generate do |csv|
74
+ collection.each do |user|
75
+ csv.append_model(user, another_context: true)
76
+ end
77
+ end
78
+ # => "First Name,Last Name,Full Name,Email\nJohn,Doe,John Doe,john.doe@example.co.uk\n"
79
+ ```
80
+
81
+ [More on Exporter](https://github.com/joel/csvbuilder-exporter)
82
+
83
+ # Importing
84
+
85
+ The importing part is the more critical part. It carries validations to handle complex use cases. You have all the power of the `ActiveModel::Validations`. The validations happen in the importer class, and it acts as policies. You can couple them with the model itself, though. It is still recommended to handle model errors at a higher level to not pair the `ImportModel` with the model too much.
86
+
87
+ ```ruby
88
+ class UserImportModel < UserRowModel
89
+ include Csvbuilder::Import
90
+
91
+ validates :first_name, presence: true, length: { minimum: 2 }
92
+ validates :last_name, presence: true, length: { minimum: 2 }
93
+
94
+ def full_name
95
+ "#{first_name} #{last_name}"
96
+ end
97
+
98
+ def user
99
+ User.new(first_name: first_name, last_name: last_name, full_name: full_name)
100
+ end
101
+
102
+ # Skip if the row is not valid, the user is not valid or the user already exists
103
+ def skip?
104
+ super || !user.valid? || user.exists?
105
+ end
106
+
107
+ # Abort the import
108
+ def abort?
109
+ "#{first_name} #{last_name}" == "Bill Gates"
110
+ end
111
+ end
112
+ ```
113
+
114
+ ## How to import
115
+
116
+ For importing, you must provide the CSV file and the Import Class. The `Import::File` will skip an invalid importer, a not valid user or an already existing user.
117
+
118
+ ```ruby
119
+ csv_source = [
120
+ ["First name", "Last name"],
121
+ ["John" , "Doe" ],
122
+ ]
123
+
124
+ CSV.generate do |csv|
125
+ csv_source.each { |row| csv << row }
126
+ end
127
+
128
+ file = Tempfile.new(["input_file", ".csv"])
129
+
130
+ Csvbuilder::Import::File
131
+ .new(file.path, UserImportModel, options = {}).each do |row_model|
132
+ row_model.user.save
133
+ end
134
+ ```
135
+
136
+ [More on Importer](https://github.com/joel/csvbuilder-importer)
137
+
138
+ # Dynamic columns
139
+
140
+ The headers are dynamic and take a collection, so it doesn’t need a strict definition like other columns. Dynamic columns are a relation between header value and cell value.
141
+
142
+ [More on dynamic columns](https://github.com/joel/csvbuilder-dynamic-columns-core)
143
+
144
+ ## Credits
145
+
146
+ This project is inspired by the open-source library [CsvRowModel](https://github.com/finalcad/csv_row_model) written by [Steve Chung](https://github.com/s12chung). Unfortunately, this library is unmaintained and currently broken, and it depends on other unmaintained libraries. The purpose is to keep the core concepts and the architecture, removing all non-essential features and unmaintained dependencies and adding test coverage with Rails and Ruby matrices to track any broken version, past and future. Splitting the library into several gems lets projects use only the needed parts.
147
+
148
+ ## Dependencies
149
+
150
+ 1. [csvbuilder-core](https://rubygems.org/gems/csvbuilder-core)
151
+ 2. [csvbuilder-exporter](https://rubygems.org/gems/csvbuilder-exporter)
152
+ 3. [csvbuilder-importer](https://rubygems.org/gems/csvbuilder-importer)
153
+ 4. [csvbuilder-dynamic-columns-core](https://rubygems.org/gems/csvbuilder-dynamic-columns-core)
154
+ 5. [csvbuilder-dynamic-columns-exporter](https://rubygems.org/gems/csvbuilder-dynamic-columns-exporter)
155
+ 6. [csvbuilder-dynamic-columns-importer](https://rubygems.org/gems/csvbuilder-dynamic-columns-importer)
20
156
 
21
157
  ## Development
22
158
 
@@ -26,7 +162,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
26
162
 
27
163
  ## Contributing
28
164
 
29
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/csvbuilder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/csvbuilder/blob/main/CODE_OF_CONDUCT.md).
165
+ Bug reports and pull requests are welcome on GitHub at https://github.com/joel/csvbuilder. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [code of conduct](https://github.com/[USERNAME]/csvbuilder/blob/main/CODE_OF_CONDUCT.md).
30
166
 
31
167
  ## License
32
168
 
@@ -5,15 +5,20 @@ source "https://rubygems.org"
5
5
  # Runtime dependencies
6
6
  gem "activemodel", "~> 7.0"
7
7
  gem "activerecord", "~> 7.0"
8
+ gem "csv"
8
9
 
9
10
  # Libraries dependencies
10
11
  gem "csvbuilder-core"
11
- gem "csvbuilder-importer"
12
+ gem "csvbuilder-dynamic-columns-core"
12
13
  gem "csvbuilder-exporter"
14
+ gem "csvbuilder-dynamic-columns-exporter"
15
+ gem "csvbuilder-importer"
16
+ gem "csvbuilder-dynamic-columns-importer"
13
17
 
14
18
  # Test dependencies
15
19
  gem "activesupport", "~> 7.0"
16
20
  gem "sqlite3"
21
+ gem "database_cleaner"
17
22
 
18
23
  # Development dependencies
19
24
  gem "rake"
@@ -3,17 +3,23 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  # Runtime dependencies
6
- gem "activemodel", "~> 5.2"
7
- gem "activerecord", "~> 5.2"
6
+ gem "activemodel", "~> 8.0"
7
+ gem "activerecord", "~> 8.0"
8
+ gem "csv"
9
+ gem "mutex_m"
8
10
 
9
11
  # Libraries dependencies
10
12
  gem "csvbuilder-core"
11
- gem "csvbuilder-importer"
13
+ gem "csvbuilder-dynamic-columns-core"
12
14
  gem "csvbuilder-exporter"
15
+ gem "csvbuilder-dynamic-columns-exporter"
16
+ gem "csvbuilder-importer"
17
+ gem "csvbuilder-dynamic-columns-importer"
13
18
 
14
19
  # Test dependencies
15
- gem "activesupport", "~> 5.2"
20
+ gem "activesupport", "~> 8.0"
16
21
  gem "sqlite3"
22
+ gem "database_cleaner-active_record"
17
23
 
18
24
  # Development dependencies
19
25
  gem "rake"
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Csvbuilder
4
- VERSION = "0.1.1"
4
+ VERSION = "0.2.0"
5
5
  end
data/lib/csvbuilder.rb CHANGED
@@ -5,3 +5,7 @@ require_relative "csvbuilder/version"
5
5
  require "csvbuilder/core"
6
6
  require "csvbuilder/importer"
7
7
  require "csvbuilder/exporter"
8
+
9
+ require "csvbuilder/dynamic/columns/core"
10
+ require "csvbuilder/dynamic/columns/importer"
11
+ require "csvbuilder/dynamic/columns/exporter"
metadata CHANGED
@@ -1,15 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvbuilder-collection
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joel Azemar
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2022-12-21 00:00:00.000000000 Z
10
+ date: 2025-03-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: csv
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: csvbuilder-core
15
28
  requirement: !ruby/object:Gem::Requirement
@@ -25,7 +38,7 @@ dependencies:
25
38
  - !ruby/object:Gem::Version
26
39
  version: '0.1'
27
40
  - !ruby/object:Gem::Dependency
28
- name: csvbuilder-exporter
41
+ name: csvbuilder-dynamic-columns-core
29
42
  requirement: !ruby/object:Gem::Requirement
30
43
  requirements:
31
44
  - - "~>"
@@ -39,7 +52,7 @@ dependencies:
39
52
  - !ruby/object:Gem::Version
40
53
  version: '0.1'
41
54
  - !ruby/object:Gem::Dependency
42
- name: csvbuilder-importer
55
+ name: csvbuilder-dynamic-columns-exporter
43
56
  requirement: !ruby/object:Gem::Requirement
44
57
  requirements:
45
58
  - - "~>"
@@ -53,39 +66,47 @@ dependencies:
53
66
  - !ruby/object:Gem::Version
54
67
  version: '0.1'
55
68
  - !ruby/object:Gem::Dependency
56
- name: activerecord
69
+ name: csvbuilder-dynamic-columns-importer
57
70
  requirement: !ruby/object:Gem::Requirement
58
71
  requirements:
59
- - - ">="
60
- - !ruby/object:Gem::Version
61
- version: '5.2'
62
- - - "<"
72
+ - - "~>"
63
73
  - !ruby/object:Gem::Version
64
- version: '8'
65
- type: :development
74
+ version: '0.1'
75
+ type: :runtime
66
76
  prerelease: false
67
77
  version_requirements: !ruby/object:Gem::Requirement
68
78
  requirements:
69
- - - ">="
79
+ - - "~>"
70
80
  - !ruby/object:Gem::Version
71
- version: '5.2'
72
- - - "<"
81
+ version: '0.1'
82
+ - !ruby/object:Gem::Dependency
83
+ name: csvbuilder-exporter
84
+ requirement: !ruby/object:Gem::Requirement
85
+ requirements:
86
+ - - "~>"
73
87
  - !ruby/object:Gem::Version
74
- version: '8'
88
+ version: '0.1'
89
+ type: :runtime
90
+ prerelease: false
91
+ version_requirements: !ruby/object:Gem::Requirement
92
+ requirements:
93
+ - - "~>"
94
+ - !ruby/object:Gem::Version
95
+ version: '0.1'
75
96
  - !ruby/object:Gem::Dependency
76
- name: sqlite3
97
+ name: csvbuilder-importer
77
98
  requirement: !ruby/object:Gem::Requirement
78
99
  requirements:
79
100
  - - "~>"
80
101
  - !ruby/object:Gem::Version
81
- version: '1.5'
82
- type: :development
102
+ version: '0.1'
103
+ type: :runtime
83
104
  prerelease: false
84
105
  version_requirements: !ruby/object:Gem::Requirement
85
106
  requirements:
86
107
  - - "~>"
87
108
  - !ruby/object:Gem::Version
88
- version: '1.5'
109
+ version: '0.1'
89
110
  description: Help handle CSVs in a more efficient way
90
111
  email:
91
112
  - joel.azemar@gmail.com
@@ -100,12 +121,12 @@ files:
100
121
  - CHANGELOG.md
101
122
  - CODE_OF_CONDUCT.md
102
123
  - Gemfile
124
+ - Gemfile.lock
103
125
  - LICENSE.txt
104
126
  - README.md
105
127
  - Rakefile
106
- - gemfiles/Gemfile.5.2._gemfile
107
- - gemfiles/Gemfile.6.1._gemfile
108
128
  - gemfiles/Gemfile.7.0._gemfile
129
+ - gemfiles/Gemfile.8.0._gemfile
109
130
  - lib/csvbuilder.rb
110
131
  - lib/csvbuilder/version.rb
111
132
  - sig/csvbuilder.rbs
@@ -117,7 +138,6 @@ metadata:
117
138
  source_code_uri: https://github.com/joel/csvbuilder
118
139
  changelog_uri: https://github.com/joel/csvbuilder/blob/main/CHANGELOG.md
119
140
  rubygems_mfa_required: 'true'
120
- post_install_message:
121
141
  rdoc_options: []
122
142
  require_paths:
123
143
  - lib
@@ -125,15 +145,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
125
145
  requirements:
126
146
  - - ">="
127
147
  - !ruby/object:Gem::Version
128
- version: 2.6.0
148
+ version: '3.4'
129
149
  required_rubygems_version: !ruby/object:Gem::Requirement
130
150
  requirements:
131
151
  - - ">="
132
152
  - !ruby/object:Gem::Version
133
153
  version: '0'
134
154
  requirements: []
135
- rubygems_version: 3.3.12
136
- signing_key:
155
+ rubygems_version: 3.6.2
137
156
  specification_version: 4
138
157
  summary: Csvbuilder provide a nice DSL to import and export the CSVs
139
158
  test_files: []
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Runtime dependencies
6
- gem "activemodel", "~> 6.1"
7
- gem "activerecord", "~> 6.1"
8
-
9
- # Libraries dependencies
10
- gem "csvbuilder-core"
11
- gem "csvbuilder-importer"
12
- gem "csvbuilder-exporter"
13
-
14
- # Test dependencies
15
- gem "activesupport", "~> 6.1"
16
- gem "sqlite3"
17
-
18
- # Development dependencies
19
- gem "rake"
20
- gem "rspec"
21
- gem "rubocop"
22
- gem "rubocop-performance"
23
- gem "rubocop-rake"
24
- gem "rubocop-rspec"