lib/write_xlsx/worksheet.rb in write_xlsx-0.85.8 vs lib/write_xlsx/worksheet.rb in write_xlsx-0.85.9
- old
+ new
@@ -719,11 +719,11 @@
# Excel allows up to 7 outline levels. Therefore the level parameter
# should be in the range <tt>0 <= level <= 7</tt>.
#
def set_column(*args)
# Check for a cell reference in A1 notation and substitute row and column
- if args[0] =~ /^\D/
+ if args[0].to_s =~ /^\D/
row1, firstcol, row2, lastcol, *data = substitute_cellref(*args)
else
firstcol, lastcol, *data = args
end
@@ -5809,11 +5809,11 @@
#
# Convert from an Excel internal colour index to a XML style #RRGGBB index
# based on the default or user defined values in the Workbook palette.
#
def palette_color(index) #:nodoc:
- if index =~ /^#([0-9A-F]{6})$/i
+ if index.to_s =~ /^#([0-9A-F]{6})$/i
"FF#{$1.upcase}"
else
"FF#{super(index)}"
end
end
@@ -6098,11 +6098,11 @@
token = tokens[2]
# Special handling of "Top" filter expressions.
if tokens[0] =~ /^top|bottom$/i
value = tokens[1]
- if (value =~ /\D/ or value.to_i < 1 or value.to_i > 500)
+ if (value.to_s =~ /\D/ or value.to_i < 1 or value.to_i > 500)
raise "The value '#{value}' in expression '#{expression}' " +
"must be in the range 1 to 500"
end
token.downcase!
if (token != 'items' and token != '%')
@@ -6127,11 +6127,11 @@
raise "Token '#{tokens[1]}' is not a valid operator " +
"in filter expression '#{expression}'"
end
# Special handling for Blanks/NonBlanks.
- if (token =~ /^blanks|nonblanks$/i)
+ if (token.to_s =~ /^blanks|nonblanks$/i)
# Only allow Equals or NotEqual in this context.
if (operator != 2 and operator != 5)
raise "The operator '#{tokens[1]}' in expression '#{expression}' " +
"is not valid in relation to Blanks/NonBlanks'"
end
@@ -6155,11 +6155,11 @@
end
end
# if the string token contains an Excel match character then change the
# operator type to indicate a non "simple" equality.
- if (operator == 2 and token =~ /[*?]/)
+ if (operator == 2 and token.to_s =~ /[*?]/)
operator = 22
end
[operator, token]
end
@@ -7633,10 +7633,10 @@
active_pane
end
def prepare_filter_column(col) # :nodoc:
# Check for a column reference in A1 notation and substitute.
- if col =~ /^\D/
+ if col.to_s =~ /^\D/
col_letter = col
# Convert col ref to a cell ref and then to a col number.
dummy, col = substitute_cellref("#{col}1")
raise "Invalid column '#{col_letter}'" if col >= COL_MAX