Skip to content

Grid broken if no gutter defined #1343

@bvogel

Description

@bvogel

The following code block in grid.rb will break if no gutter is defined:

      def apply_gutter(options)
        if options.key?(:gutter)
          @gutter = Float(options[:gutter])
          @row_gutter = @gutter
          @column_gutter = @gutter
        else
          @row_gutter = Float(options[:row_gutter])
          @column_gutter = Float(options[:column_gutter])
          @gutter = 0
        end
      end

the commit be66ddd replaced options[:row_gutter].to_f which happily returned 0.0 for nil values with Float(options[:row_gutter]) which will break with TypeError: can't convert nil into Float.

(I expect the same to happen in other places where to_f was replaced with Float())

I'd have considered this breaking change that would have merited a mayor version change.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions