fixes #56 by accounting for case that would produce zero rows
This commit is contained in:
@@ -221,8 +221,12 @@ module Squib
|
||||
def rowify(opts)
|
||||
unless opts[:rows].respond_to? :to_i
|
||||
raise "Columns must be an integer" unless opts[:columns].respond_to? :to_i
|
||||
if @cards.size < opts[:columns].to_i
|
||||
opts[:rows] = 1
|
||||
else
|
||||
opts[:rows] = (@cards.size / opts[:columns].to_i).ceil
|
||||
end
|
||||
end
|
||||
opts
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user