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

foodcoops / foodsoft / 21544448614

31 Jan 2026 12:25PM UTC coverage: 47.144% (-20.0%) from 67.127%
21544448614

Pull #1268

github

lentschi
Closes #1267

Remove the convert units feature
Pull Request #1268: Closes #1267 - Remove the `convert_units` feature

1 of 2 new or added lines in 2 files covered. (50.0%)

1539 existing lines in 99 files now uncovered.

3376 of 7161 relevant lines covered (47.14%)

13.89 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