csvbuilder-dynamic-columns-exporter 0.1.1 → 0.1.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: a9f1c37c6d462524857d49238849c63136b1b498f9ed759aefa4023a441ebc40
4
- data.tar.gz: 7d502c386ee64eee159cf191fdedad76f774402e863fd55904e841c15ee125e2
3
+ metadata.gz: 213815125b6c74652b53bdce18b4fac186feef9668568612509ea63f05842df0
4
+ data.tar.gz: ba70e3d2daaf49b7a6a03a75906c9292eda8615c1eb23b928c96fa39a8344762
5
5
  SHA512:
6
- metadata.gz: c3acac4c4f22ef9f8339f820dcacb2ac7d220e1b6005bd0cff597c9c0254d5016cb2844002f429eb4a509016854caa8fc67f514f469f72a01d2581e7b7483c12
7
- data.tar.gz: 5763118e03eaecac46af5ee840e02c222b2039ad322a15287e388b42b60370b53cc03f66499928e2c5794735651897f9da7c0951ec750b0dc3e6746c0b0b9925
6
+ metadata.gz: 1f1d33dca1976f18350c035cc954c375f73ffc27a5099371a0c0923b1b958ea65708eb1214f9f84cdb8bf5dbc21f09c523bbf48b122cc93d478bc9b4bcd487ce
7
+ data.tar.gz: a59f949990ab6d0e87531fb590192cd66166622b00a331a386b9129f429cff93f8f37ca2fffaf744ff5f09e63dfbd69042a0e63f567e773cbf52dd4b612243ce
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
data/.rubocop_todo.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2022-12-23 11:40:53 UTC using RuboCop version 1.41.1.
3
+ # on 2025-02-27 05:00:38 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
@@ -28,6 +28,12 @@ RSpec/RepeatedDescription:
28
28
  Exclude:
29
29
  - 'spec/csvbuilder/dynamic/columns/exporter/concerns/export/dynamic_columns_spec.rb'
30
30
 
31
+ # Offense count: 1
32
+ # Configuration parameters: IgnoreNameless, IgnoreSymbolicNames.
33
+ RSpec/VerifiedDoubles:
34
+ Exclude:
35
+ - 'spec/csvbuilder/dynamic/columns/exporter/internal/export/dynamic_column_attribute_spec.rb'
36
+
31
37
  # Offense count: 2
32
38
  # Configuration parameters: AllowedConstants.
33
39
  Style/Documentation:
data/.tool-versions ADDED
@@ -0,0 +1 @@
1
+ ruby 3.4.2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.1.2] - 2024-02-27
4
+
5
+ - Update Ruby 3.4 and Relax Rails Constraint
6
+
3
7
  ## [0.1.1] - 2022-12-30
4
8
 
5
9
  Do not apply double formatting to the cells. The method `unformatted_value` should get the raw values from `source_cells`, not the value already formatted by row_model.format_cell.
data/Gemfile.lock ADDED
@@ -0,0 +1,120 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ csvbuilder-dynamic-columns-exporter (0.1.2)
5
+ activesupport (>= 5.2, < 8)
6
+ csvbuilder-core (~> 0.1)
7
+ csvbuilder-dynamic-columns-core (~> 0.1)
8
+ csvbuilder-exporter (~> 0.1)
9
+
10
+ GEM
11
+ remote: https://rubygems.org/
12
+ specs:
13
+ activemodel (7.2.2.1)
14
+ activesupport (= 7.2.2.1)
15
+ activesupport (7.2.2.1)
16
+ base64
17
+ benchmark (>= 0.3)
18
+ bigdecimal
19
+ concurrent-ruby (~> 1.0, >= 1.3.1)
20
+ connection_pool (>= 2.2.5)
21
+ drb
22
+ i18n (>= 1.6, < 2)
23
+ logger (>= 1.4.2)
24
+ minitest (>= 5.1)
25
+ securerandom (>= 0.3)
26
+ tzinfo (~> 2.0, >= 2.0.5)
27
+ ast (2.4.2)
28
+ base64 (0.2.0)
29
+ benchmark (0.4.0)
30
+ bigdecimal (3.1.9)
31
+ concurrent-ruby (1.3.5)
32
+ connection_pool (2.5.0)
33
+ csv (3.3.2)
34
+ csvbuilder-core (0.1.4)
35
+ activesupport (>= 5.2)
36
+ csv
37
+ csvbuilder-dynamic-columns-core (0.1.1)
38
+ activesupport (>= 5.2, < 8)
39
+ csvbuilder-core
40
+ csvbuilder-exporter (0.1.1)
41
+ activemodel (>= 5.2)
42
+ activesupport (>= 5.2)
43
+ csv
44
+ csvbuilder-core
45
+ diff-lcs (1.6.0)
46
+ drb (2.2.1)
47
+ i18n (1.14.7)
48
+ concurrent-ruby (~> 1.0)
49
+ json (2.10.1)
50
+ language_server-protocol (3.17.0.4)
51
+ lint_roller (1.1.0)
52
+ logger (1.6.6)
53
+ minitest (5.25.4)
54
+ parallel (1.26.3)
55
+ parser (3.3.7.1)
56
+ ast (~> 2.4.1)
57
+ racc
58
+ racc (1.8.1)
59
+ rainbow (3.1.1)
60
+ rake (13.2.1)
61
+ regexp_parser (2.10.0)
62
+ rspec (3.13.0)
63
+ rspec-core (~> 3.13.0)
64
+ rspec-expectations (~> 3.13.0)
65
+ rspec-mocks (~> 3.13.0)
66
+ rspec-core (3.13.3)
67
+ rspec-support (~> 3.13.0)
68
+ rspec-expectations (3.13.3)
69
+ diff-lcs (>= 1.2.0, < 2.0)
70
+ rspec-support (~> 3.13.0)
71
+ rspec-mocks (3.13.2)
72
+ diff-lcs (>= 1.2.0, < 2.0)
73
+ rspec-support (~> 3.13.0)
74
+ rspec-support (3.13.2)
75
+ rubocop (1.73.0)
76
+ json (~> 2.3)
77
+ language_server-protocol (~> 3.17.0.2)
78
+ lint_roller (~> 1.1.0)
79
+ parallel (~> 1.10)
80
+ parser (>= 3.3.0.2)
81
+ rainbow (>= 2.2.2, < 4.0)
82
+ regexp_parser (>= 2.9.3, < 3.0)
83
+ rubocop-ast (>= 1.38.0, < 2.0)
84
+ ruby-progressbar (~> 1.7)
85
+ unicode-display_width (>= 2.4.0, < 4.0)
86
+ rubocop-ast (1.38.1)
87
+ parser (>= 3.3.1.0)
88
+ rubocop-performance (1.24.0)
89
+ lint_roller (~> 1.1)
90
+ rubocop (>= 1.72.1, < 2.0)
91
+ rubocop-ast (>= 1.38.0, < 2.0)
92
+ rubocop-rake (0.7.1)
93
+ lint_roller (~> 1.1)
94
+ rubocop (>= 1.72.1)
95
+ rubocop-rspec (3.5.0)
96
+ lint_roller (~> 1.1)
97
+ rubocop (~> 1.72, >= 1.72.1)
98
+ ruby-progressbar (1.13.0)
99
+ securerandom (0.4.1)
100
+ tzinfo (2.0.6)
101
+ concurrent-ruby (~> 1.0)
102
+ unicode-display_width (3.1.4)
103
+ unicode-emoji (~> 4.0, >= 4.0.4)
104
+ unicode-emoji (4.0.4)
105
+
106
+ PLATFORMS
107
+ arm64-darwin-24
108
+ ruby
109
+
110
+ DEPENDENCIES
111
+ csvbuilder-dynamic-columns-exporter!
112
+ rake
113
+ rspec
114
+ rubocop
115
+ rubocop-performance
116
+ rubocop-rake
117
+ rubocop-rspec
118
+
119
+ BUNDLED WITH
120
+ 2.6.2
data/README.md CHANGED
@@ -103,6 +103,49 @@ class UserCsvExportModel < UserCsvRowModel
103
103
  end
104
104
  ```
105
105
 
106
+ ### Propagate default formatting
107
+
108
+ If a default formatting is defined, it will not automatically be propagated to the dynamic cells, which could cause edge cases.
109
+
110
+ ```ruby
111
+ class UserCsvRowModel
112
+ include Csvbuilder::Model
113
+
114
+ column :name
115
+
116
+ dynamic_column :skills
117
+
118
+ class << self
119
+
120
+ def format_cell(cell, _column_name, _context)
121
+ "- #{cell} -"
122
+ end
123
+
124
+ end
125
+ end
126
+ ```
127
+
128
+ To propagate it, recall the default formatting in dynamic columns formatting as follow:
129
+
130
+ ```ruby
131
+ class UserCsvExportModel < UserCsvRowModel
132
+ include Csvbuilder::Export
133
+
134
+ def skill(skill_name)
135
+ source_model.skills.where(name: skill_name).exists? ? "1" : "0"
136
+ end
137
+
138
+ class << self
139
+ def format_dynamic_column_cells(cells, _column_name, _context)
140
+ cells.map do |cell|
141
+ format_cell(cell, _column_name, _context)
142
+ end
143
+ end
144
+ end
145
+
146
+ end
147
+ ```
148
+
106
149
  ## Development
107
150
 
108
151
  After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
@@ -3,7 +3,7 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  # Runtime dependencies
6
- gem "activesupport", "~> 5.2"
6
+ gem "activemodel", "~> 7.0"
7
7
 
8
8
  # Libraries dependencies
9
9
  gem "csvbuilder-core"
@@ -4,7 +4,7 @@ module Csvbuilder
4
4
  module Dynamic
5
5
  module Columns
6
6
  module Exporter
7
- VERSION = "0.1.1"
7
+ VERSION = "0.1.2"
8
8
  end
9
9
  end
10
10
  end
metadata CHANGED
@@ -1,14 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: csvbuilder-dynamic-columns-exporter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
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-30 00:00:00.000000000 Z
10
+ date: 2025-02-27 00:00:00.000000000 Z
12
11
  dependencies:
13
12
  - !ruby/object:Gem::Dependency
14
13
  name: activesupport
@@ -83,15 +82,16 @@ files:
83
82
  - ".rspec"
84
83
  - ".rubocop.yml"
85
84
  - ".rubocop_todo.yml"
85
+ - ".tool-versions"
86
86
  - CHANGELOG.md
87
87
  - CODE_OF_CONDUCT.md
88
88
  - Gemfile
89
+ - Gemfile.lock
89
90
  - LICENSE.txt
90
91
  - README.md
91
92
  - Rakefile
92
- - gemfiles/Gemfile.5.2._gemfile
93
- - gemfiles/Gemfile.6.1._gemfile
94
93
  - gemfiles/Gemfile.7.0._gemfile
94
+ - gemfiles/Gemfile.8.0._gemfile
95
95
  - lib/.DS_Store
96
96
  - lib/csvbuilder/.DS_Store
97
97
  - lib/csvbuilder/dynamic/.DS_Store
@@ -113,7 +113,6 @@ metadata:
113
113
  source_code_uri: https://github.com/joel/csvbuilder-dynamic-columns-exporter
114
114
  changelog_uri: https://github.com/joel/csvbuilder-dynamic-columns-exporter/blob/main/CHANGELOG.md
115
115
  rubygems_mfa_required: 'true'
116
- post_install_message:
117
116
  rdoc_options: []
118
117
  require_paths:
119
118
  - lib
@@ -121,15 +120,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
121
120
  requirements:
122
121
  - - ">="
123
122
  - !ruby/object:Gem::Version
124
- version: 2.6.0
123
+ version: '3.4'
125
124
  required_rubygems_version: !ruby/object:Gem::Requirement
126
125
  requirements:
127
126
  - - ">="
128
127
  - !ruby/object:Gem::Version
129
128
  version: '0'
130
129
  requirements: []
131
- rubygems_version: 3.3.22
132
- signing_key:
130
+ rubygems_version: 3.6.2
133
131
  specification_version: 4
134
132
  summary: Csvbuilder Dynamic Columns contain the components to handle CSV dynamic columns
135
133
  test_files: []
@@ -1,19 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- source "https://rubygems.org"
4
-
5
- # Runtime dependencies
6
- gem "activesupport", "~> 6.1"
7
-
8
- # Libraries dependencies
9
- gem "csvbuilder-core"
10
- gem "csvbuilder-dynamic-columns-core"
11
- gem "csvbuilder-exporter"
12
-
13
- # Development dependencies
14
- gem "rake"
15
- gem "rspec"
16
- gem "rubocop"
17
- gem "rubocop-performance"
18
- gem "rubocop-rake"
19
- gem "rubocop-rspec"