diff options
| author | 2025-11-26 19:02:28 -0500 | |
|---|---|---|
| committer | 2025-11-26 19:02:28 -0500 | |
| commit | c62f8376a13e7a4f493167aba1c66a9201fc59c6 (patch) | |
| tree | d58492f972be02c406d26620004e1ffe2086fbc7 /lib/roo/formatters | |
| parent | ae103e148eb3c15606b816505492d870ef062ad3 (diff) | |
New upstream version 3.0.0.upstream/3.0.0upstream
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) |
