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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 20aebfbce656dcb5bbe2467cae65ad8bc510022f6a908b88f55f14101a92e1c3
4
- data.tar.gz: 334d472b4cd56b2a159459c2a8f46d80c704780de7ff348fe711a63d7930c1dc
3
+ metadata.gz: 879d7780851f01bc807133456d82734f8f2d064e8d258b566d310557f98dd705
4
+ data.tar.gz: df91fa942cf22252273cbc0b65b145a005c7071b415a99f3b485fecf3b813e64
5
5
  SHA512:
6
- metadata.gz: f865d4ad80b7ff10d85ebbeaf1a0a2e0185fe9798cf45dd50c1ae4246ad1dd96cf3b01983c29606f27886312335c4aa7e540b45f38e25c37753df7ce5bfbe152
7
- data.tar.gz: 9250f059eeb325d2d69732af18207561351cb8e86d3a6da878b1d66ab37e1d39f970af8385a463aa5ef89d0261f9cd7eda7eac39648c492c70e7bf841d181028
6
+ metadata.gz: 46a20d5b4ff80f8980170a160786164cfab11557d592f089b04a1fb9a24b51203db5e41c9b6bccc48968244d5190a08e8ed5befce453f71dff58583c93ffa8e5
7
+ data.tar.gz: 17e76c180e6c3c38cb89e3d73771ad9271bff04fcf740ba3910f472f262e6d8630f9d2e36e6d52eadd740f7a13552642c83ec39504cdc6f7e89b99f9a844beb0
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.3.1 - 2025-09-03
4
+ ## Fixed
5
+ - CSV format expects separator to be one of ";" or "," otherwise enforces ";"
6
+
3
7
  ## 1.3.0 - 2025-08-19
4
8
  ### Added
5
9
  - .func accepts flag order:
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`
@@ -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(separator)
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 << (format == :csv ? line.join(",") : line.join(separator))
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.0
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-08-19 00:00:00.000000000 Z
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.2.33
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