diff options
| author | 2025-11-26 19:02:46 -0500 | |
|---|---|---|
| committer | 2025-11-26 19:02:46 -0500 | |
| commit | c77a15eed515fe6dc9b2e831670f4d484e23dace (patch) | |
| tree | 87c79155c0b52b0e59eaf971f2b5bf9d860c77e4 /lib/roo/formatters | |
| parent | 537c7673bedbb1a2f77a3a088710546cb46506d0 (diff) | |
| parent | c62f8376a13e7a4f493167aba1c66a9201fc59c6 (diff) | |
Update upstream source from tag 'upstream/3.0.0'
Update to upstream version '3.0.0'
with Debian dir ceed7b02bc1417ad11993c466d2350a6b62fbecf
Diffstat (limited to 'lib/roo/formatters')
| -rw-r--r-- | lib/roo/formatters/csv.rb | 10 | ||||
| -rw-r--r-- | lib/roo/formatters/yaml.rb | 2 |
2 files changed, 10 insertions, 2 deletions
diff --git a/lib/roo/formatters/csv.rb b/lib/roo/formatters/csv.rb index 3181f09..67f63fa 100644 --- a/lib/roo/formatters/csv.rb +++ b/lib/roo/formatters/csv.rb @@ -1,7 +1,15 @@ module Roo module Formatters module CSV - def to_csv(filename = nil, separator = ",", sheet = default_sheet) + def to_csv(filename = nil, old_separator = nil, old_sheet = nil, separator: ",", sheet: default_sheet) + if old_separator + warn("[DEPRECATION] optional argument for separator is deprecated. Please use keyword argument :separator instead") + separator = old_separator + end + if old_sheet + warn("[DEPRECATION] optional argument for sheet is deprecated. Please use keyword argument :sheet instead") + sheet = old_sheet + end if filename File.open(filename, "w") do |file| write_csv_content(file, sheet, separator) diff --git a/lib/roo/formatters/yaml.rb b/lib/roo/formatters/yaml.rb index 69ef3ab..090b334 100644 --- a/lib/roo/formatters/yaml.rb +++ b/lib/roo/formatters/yaml.rb @@ -13,7 +13,7 @@ module Roo from_column ||= first_column(sheet) to_column ||= last_column(sheet) - result = "--- \n" + result = String.new("--- \n") from_row.upto(to_row) do |row| from_column.upto(to_column) do |col| next if empty?(row, col, sheet) |
