lib/write_xlsx/worksheet.rb in write_xlsx-0.77.1 vs lib/write_xlsx/worksheet.rb in write_xlsx-0.77.2
- old
+ new
@@ -1678,17 +1678,17 @@
elsif token.respond_to?(:coerce) # Numeric
write_number(*args)
elsif token =~ /^\d+$/
write_number(*args)
# Match http, https or ftp URL
- elsif token =~ %r|^[fh]tt?ps?://|
+ elsif token =~ %r|\A[fh]tt?ps?://|
write_url(*args)
# Match mailto:
- elsif token =~ %r|^mailto:|
+ elsif token =~ %r|\Amailto:|
write_url(*args)
# Match internal or external sheet link
- elsif token =~ %r!^(?:in|ex)ternal:!
+ elsif token =~ %r!\A(?:in|ex)ternal:!
write_url(*args)
# Match formula
elsif token =~ /^=/
write_formula(*args)
# Match array formula
@@ -3214,24 +3214,25 @@
case type
when 'blank', 'rich_string', 'array_formula'
others << format
end
- if type == 'string'
+ case type
+ when 'string'
write_string(row_first, col_first, token, format, *others)
- elsif type == 'number'
+ when 'number'
write_number(row_first, col_first, token, format, *others)
- elsif type == 'blank'
+ when 'blank'
write_blank(row_first, col_first, *others)
- elsif type == 'date_time'
+ when 'date_time'
write_date_time(row_first, col_first, token, format, *others)
- elsif type == 'rich_string'
+ when 'rich_string'
write_rich_string(row_first, col_first, *others)
- elsif type == 'url'
+ when 'url'
write_url(row_first, col_first, token, format, *others)
- elsif type == 'formula'
+ when 'formula'
write_formula(row_first, col_first, token, format, *others)
- elsif type == 'array_formula'
+ when 'array_formula'
write_formula_array(row_first, col_first, *others)
else
raise "Unknown type '#{type}'"
end