summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-07-02 10:44:03 +0200
committerGeremia Taglialatela <[email protected]>2023-07-02 10:44:03 +0200
commit4bf0ab60682324873bbd250499c1de09fcf93b12 (patch)
tree1e9f34017094c91a460eca7a77ba5c276a133301 /lib
parentf2f6177efac76e6015b98c3290fd1839b8568fbe (diff)
downloadcaxlsx-4bf0ab60682324873bbd250499c1de09fcf93b12.tar.gz
caxlsx-4bf0ab60682324873bbd250499c1de09fcf93b12.zip
Require 'cgi' at module level
Previously, `require 'cgi'` was only called in `cell.rb`, but there are other components in the Axlsx module that also use this dependency, including `Axlsx::SeriesTitle`, `Axlsx::StrVal`, `Axlsx::Title` (drawing), `Axlsx::Comment`, `Axlsx::ConditionalFormattingRule`, and `Axlsx::HeaderFooter`. By requiring cgi at the module level, we ensure that this dependency is available to all components in the Axlsx module, which can prevent issues if someone is requiring specific components that depend on cgi. This change improves the maintainability and reliability of the codebase by ensuring that all components have access to the required dependencies. Close #282
Diffstat (limited to 'lib')
-rw-r--r--lib/axlsx.rb1
-rw-r--r--lib/axlsx/workbook/worksheet/cell.rb1
2 files changed, 1 insertions, 1 deletions
diff --git a/lib/axlsx.rb b/lib/axlsx.rb
index aeef2dfc..02bbabaa 100644
--- a/lib/axlsx.rb
+++ b/lib/axlsx.rb
@@ -30,6 +30,7 @@ require 'zip'
# core dependencies
require 'bigdecimal'
+require 'cgi'
require 'set'
require 'time'
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.