lib/tty/table/columns.rb in tty-table-0.11.0 vs lib/tty/table/columns.rb in tty-table-0.12.0

- old
+ new

@@ -1,8 +1,8 @@ # frozen_string_literal: true -require_relative 'error' +require_relative "error" module TTY class Table # A module for calculating table data column widths # @@ -67,11 +67,11 @@ when Numeric Array.new(table.columns_size, column_widths) when NilClass extract_widths(table.data) else - fail TypeError, 'Invalid type for column widths' + raise TypeError, "Invalid type for column widths" end end module_function :widths_from # Assert data integrity for column widths @@ -83,15 +83,15 @@ # @raise [TTY::InvalidArgument] # # @api public def assert_widths(column_widths, table_widths) if column_widths.empty? - fail InvalidArgument, 'Value for :column_widths must be ' \ - 'a non-empty array' + raise InvalidArgument, "Value for :column_widths must be " \ + "a non-empty array" end if column_widths.size != table_widths - fail InvalidArgument, 'Value for :column_widths must match ' \ - 'table column count' + raise InvalidArgument, "Value for :column_widths must match " \ + "table column count" end end module_function :assert_widths end # Columns end # Table