red-data-tools / unicode_plot.rb

Plot your data by Unicode characters
MIT License
246 stars 12 forks source link

Might be useful to do basic data checks and throw some neat ArgumentError #60

Open Nakilon opened 1 year ago

Nakilon commented 1 year ago

Because if I for some reason pass an empty array to histogram the error is cryptic:

gems/2.4.0/gems/unicode_plot-0.0.5/lib/unicode_plot/histogram.rb:12:in `histogram': undefined method `-' for nil:NilClass (NoMethodError)
    from main.rb:85:in `block in <main>'
    from main.rb:84:in `zip'
    from main.rb:84:in `<main>'