summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--.rubocop_todo.yml7
-rw-r--r--lib/axlsx.rb2
-rw-r--r--lib/axlsx/util/constants.rb5
3 files changed, 3 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml
index fcbc8c9f..1384f3c5 100644
--- a/.rubocop_todo.yml
+++ b/.rubocop_todo.yml
@@ -271,13 +271,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 02bbabaa..71c0ca1c 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -34,7 +34,7 @@ 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