diff options
| author | Jurriaan Pruis <[email protected]> | 2014-01-15 23:44:02 +0100 |
|---|---|---|
| committer | Jurriaan Pruis <[email protected]> | 2014-02-26 20:09:21 +0100 |
| commit | be8e00332c73439cf17083173ea74f1505100df9 (patch) | |
| tree | 383ec2e23fc0a14aa5ad90e139648a79814eeded /lib/axlsx/doc_props | |
| parent | a271a7d0f26ecb26d01aad00e094744d6fe8b0d2 (diff) | |
| download | caxlsx-be8e00332c73439cf17083173ea74f1505100df9.tar.gz caxlsx-be8e00332c73439cf17083173ea74f1505100df9.zip | |
Huge refactoring
Do not create huge strings
Let Row inherit from SimpleTypedList
Optimized sanitizing
Optimized validation
And more..
Diffstat (limited to 'lib/axlsx/doc_props')
| -rw-r--r-- | lib/axlsx/doc_props/app.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/doc_props/core.rb | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/lib/axlsx/doc_props/app.rb b/lib/axlsx/doc_props/app.rb index e6774147..b0dadf40 100644 --- a/lib/axlsx/doc_props/app.rb +++ b/lib/axlsx/doc_props/app.rb @@ -222,7 +222,7 @@ module Axlsx # @return [String] 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 << '">') instance_values.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 a74031f2..bb2da676 100644 --- a/lib/axlsx/doc_props/core.rb +++ b/lib/axlsx/doc_props/core.rb @@ -25,11 +25,11 @@ module Axlsx # @return [String] 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 |
