summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.rubocop_todo.yml7
-rw-r--r--lib/axlsx.rb3
-rw-r--r--lib/axlsx/util/constants.rb5
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb1
4 files changed, 4 insertions, 12 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index bbe70cb3..29c93858 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -267,13 +267,6 @@ Style/PerlBackrefs:
Exclude:
- 'test/workbook/worksheet/tc_sheet_protection.rb'
-# This cop supports unsafe autocorrection (--autocorrect-all).
-# Configuration parameters: EnforcedStyle.
-# SupportedStyles: short, verbose
-Style/PreferredHashMethods:
- Exclude:
- - 'lib/axlsx.rb'
-
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle.
# SupportedStyles: same_as_string_literals, single_quotes, double_quotes
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index aeef2dfc..71c0ca1c 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -30,10 +30,11 @@ require 'zip'
# core dependencies
require 'bigdecimal'
+require 'cgi'
require 'set'
require 'time'
-if Gem.loaded_specs.has_key?("axlsx_styler")
+if Gem.loaded_specs.key?("axlsx_styler")
raise StandardError, "Please remove `axlsx_styler` from your Gemfile, the associated functionality is now built-in to `caxlsx` directly."
end
diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb
index 0767be31..1c5c0033 100644
--- a/lib/axlsx/util/constants.rb
+++ b/lib/axlsx/util/constants.rb
@@ -397,9 +397,8 @@ module Axlsx
# x0A Line Feed (Lf)
# x0D Carriage Return (Cr)
# x09 Character Tabulation
- # @see http://www.codetable.net/asciikeycodes
- pattern = "\x0-\x08\x0B\x0C\x0E-\x1F"
- pattern = pattern.respond_to?(:encode) ? pattern.encode('UTF-8') : pattern
+ # @see https://www.codetable.net/asciikeycodes
+ pattern = "\x0-\x08\x0B\x0C\x0E-\x1F".encode('UTF-8')
# The regular expression used to remove control characters from worksheets
CONTROL_CHARS = pattern.freeze
diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb
index b8b4fea5..2ff3a3cc 100644
--- a/lib/axlsx/workbook/worksheet/cell.rb
+++ b/lib/axlsx/workbook/worksheet/cell.rb
@@ -1,6 +1,5 @@
# frozen_string_literal: true
-require 'cgi'
module Axlsx
# A cell in a worksheet.
# Cell stores inforamation requried to serialize a single worksheet cell to xml. You must provde the Row that the cell belongs to and the cells value. The data type will automatically be determed if you do not specify the :type option. The default style will be applied if you do not supply the :style option. Changing the cell's type will recast the value to the type specified. Altering the cell's value via the property accessor will also automatically cast the provided value to the cell's type.