summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/doc_props
diff options
context:
space:
mode:
authorPaul Kmiec <[email protected]>2023-05-04 16:31:08 -0700
committerPaul Kmiec <[email protected]>2023-05-04 18:02:55 -0700
commitfabe8cb2571c8865270247ca78ddc01d493a9ee1 (patch)
tree27fe0b0df8c9bec8f746d92a0d128cad197027b2 /lib/axlsx/doc_props
parentfef93ec8ae2caf8a3f8310dbf8101c103e5905e4 (diff)
downloadcaxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.tar.gz
caxlsx-fabe8cb2571c8865270247ca78ddc01d493a9ee1.zip
Fix tests / code to work with frozen string literals
Diffstat (limited to 'lib/axlsx/doc_props')
-rw-r--r--lib/axlsx/doc_props/app.rb4
-rw-r--r--lib/axlsx/doc_props/core.rb12
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/axlsx/doc_props/app.rb b/lib/axlsx/doc_props/app.rb
index fec0a899..3eae1e28 100644
--- a/lib/axlsx/doc_props/app.rb
+++ b/lib/axlsx/doc_props/app.rb
@@ -219,9 +219,9 @@ module Axlsx
# Serialize the app.xml document
# @return [String]
- def to_xml_string(str = '')
+ def to_xml_string(str = +'')
str << '<?xml version="1.0" encoding="UTF-8"?>'
- str << ('<Properties xmlns="' << APP_NS << '" xmlns:vt="' << APP_NS_VT << '">')
+ str << (+'<Properties xmlns="' << APP_NS << '" xmlns:vt="' << APP_NS_VT << '">')
Axlsx.instance_values_for(self).each do |key, value|
node_name = Axlsx.camel(key)
str << "<#{node_name}>#{value}</#{node_name}>"
diff --git a/lib/axlsx/doc_props/core.rb b/lib/axlsx/doc_props/core.rb
index e7e53246..8d3292e9 100644
--- a/lib/axlsx/doc_props/core.rb
+++ b/lib/axlsx/doc_props/core.rb
@@ -22,13 +22,13 @@ module Axlsx
# serializes the core.xml document
# @return [String]
- def to_xml_string(str = '')
+ def to_xml_string(str = +'')
str << '<?xml version="1.0" encoding="UTF-8"?>'
- str << ('<cp:coreProperties xmlns:cp="' << CORE_NS << '" xmlns:dc="' << CORE_NS_DC << '" ')
- str << ('xmlns:dcmitype="' << CORE_NS_DCMIT << '" xmlns:dcterms="' << CORE_NS_DCT << '" ')
- str << ('xmlns:xsi="' << CORE_NS_XSI << '">')
- str << ('<dc:creator>' << self.creator << '</dc:creator>')
- str << ('<dcterms:created xsi:type="dcterms:W3CDTF">' << (created || Time.now).strftime('%Y-%m-%dT%H:%M:%S') << 'Z</dcterms:created>')
+ str << (+'<cp:coreProperties xmlns:cp="' << CORE_NS << '" xmlns:dc="' << CORE_NS_DC << '" ')
+ str << (+'xmlns:dcmitype="' << CORE_NS_DCMIT << '" xmlns:dcterms="' << CORE_NS_DCT << '" ')
+ str << (+'xmlns:xsi="' << CORE_NS_XSI << '">')
+ str << (+'<dc:creator>' << self.creator << '</dc:creator>')
+ str << (+'<dcterms:created xsi:type="dcterms:W3CDTF">' << (created || Time.now).strftime('%Y-%m-%dT%H:%M:%S') << 'Z</dcterms:created>')
str << '<cp:revision>0</cp:revision>'
str << '</cp:coreProperties>'
end