summaryrefslogtreecommitdiffhomepage
path: root/lib/axlsx/package.rb
diff options
context:
space:
mode:
authorGeremia Taglialatela <[email protected]>2023-05-20 18:09:30 +0200
committerGeremia Taglialatela <[email protected]>2023-05-20 18:09:30 +0200
commit45dae7aad208d850fa522348861cf56ddafa3c97 (patch)
treef5f0c92351d00a775e0574ea82ba2763ffb0bd80 /lib/axlsx/package.rb
parent6a4b82def2e94b4811c38c37e606d426710d1e6c (diff)
downloadcaxlsx-45dae7aad208d850fa522348861cf56ddafa3c97.tar.gz
caxlsx-45dae7aad208d850fa522348861cf56ddafa3c97.zip
Fix Style/ZeroLengthPredicate unsafe offenses
Diffstat (limited to 'lib/axlsx/package.rb')
-rw-r--r--lib/axlsx/package.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb
index b4116f76..238f8c71 100644
--- a/lib/axlsx/package.rb
+++ b/lib/axlsx/package.rb
@@ -239,7 +239,7 @@ module Axlsx
end
workbook.comments.each do |comment|
- if comment.size > 0
+ unless comment.empty?
parts << { :entry => "xl/#{comment.pn}", :doc => comment, :schema => SML_XSD }
parts << { :entry => "xl/#{comment.vml_drawing.pn}", :doc => comment.vml_drawing, :schema => nil }
end
@@ -314,13 +314,13 @@ module Axlsx
end
workbook.comments.each do |comment|
- if comment.size > 0
+ unless comment.empty?
c_types << Axlsx::Override.new(:PartName => "/xl/#{comment.pn}",
:ContentType => COMMENT_CT)
end
end
- if workbook.comments.size > 0
+ unless workbook.comments.empty?
c_types << Axlsx::Default.new(:Extension => "vml", :ContentType => VML_DRAWING_CT)
end