• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

foodcoops / foodsoft / 22233288816

20 Feb 2026 05:02PM UTC coverage: 42.994% (-23.7%) from 66.662%
22233288816

push

github

lentschi
On #766: Make it compatible with new article versioning

0 of 4 new or added lines in 2 files covered. (0.0%)

1830 existing lines in 104 files now uncovered.

3136 of 7294 relevant lines covered (42.99%)

11.74 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

36.36
/lib/render_csv.rb
1
require 'csv'
1✔
2

3
class RenderCsv
1✔
4
  include ActionView::Helpers::NumberHelper
1✔
5

6
  def initialize(object, options = {})
1✔
UNCOV
7
    @object = object
×
UNCOV
8
    @options = options
×
9
    # defaults to please Microsoft Excel ...
UNCOV
10
    @options[:col_sep] ||= FoodsoftConfig[:csv_col_sep] || ';'
×
UNCOV
11
    @options[:row_sep] ||= FoodsoftConfig[:csv_row_sep] if FoodsoftConfig[:csv_row_sep]
×
UNCOV
12
    @options[:encoding] ||= FoodsoftConfig[:csv_encoding] || 'ISO-8859-15'
×
13
  end
14

15
  def to_csv
1✔
UNCOV
16
    options = @options.select { |k| %w[col_sep row_sep].include? k.to_s }
×
UNCOV
17
    ret = CSV.generate(**options) do |csv|
×
UNCOV
18
      if h = header
×
UNCOV
19
        csv << h
×
20
      end
UNCOV
21
      data { |d| csv << d }
×
22
    end
UNCOV
23
    ret.encode(@options[:encoding], invalid: :replace, undef: :replace)
×
24
  end
25

26
  def header
1✔
27
    nil
×
28
  end
29

30
  def data
1✔
31
    yield []
×
32
  end
33

34
  # XXX disable unit to avoid encoding problems, both in unit and whitespace. Also allows computations in spreadsheet.
35
  def number_to_currency(number, options = {})
1✔
36
    super(number, options.merge({ unit: '' }))
×
37
  end
38
end
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc