flex-cartesian 1.3.0 → 1.3.1
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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +1 -1
- data/lib/flex-cartesian.rb +8 -3
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 879d7780851f01bc807133456d82734f8f2d064e8d258b566d310557f98dd705
|
4
|
+
data.tar.gz: df91fa942cf22252273cbc0b65b145a005c7071b415a99f3b485fecf3b813e64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 46a20d5b4ff80f8980170a160786164cfab11557d592f089b04a1fb9a24b51203db5e41c9b6bccc48968244d5190a08e8ed5befce453f71dff58583c93ffa8e5
|
7
|
+
data.tar.gz: 17e76c180e6c3c38cb89e3d73771ad9271bff04fcf740ba3910f472f262e6d8630f9d2e36e6d52eadd740f7a13552642c83ec39504cdc6f7e89b99f9a844beb0
|
data/CHANGELOG.md
CHANGED
data/README.md
CHANGED
@@ -452,7 +452,7 @@ Displays a progress bar using `ruby-progressbar`.
|
|
452
452
|
```ruby
|
453
453
|
output(separator: " | ", colorize: false, align: true, format: :plain, limit: nil, file: nil)
|
454
454
|
```
|
455
|
-
- `separator`: how to visually separate columns in the output
|
455
|
+
- `separator`: how to visually separate columns in the output. For :csv, it defaults to ";" unless it's one of ";" or ","
|
456
456
|
- `colorize`: whether to colorize output or not
|
457
457
|
- `align`: whether to align output by column or not
|
458
458
|
- `format`: one of `:plain`, `:markdown`, or `:csv`
|
data/lib/flex-cartesian.rb
CHANGED
@@ -229,6 +229,11 @@ end
|
|
229
229
|
end
|
230
230
|
|
231
231
|
def output(separator: " | ", colorize: false, align: true, format: :plain, limit: nil, file: nil)
|
232
|
+
sep = if format == :csv
|
233
|
+
[";", ","].include?(separator) ? separator : ";"
|
234
|
+
else
|
235
|
+
separator
|
236
|
+
end
|
232
237
|
rows = if @function_results && !@function_results.empty?
|
233
238
|
@function_results.keys
|
234
239
|
else
|
@@ -265,9 +270,9 @@ def output(separator: " | ", colorize: false, align: true, format: :plain, limit
|
|
265
270
|
lines << "| " + headers.map { |h| h.ljust(widths[h] || h.size) }.join(" | ") + " |"
|
266
271
|
lines << "|-" + headers.map { |h| "-" * (widths[h] || h.size) }.join("-|-") + "-|"
|
267
272
|
when :csv
|
268
|
-
lines << headers.join(
|
273
|
+
lines << headers.join(sep)
|
269
274
|
else
|
270
|
-
lines << headers.map { |h| fmt_cell(h, colorize, widths[h]) }.join(
|
275
|
+
lines << headers.map { |h| fmt_cell(h, colorize, widths[h]) }.join(sep)
|
271
276
|
end
|
272
277
|
|
273
278
|
# Rows
|
@@ -276,7 +281,7 @@ def output(separator: " | ", colorize: false, align: true, format: :plain, limit
|
|
276
281
|
visible_func_names.map { |fname| @function_results&.dig(row, fname) }
|
277
282
|
|
278
283
|
line = headers.zip(values).map { |(_, val)| fmt_cell(val, colorize, widths[_]) }
|
279
|
-
lines <<
|
284
|
+
lines << line.join(sep)
|
280
285
|
end
|
281
286
|
|
282
287
|
# Output to console or file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: flex-cartesian
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yury Rassokhin
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2025-
|
11
|
+
date: 2025-09-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: colorize
|
@@ -115,7 +115,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
115
115
|
- !ruby/object:Gem::Version
|
116
116
|
version: '0'
|
117
117
|
requirements: []
|
118
|
-
rubygems_version: 3.
|
118
|
+
rubygems_version: 3.4.10
|
119
119
|
signing_key:
|
120
120
|
specification_version: 4
|
121
121
|
summary: Flexible and human-friendly Cartesian product enumerator for Ruby
|