From fef93ec8ae2caf8a3f8310dbf8101c103e5905e4 Mon Sep 17 00:00:00 2001 From: Paul Kmiec Date: Thu, 4 May 2023 18:01:01 -0700 Subject: Enable Style/FrozenStringLiteralComment and autocorrect --- .rubocop_todo.yml | 6 - Gemfile | 2 + Rakefile | 2 + axlsx.gemspec | 2 + lib/axlsx.rb | 2 + lib/axlsx/content_type/abstract_content_type.rb | 2 + lib/axlsx/content_type/content_type.rb | 2 + lib/axlsx/content_type/default.rb | 2 + lib/axlsx/content_type/override.rb | 2 + lib/axlsx/doc_props/app.rb | 2 + lib/axlsx/doc_props/core.rb | 2 + lib/axlsx/drawing/area_chart.rb | 2 + lib/axlsx/drawing/area_series.rb | 2 + lib/axlsx/drawing/ax_data_source.rb | 2 + lib/axlsx/drawing/axes.rb | 2 + lib/axlsx/drawing/axis.rb | 2 + lib/axlsx/drawing/bar_3D_chart.rb | 2 + lib/axlsx/drawing/bar_chart.rb | 2 + lib/axlsx/drawing/bar_series.rb | 2 + lib/axlsx/drawing/bubble_chart.rb | 2 + lib/axlsx/drawing/bubble_series.rb | 2 + lib/axlsx/drawing/cat_axis.rb | 2 + lib/axlsx/drawing/chart.rb | 2 + lib/axlsx/drawing/d_lbls.rb | 2 + lib/axlsx/drawing/drawing.rb | 2 + lib/axlsx/drawing/graphic_frame.rb | 2 + lib/axlsx/drawing/hyperlink.rb | 2 + lib/axlsx/drawing/line_3D_chart.rb | 2 + lib/axlsx/drawing/line_chart.rb | 2 + lib/axlsx/drawing/line_series.rb | 2 + lib/axlsx/drawing/marker.rb | 2 + lib/axlsx/drawing/num_data.rb | 2 + lib/axlsx/drawing/num_data_source.rb | 2 + lib/axlsx/drawing/num_val.rb | 2 + lib/axlsx/drawing/one_cell_anchor.rb | 2 + lib/axlsx/drawing/pic.rb | 2 + lib/axlsx/drawing/picture_locking.rb | 2 + lib/axlsx/drawing/pie_3D_chart.rb | 2 + lib/axlsx/drawing/pie_series.rb | 2 + lib/axlsx/drawing/scaling.rb | 2 + lib/axlsx/drawing/scatter_chart.rb | 2 + lib/axlsx/drawing/scatter_series.rb | 2 + lib/axlsx/drawing/ser_axis.rb | 2 + lib/axlsx/drawing/series.rb | 2 + lib/axlsx/drawing/series_title.rb | 2 + lib/axlsx/drawing/str_data.rb | 2 + lib/axlsx/drawing/str_val.rb | 2 + lib/axlsx/drawing/title.rb | 2 + lib/axlsx/drawing/two_cell_anchor.rb | 2 + lib/axlsx/drawing/val_axis.rb | 2 + lib/axlsx/drawing/view_3D.rb | 2 + lib/axlsx/drawing/vml_drawing.rb | 2 + lib/axlsx/drawing/vml_shape.rb | 2 + lib/axlsx/package.rb | 2 + lib/axlsx/rels/relationship.rb | 2 + lib/axlsx/rels/relationships.rb | 2 + lib/axlsx/stylesheet/border.rb | 2 + lib/axlsx/stylesheet/border_pr.rb | 2 + lib/axlsx/stylesheet/cell_alignment.rb | 2 + lib/axlsx/stylesheet/cell_protection.rb | 2 + lib/axlsx/stylesheet/cell_style.rb | 2 + lib/axlsx/stylesheet/color.rb | 2 + lib/axlsx/stylesheet/dxf.rb | 2 + lib/axlsx/stylesheet/fill.rb | 2 + lib/axlsx/stylesheet/font.rb | 2 + lib/axlsx/stylesheet/gradient_fill.rb | 2 + lib/axlsx/stylesheet/gradient_stop.rb | 2 + lib/axlsx/stylesheet/num_fmt.rb | 2 + lib/axlsx/stylesheet/pattern_fill.rb | 2 + lib/axlsx/stylesheet/styles.rb | 2 + lib/axlsx/stylesheet/table_style.rb | 2 + lib/axlsx/stylesheet/table_style_element.rb | 2 + lib/axlsx/stylesheet/table_styles.rb | 2 + lib/axlsx/stylesheet/xf.rb | 2 + lib/axlsx/util/accessors.rb | 4 +- lib/axlsx/util/constants.rb | 186 +++++++++++---------- lib/axlsx/util/mime_type_utils.rb | 2 + lib/axlsx/util/options_parser.rb | 2 + lib/axlsx/util/serialized_attributes.rb | 2 + lib/axlsx/util/simple_typed_list.rb | 2 + lib/axlsx/util/storage.rb | 4 +- lib/axlsx/util/validators.rb | 2 + lib/axlsx/util/zip_command.rb | 2 + lib/axlsx/version.rb | 2 + lib/axlsx/workbook/defined_name.rb | 2 + lib/axlsx/workbook/defined_names.rb | 2 + lib/axlsx/workbook/shared_strings_table.rb | 2 + lib/axlsx/workbook/workbook.rb | 2 + lib/axlsx/workbook/workbook_view.rb | 2 + lib/axlsx/workbook/workbook_views.rb | 2 + .../workbook/worksheet/auto_filter/auto_filter.rb | 2 + .../worksheet/auto_filter/filter_column.rb | 2 + .../workbook/worksheet/auto_filter/filters.rb | 2 + lib/axlsx/workbook/worksheet/border_creator.rb | 2 + lib/axlsx/workbook/worksheet/break.rb | 2 + lib/axlsx/workbook/worksheet/cell.rb | 8 +- lib/axlsx/workbook/worksheet/cell_serializer.rb | 2 + lib/axlsx/workbook/worksheet/cfvo.rb | 2 + lib/axlsx/workbook/worksheet/cfvos.rb | 2 + lib/axlsx/workbook/worksheet/col.rb | 2 + lib/axlsx/workbook/worksheet/col_breaks.rb | 2 + lib/axlsx/workbook/worksheet/color_scale.rb | 2 + lib/axlsx/workbook/worksheet/cols.rb | 2 + lib/axlsx/workbook/worksheet/comment.rb | 2 + lib/axlsx/workbook/worksheet/comments.rb | 2 + .../workbook/worksheet/conditional_formatting.rb | 2 + .../worksheet/conditional_formatting_rule.rb | 2 + .../workbook/worksheet/conditional_formattings.rb | 2 + lib/axlsx/workbook/worksheet/data_bar.rb | 2 + lib/axlsx/workbook/worksheet/data_validation.rb | 2 + lib/axlsx/workbook/worksheet/data_validations.rb | 2 + .../workbook/worksheet/date_time_converter.rb | 2 + lib/axlsx/workbook/worksheet/dimension.rb | 2 + lib/axlsx/workbook/worksheet/header_footer.rb | 2 + lib/axlsx/workbook/worksheet/icon_set.rb | 2 + lib/axlsx/workbook/worksheet/merged_cells.rb | 2 + lib/axlsx/workbook/worksheet/outline_pr.rb | 2 + lib/axlsx/workbook/worksheet/page_margins.rb | 2 + lib/axlsx/workbook/worksheet/page_set_up_pr.rb | 2 + lib/axlsx/workbook/worksheet/page_setup.rb | 2 + lib/axlsx/workbook/worksheet/pane.rb | 2 + lib/axlsx/workbook/worksheet/pivot_table.rb | 2 + .../worksheet/pivot_table_cache_definition.rb | 2 + lib/axlsx/workbook/worksheet/pivot_tables.rb | 2 + lib/axlsx/workbook/worksheet/print_options.rb | 2 + lib/axlsx/workbook/worksheet/protected_range.rb | 2 + lib/axlsx/workbook/worksheet/protected_ranges.rb | 2 + lib/axlsx/workbook/worksheet/rich_text.rb | 2 + lib/axlsx/workbook/worksheet/rich_text_run.rb | 2 + lib/axlsx/workbook/worksheet/row.rb | 2 + lib/axlsx/workbook/worksheet/row_breaks.rb | 2 + lib/axlsx/workbook/worksheet/selection.rb | 2 + lib/axlsx/workbook/worksheet/sheet_calc_pr.rb | 2 + lib/axlsx/workbook/worksheet/sheet_data.rb | 2 + lib/axlsx/workbook/worksheet/sheet_format_pr.rb | 2 + lib/axlsx/workbook/worksheet/sheet_pr.rb | 2 + lib/axlsx/workbook/worksheet/sheet_protection.rb | 2 + lib/axlsx/workbook/worksheet/sheet_view.rb | 2 + lib/axlsx/workbook/worksheet/table.rb | 2 + lib/axlsx/workbook/worksheet/table_style_info.rb | 2 + lib/axlsx/workbook/worksheet/tables.rb | 2 + lib/axlsx/workbook/worksheet/worksheet.rb | 2 + lib/axlsx/workbook/worksheet/worksheet_comments.rb | 2 + lib/axlsx/workbook/worksheet/worksheet_drawing.rb | 2 + .../workbook/worksheet/worksheet_hyperlink.rb | 2 + .../workbook/worksheet/worksheet_hyperlinks.rb | 2 + lib/caxlsx.rb | 2 + test/benchmark.rb | 1 + test/content_type/tc_content_type.rb | 2 + test/content_type/tc_default.rb | 2 + test/content_type/tc_override.rb | 2 + test/doc_props/tc_app.rb | 2 + test/doc_props/tc_core.rb | 2 + test/drawing/tc_area_chart.rb | 2 + test/drawing/tc_area_series.rb | 2 + test/drawing/tc_axes.rb | 2 + test/drawing/tc_axis.rb | 2 + test/drawing/tc_bar_3D_chart.rb | 2 + test/drawing/tc_bar_chart.rb | 2 + test/drawing/tc_bar_series.rb | 2 + test/drawing/tc_bubble_chart.rb | 2 + test/drawing/tc_bubble_series.rb | 2 + test/drawing/tc_cat_axis.rb | 2 + test/drawing/tc_cat_axis_data.rb | 1 + test/drawing/tc_chart.rb | 2 + test/drawing/tc_d_lbls.rb | 2 + test/drawing/tc_data_source.rb | 2 + test/drawing/tc_drawing.rb | 2 + test/drawing/tc_graphic_frame.rb | 2 + test/drawing/tc_hyperlink.rb | 2 + test/drawing/tc_line_3d_chart.rb | 2 + test/drawing/tc_line_chart.rb | 2 + test/drawing/tc_line_series.rb | 2 + test/drawing/tc_marker.rb | 2 + test/drawing/tc_named_axis_data.rb | 1 + test/drawing/tc_num_data.rb | 2 + test/drawing/tc_num_val.rb | 2 + test/drawing/tc_one_cell_anchor.rb | 2 + test/drawing/tc_pic.rb | 2 + test/drawing/tc_picture_locking.rb | 2 + test/drawing/tc_pie_3D_chart.rb | 2 + test/drawing/tc_pie_series.rb | 2 + test/drawing/tc_scaling.rb | 2 + test/drawing/tc_scatter_chart.rb | 2 + test/drawing/tc_scatter_series.rb | 2 + test/drawing/tc_ser_axis.rb | 2 + test/drawing/tc_series.rb | 2 + test/drawing/tc_series_title.rb | 2 + test/drawing/tc_str_data.rb | 2 + test/drawing/tc_str_val.rb | 2 + test/drawing/tc_title.rb | 2 + test/drawing/tc_two_cell_anchor.rb | 2 + test/drawing/tc_val_axis.rb | 2 + test/drawing/tc_view_3D.rb | 2 + test/drawing/tc_vml_drawing.rb | 2 + test/drawing/tc_vml_shape.rb | 2 + test/profile.rb | 1 + test/rels/tc_relationship.rb | 2 + test/rels/tc_relationships.rb | 2 + test/stylesheet/tc_border.rb | 2 + test/stylesheet/tc_border_pr.rb | 2 + test/stylesheet/tc_cell_alignment.rb | 2 + test/stylesheet/tc_cell_protection.rb | 2 + test/stylesheet/tc_cell_style.rb | 2 + test/stylesheet/tc_color.rb | 2 + test/stylesheet/tc_dxf.rb | 2 + test/stylesheet/tc_fill.rb | 2 + test/stylesheet/tc_font.rb | 2 + test/stylesheet/tc_gradient_fill.rb | 2 + test/stylesheet/tc_gradient_stop.rb | 2 + test/stylesheet/tc_num_fmt.rb | 2 + test/stylesheet/tc_pattern_fill.rb | 2 + test/stylesheet/tc_styles.rb | 2 + test/stylesheet/tc_table_style.rb | 2 + test/stylesheet/tc_table_style_element.rb | 2 + test/stylesheet/tc_table_styles.rb | 2 + test/stylesheet/tc_xf.rb | 2 + test/support/capture_warnings.rb | 2 + test/tc_axlsx.rb | 4 +- test/tc_helper.rb | 2 + test/tc_package.rb | 2 + test/util/tc_mime_type_utils.rb | 2 + test/util/tc_serialized_attributes.rb | 2 + test/util/tc_simple_typed_list.rb | 2 + test/util/tc_validators.rb | 2 + test/workbook/tc_defined_name.rb | 2 + test/workbook/tc_shared_strings_table.rb | 2 + test/workbook/tc_workbook.rb | 2 + test/workbook/tc_workbook_view.rb | 2 + .../worksheet/auto_filter/tc_auto_filter.rb | 2 + .../worksheet/auto_filter/tc_filter_column.rb | 2 + test/workbook/worksheet/auto_filter/tc_filters.rb | 2 + test/workbook/worksheet/tc_border_creator.rb | 2 + test/workbook/worksheet/tc_break.rb | 2 + test/workbook/worksheet/tc_cell.rb | 2 + test/workbook/worksheet/tc_cfvo.rb | 2 + test/workbook/worksheet/tc_col.rb | 2 + test/workbook/worksheet/tc_color_scale.rb | 2 + test/workbook/worksheet/tc_comment.rb | 2 + test/workbook/worksheet/tc_comments.rb | 2 + .../worksheet/tc_conditional_formatting.rb | 2 + test/workbook/worksheet/tc_data_bar.rb | 2 + test/workbook/worksheet/tc_data_validation.rb | 2 + test/workbook/worksheet/tc_date_time_converter.rb | 2 + test/workbook/worksheet/tc_header_footer.rb | 2 + test/workbook/worksheet/tc_icon_set.rb | 2 + test/workbook/worksheet/tc_outline_pr.rb | 2 + test/workbook/worksheet/tc_page_margins.rb | 2 + test/workbook/worksheet/tc_page_set_up_pr.rb | 2 + test/workbook/worksheet/tc_page_setup.rb | 2 + test/workbook/worksheet/tc_pane.rb | 2 + test/workbook/worksheet/tc_pivot_table.rb | 2 + .../worksheet/tc_pivot_table_cache_definition.rb | 2 + test/workbook/worksheet/tc_print_options.rb | 2 + test/workbook/worksheet/tc_protected_range.rb | 2 + test/workbook/worksheet/tc_rich_text.rb | 2 + test/workbook/worksheet/tc_rich_text_run.rb | 2 + test/workbook/worksheet/tc_row.rb | 2 + test/workbook/worksheet/tc_selection.rb | 2 + test/workbook/worksheet/tc_sheet_calc_pr.rb | 2 + test/workbook/worksheet/tc_sheet_format_pr.rb | 2 + test/workbook/worksheet/tc_sheet_pr.rb | 2 + test/workbook/worksheet/tc_sheet_protection.rb | 2 + test/workbook/worksheet/tc_sheet_view.rb | 2 + test/workbook/worksheet/tc_table.rb | 2 + test/workbook/worksheet/tc_table_style_info.rb | 2 + test/workbook/worksheet/tc_worksheet.rb | 2 + test/workbook/worksheet/tc_worksheet_hyperlink.rb | 2 + 268 files changed, 628 insertions(+), 104 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 0ec0a44a..217c0d9c 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -272,12 +272,6 @@ Style/FormatString: Style/FormatStringToken: EnforcedStyle: unannotated -# This cop supports unsafe autocorrection (--autocorrect-all). -# Configuration parameters: EnforcedStyle. -# SupportedStyles: always, always_true, never -Style/FrozenStringLiteralComment: - Enabled: false - # This cop supports safe autocorrection (--autocorrect). # Configuration parameters: MinBodyLength, AllowConsecutiveConditionals. Style/GuardClause: diff --git a/Gemfile b/Gemfile index 734b9087..45758bcc 100644 --- a/Gemfile +++ b/Gemfile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + source 'https://rubygems.org' gemspec diff --git a/Rakefile b/Rakefile index dd31d33d..ccba7692 100644 --- a/Rakefile +++ b/Rakefile @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require File.expand_path(File.dirname(__FILE__) + '/lib/axlsx/version.rb') task :build => :gendoc do diff --git a/axlsx.gemspec b/axlsx.gemspec index a15f4129..34942176 100644 --- a/axlsx.gemspec +++ b/axlsx.gemspec @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require File.expand_path('../lib/axlsx/version', __FILE__) Gem::Specification.new do |s| diff --git a/lib/axlsx.rb b/lib/axlsx.rb index 0fd8260c..e21efb07 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'htmlentities' require 'axlsx/version.rb' require 'marcel' diff --git a/lib/axlsx/content_type/abstract_content_type.rb b/lib/axlsx/content_type/abstract_content_type.rb index 45bd4853..dfb7dd91 100644 --- a/lib/axlsx/content_type/abstract_content_type.rb +++ b/lib/axlsx/content_type/abstract_content_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class extracts the common parts from Default and Override class AbstractContentType diff --git a/lib/axlsx/content_type/content_type.rb b/lib/axlsx/content_type/content_type.rb index 48b5b6a9..ead50713 100644 --- a/lib/axlsx/content_type/content_type.rb +++ b/lib/axlsx/content_type/content_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx require 'axlsx/content_type/abstract_content_type.rb' require 'axlsx/content_type/default.rb' diff --git a/lib/axlsx/content_type/default.rb b/lib/axlsx/content_type/default.rb index d5901456..ad215070 100644 --- a/lib/axlsx/content_type/default.rb +++ b/lib/axlsx/content_type/default.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # An default content part. These parts are automatically created by for you based on the content of your package. class Default < AbstractContentType diff --git a/lib/axlsx/content_type/override.rb b/lib/axlsx/content_type/override.rb index 5fb98d4c..fd98a803 100644 --- a/lib/axlsx/content_type/override.rb +++ b/lib/axlsx/content_type/override.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # An override content part. These parts are automatically created by for you based on the content of your package. class Override < AbstractContentType diff --git a/lib/axlsx/doc_props/app.rb b/lib/axlsx/doc_props/app.rb index 965b34dc..fec0a899 100644 --- a/lib/axlsx/doc_props/app.rb +++ b/lib/axlsx/doc_props/app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # App represents the app.xml document. The attributes for this object are primarily managed by the application the end user uses to edit the document. None of the attributes are required to serialize a valid xlsx object. # @see shared-documentPropertiesExtended.xsd diff --git a/lib/axlsx/doc_props/core.rb b/lib/axlsx/doc_props/core.rb index 0f3b6333..e7e53246 100644 --- a/lib/axlsx/doc_props/core.rb +++ b/lib/axlsx/doc_props/core.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The core object for the package. # @note Packages manage their own core object. diff --git a/lib/axlsx/drawing/area_chart.rb b/lib/axlsx/drawing/area_chart.rb index 0c5193c6..9b948808 100644 --- a/lib/axlsx/drawing/area_chart.rb +++ b/lib/axlsx/drawing/area_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The AreaChart is a two dimentional line chart (who would have guessed?) that you can add to your worksheet. # @example Creating a chart diff --git a/lib/axlsx/drawing/area_series.rb b/lib/axlsx/drawing/area_series.rb index 7995c5bc..55c391d9 100644 --- a/lib/axlsx/drawing/area_series.rb +++ b/lib/axlsx/drawing/area_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A AreaSeries defines the title, data and labels for line charts # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/ax_data_source.rb b/lib/axlsx/drawing/ax_data_source.rb index b8aafc5e..c9d4300f 100644 --- a/lib/axlsx/drawing/ax_data_source.rb +++ b/lib/axlsx/drawing/ax_data_source.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # An axis data source that can contain referenced or literal strings or numbers # @note only string data types are supported - mainly because we have not implemented a chart type that requires a numerical axis value diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index 314f28c3..c84b4378 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Axes class creates and manages axis information and # serialization for charts. diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index 601a7c85..6ee2b9f4 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # the access class defines common properties and values for a chart axis. class Axis diff --git a/lib/axlsx/drawing/bar_3D_chart.rb b/lib/axlsx/drawing/bar_3D_chart.rb index 89544be0..0ba55eb2 100644 --- a/lib/axlsx/drawing/bar_3D_chart.rb +++ b/lib/axlsx/drawing/bar_3D_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Bar3DChart is a three dimentional barchart (who would have guessed?) that you can add to your worksheet. # @see Worksheet#add_chart diff --git a/lib/axlsx/drawing/bar_chart.rb b/lib/axlsx/drawing/bar_chart.rb index 1ed38332..c3240f32 100644 --- a/lib/axlsx/drawing/bar_chart.rb +++ b/lib/axlsx/drawing/bar_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The BarChart is a two dimentional barchart that you can add to your worksheet. # @see Worksheet#add_chart diff --git a/lib/axlsx/drawing/bar_series.rb b/lib/axlsx/drawing/bar_series.rb index 0b4d9614..86ca4e88 100644 --- a/lib/axlsx/drawing/bar_series.rb +++ b/lib/axlsx/drawing/bar_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A BarSeries defines the title, data and labels for bar charts # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/bubble_chart.rb b/lib/axlsx/drawing/bubble_chart.rb index 084d0477..73b74035 100644 --- a/lib/axlsx/drawing/bubble_chart.rb +++ b/lib/axlsx/drawing/bubble_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The BubbleChart allows you to insert a bubble chart into your worksheet # @see Worksheet#add_chart diff --git a/lib/axlsx/drawing/bubble_series.rb b/lib/axlsx/drawing/bubble_series.rb index 78b44bf1..e44a3fd8 100644 --- a/lib/axlsx/drawing/bubble_series.rb +++ b/lib/axlsx/drawing/bubble_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A BubbleSeries defines the x/y position and bubble size of data in the chart # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb index 75290da0..23568d6f 100644 --- a/lib/axlsx/drawing/cat_axis.rb +++ b/lib/axlsx/drawing/cat_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A CatAxis object defines a chart category axis class CatAxis < Axis diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb index 0c68ff4b..636c1713 100644 --- a/lib/axlsx/drawing/chart.rb +++ b/lib/axlsx/drawing/chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A Chart is the superclass for specific charts # @note Worksheet#add_chart is the recommended way to create charts for your worksheets. diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index 358378c5..cdccf327 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # There are more elements in the dLbls spec that allow for # customizations and formatting. For now, I am just implementing the diff --git a/lib/axlsx/drawing/drawing.rb b/lib/axlsx/drawing/drawing.rb index bc6dd1cf..d36e4349 100644 --- a/lib/axlsx/drawing/drawing.rb +++ b/lib/axlsx/drawing/drawing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx require 'axlsx/drawing/d_lbls.rb' require 'axlsx/drawing/title.rb' diff --git a/lib/axlsx/drawing/graphic_frame.rb b/lib/axlsx/drawing/graphic_frame.rb index 006b3b0f..e245b9ab 100644 --- a/lib/axlsx/drawing/graphic_frame.rb +++ b/lib/axlsx/drawing/graphic_frame.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A graphic frame defines a container for a chart object # @note The recommended way to manage charts is Worksheet#add_chart diff --git a/lib/axlsx/drawing/hyperlink.rb b/lib/axlsx/drawing/hyperlink.rb index 4d3b343d..1fd7fdd4 100644 --- a/lib/axlsx/drawing/hyperlink.rb +++ b/lib/axlsx/drawing/hyperlink.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # a hyperlink object adds an action to an image when clicked so that when the image is clicked the link is fecthed. # @note using the hyperlink option when calling add_image on a drawing object is the recommended way to manage hyperlinks diff --git a/lib/axlsx/drawing/line_3D_chart.rb b/lib/axlsx/drawing/line_3D_chart.rb index 85d04b06..51beaa70 100644 --- a/lib/axlsx/drawing/line_3D_chart.rb +++ b/lib/axlsx/drawing/line_3D_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Line3DChart is a three dimentional line chart (who would have guessed?) that you can add to your worksheet. # @example Creating a chart diff --git a/lib/axlsx/drawing/line_chart.rb b/lib/axlsx/drawing/line_chart.rb index 1ff2bde5..87757dbb 100644 --- a/lib/axlsx/drawing/line_chart.rb +++ b/lib/axlsx/drawing/line_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The LineChart is a two dimentional line chart (who would have guessed?) that you can add to your worksheet. # @example Creating a chart diff --git a/lib/axlsx/drawing/line_series.rb b/lib/axlsx/drawing/line_series.rb index 18719277..b1e36bbe 100644 --- a/lib/axlsx/drawing/line_series.rb +++ b/lib/axlsx/drawing/line_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A LineSeries defines the title, data and labels for line charts # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/marker.rb b/lib/axlsx/drawing/marker.rb index a4933c33..0e728fc6 100644 --- a/lib/axlsx/drawing/marker.rb +++ b/lib/axlsx/drawing/marker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Marker class defines a point in the worksheet that drawing anchors attach to. # @note The recommended way to manage markers is Worksheet#add_chart Markers are created for a two cell anchor based on the :start and :end options. diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb index 7239ac5f..5c4e832f 100644 --- a/lib/axlsx/drawing/num_data.rb +++ b/lib/axlsx/drawing/num_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class specifies data for a particular data point. It is used for both numCache and numLit object class NumData diff --git a/lib/axlsx/drawing/num_data_source.rb b/lib/axlsx/drawing/num_data_source.rb index 46f6ba71..0159a9d6 100644 --- a/lib/axlsx/drawing/num_data_source.rb +++ b/lib/axlsx/drawing/num_data_source.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A numeric data source for use by charts. class NumDataSource diff --git a/lib/axlsx/drawing/num_val.rb b/lib/axlsx/drawing/num_val.rb index f4b2c399..3ec9f87b 100644 --- a/lib/axlsx/drawing/num_val.rb +++ b/lib/axlsx/drawing/num_val.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class specifies data for a particular data point. class NumVal < StrVal diff --git a/lib/axlsx/drawing/one_cell_anchor.rb b/lib/axlsx/drawing/one_cell_anchor.rb index 52cf2244..d9999be5 100644 --- a/lib/axlsx/drawing/one_cell_anchor.rb +++ b/lib/axlsx/drawing/one_cell_anchor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class details a single cell anchor for drawings. # @note The recommended way to manage drawings, images and charts is Worksheet#add_chart or Worksheet#add_image. diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index e31876bf..1f37cd0f 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # a Pic object represents an image in your worksheet # Worksheet#add_image is the recommended way to manage images in your sheets diff --git a/lib/axlsx/drawing/picture_locking.rb b/lib/axlsx/drawing/picture_locking.rb index efd85f97..08ac4527 100644 --- a/lib/axlsx/drawing/picture_locking.rb +++ b/lib/axlsx/drawing/picture_locking.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The picture locking class defines the locking properties for pictures in your workbook. class PictureLocking diff --git a/lib/axlsx/drawing/pie_3D_chart.rb b/lib/axlsx/drawing/pie_3D_chart.rb index 1772c537..be6e3ba7 100644 --- a/lib/axlsx/drawing/pie_3D_chart.rb +++ b/lib/axlsx/drawing/pie_3D_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Pie3DChart is a three dimentional piechart (who would have guessed?) that you can add to your worksheet. # @see Worksheet#add_chart diff --git a/lib/axlsx/drawing/pie_series.rb b/lib/axlsx/drawing/pie_series.rb index 29b71e36..9cc50aa2 100644 --- a/lib/axlsx/drawing/pie_series.rb +++ b/lib/axlsx/drawing/pie_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A PieSeries defines the data and labels and explosion for pie charts series. # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/scaling.rb b/lib/axlsx/drawing/scaling.rb index 8d2d8ed7..4443f880 100644 --- a/lib/axlsx/drawing/scaling.rb +++ b/lib/axlsx/drawing/scaling.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Scaling class defines axis scaling class Scaling diff --git a/lib/axlsx/drawing/scatter_chart.rb b/lib/axlsx/drawing/scatter_chart.rb index b118a09a..37d528ec 100644 --- a/lib/axlsx/drawing/scatter_chart.rb +++ b/lib/axlsx/drawing/scatter_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The ScatterChart allows you to insert a scatter chart into your worksheet # @see Worksheet#add_chart diff --git a/lib/axlsx/drawing/scatter_series.rb b/lib/axlsx/drawing/scatter_series.rb index e4e1f27a..9ea9b8a7 100644 --- a/lib/axlsx/drawing/scatter_series.rb +++ b/lib/axlsx/drawing/scatter_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A ScatterSeries defines the x and y position of data in the chart # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/ser_axis.rb b/lib/axlsx/drawing/ser_axis.rb index f49c1301..4834c355 100644 --- a/lib/axlsx/drawing/ser_axis.rb +++ b/lib/axlsx/drawing/ser_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A SerAxis object defines a series axis class SerAxis < Axis diff --git a/lib/axlsx/drawing/series.rb b/lib/axlsx/drawing/series.rb index 86b85f4c..17c5d24e 100644 --- a/lib/axlsx/drawing/series.rb +++ b/lib/axlsx/drawing/series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A Series defines the common series attributes and is the super class for all concrete series types. # @note The recommended way to manage series is to use Chart#add_series diff --git a/lib/axlsx/drawing/series_title.rb b/lib/axlsx/drawing/series_title.rb index f18be178..124e30a0 100644 --- a/lib/axlsx/drawing/series_title.rb +++ b/lib/axlsx/drawing/series_title.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A series title is a Title with a slightly different serialization than chart titles. class SeriesTitle < Title diff --git a/lib/axlsx/drawing/str_data.rb b/lib/axlsx/drawing/str_data.rb index 5ea8a892..ab1c25ad 100644 --- a/lib/axlsx/drawing/str_data.rb +++ b/lib/axlsx/drawing/str_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This specifies the last string data used for a chart. (e.g. strLit and strCache) # This class is extended for NumData to include the formatCode attribute required for numLit and numCache diff --git a/lib/axlsx/drawing/str_val.rb b/lib/axlsx/drawing/str_val.rb index e5c851ee..f6d36d41 100644 --- a/lib/axlsx/drawing/str_val.rb +++ b/lib/axlsx/drawing/str_val.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class specifies data for a particular data point. class StrVal diff --git a/lib/axlsx/drawing/title.rb b/lib/axlsx/drawing/title.rb index 92294a06..9fd90d29 100644 --- a/lib/axlsx/drawing/title.rb +++ b/lib/axlsx/drawing/title.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A Title stores information about the title of a chart class Title diff --git a/lib/axlsx/drawing/two_cell_anchor.rb b/lib/axlsx/drawing/two_cell_anchor.rb index 7b77de13..7b01ae13 100644 --- a/lib/axlsx/drawing/two_cell_anchor.rb +++ b/lib/axlsx/drawing/two_cell_anchor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class details the anchor points for drawings. # @note The recommended way to manage drawings and charts is Worksheet#add_chart. Anchors are specified by the :start_at and :end_at options to that method. diff --git a/lib/axlsx/drawing/val_axis.rb b/lib/axlsx/drawing/val_axis.rb index 8cd131cc..8ebdcc92 100644 --- a/lib/axlsx/drawing/val_axis.rb +++ b/lib/axlsx/drawing/val_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # the ValAxis class defines a chart value axis. class ValAxis < Axis diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index ff26deb9..a414b46a 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # 3D attributes for a chart. class View3D diff --git a/lib/axlsx/drawing/vml_drawing.rb b/lib/axlsx/drawing/vml_drawing.rb index 4e9c5b0d..0805421e 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # a vml drawing used for comments in excel. class VmlDrawing diff --git a/lib/axlsx/drawing/vml_shape.rb b/lib/axlsx/drawing/vml_shape.rb index fd335d95..4db280f3 100644 --- a/lib/axlsx/drawing/vml_shape.rb +++ b/lib/axlsx/drawing/vml_shape.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A VmlShape is used to position and render a comment. class VmlShape diff --git a/lib/axlsx/package.rb b/lib/axlsx/package.rb index f22ad2ac..dd0432cd 100644 --- a/lib/axlsx/package.rb +++ b/lib/axlsx/package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Package is responsible for managing all the bits and peices that Open Office XML requires to make a valid # xlsx document including validation and serialization. diff --git a/lib/axlsx/rels/relationship.rb b/lib/axlsx/rels/relationship.rb index aff9fa55..3f296b82 100644 --- a/lib/axlsx/rels/relationship.rb +++ b/lib/axlsx/rels/relationship.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A relationship defines a reference between package parts. # @note Packages automatically manage relationships. diff --git a/lib/axlsx/rels/relationships.rb b/lib/axlsx/rels/relationships.rb index 71c4bf1e..64126ed7 100644 --- a/lib/axlsx/rels/relationships.rb +++ b/lib/axlsx/rels/relationships.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx require 'axlsx/rels/relationship.rb' diff --git a/lib/axlsx/stylesheet/border.rb b/lib/axlsx/stylesheet/border.rb index af564b22..ed172ba8 100644 --- a/lib/axlsx/stylesheet/border.rb +++ b/lib/axlsx/stylesheet/border.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class details a border used in Office Open XML spreadsheet styles. class Border diff --git a/lib/axlsx/stylesheet/border_pr.rb b/lib/axlsx/stylesheet/border_pr.rb index 3f1054f2..8c1d2ede 100644 --- a/lib/axlsx/stylesheet/border_pr.rb +++ b/lib/axlsx/stylesheet/border_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A border part. class BorderPr diff --git a/lib/axlsx/stylesheet/cell_alignment.rb b/lib/axlsx/stylesheet/cell_alignment.rb index 906c7870..c5eb383e 100644 --- a/lib/axlsx/stylesheet/cell_alignment.rb +++ b/lib/axlsx/stylesheet/cell_alignment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # CellAlignment stores information about the cell alignment of a style Xf Object. # @note Using Styles#add_style is the recommended way to manage cell alignment. diff --git a/lib/axlsx/stylesheet/cell_protection.rb b/lib/axlsx/stylesheet/cell_protection.rb index f040f207..3c75d509 100644 --- a/lib/axlsx/stylesheet/cell_protection.rb +++ b/lib/axlsx/stylesheet/cell_protection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # CellProtection stores information about locking or hiding cells in spreadsheet. # @note Using Styles#add_style is the recommended way to manage cell protection. diff --git a/lib/axlsx/stylesheet/cell_style.rb b/lib/axlsx/stylesheet/cell_style.rb index 20f88133..3d198afd 100644 --- a/lib/axlsx/stylesheet/cell_style.rb +++ b/lib/axlsx/stylesheet/cell_style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # CellStyle defines named styles that reference defined formatting records and can be used in your worksheet. # @note Using Styles#add_style is the recommended way to manage cell styling. diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index d6d204bf..a1743cb2 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The color class represents a color used for borders, fills an fonts class Color diff --git a/lib/axlsx/stylesheet/dxf.rb b/lib/axlsx/stylesheet/dxf.rb index 516894df..0bbae6ca 100644 --- a/lib/axlsx/stylesheet/dxf.rb +++ b/lib/axlsx/stylesheet/dxf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Dxf class defines an incremental formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style # @see Styles#add_style diff --git a/lib/axlsx/stylesheet/fill.rb b/lib/axlsx/stylesheet/fill.rb index aeff4867..e6561e26 100644 --- a/lib/axlsx/stylesheet/fill.rb +++ b/lib/axlsx/stylesheet/fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Fill is a formatting object that manages the background color, and pattern for cells. # @note The recommended way to manage styles in your workbook is to use Styles#add_style. diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb index 0f432d58..920f6f97 100644 --- a/lib/axlsx/stylesheet/font.rb +++ b/lib/axlsx/stylesheet/font.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Font class details a font instance for use in styling cells. # @note The recommended way to manage fonts, and other styles is Styles#add_style diff --git a/lib/axlsx/stylesheet/gradient_fill.rb b/lib/axlsx/stylesheet/gradient_fill.rb index f90a15d6..1c58c12a 100644 --- a/lib/axlsx/stylesheet/gradient_fill.rb +++ b/lib/axlsx/stylesheet/gradient_fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A GradientFill defines the color and positioning for gradiant cell fill. # @see Open Office XML Part 1 §18.8.24 diff --git a/lib/axlsx/stylesheet/gradient_stop.rb b/lib/axlsx/stylesheet/gradient_stop.rb index 2325ee66..fd53a41a 100644 --- a/lib/axlsx/stylesheet/gradient_stop.rb +++ b/lib/axlsx/stylesheet/gradient_stop.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The GradientStop object represents a color point in a gradient. # @see Open Office XML Part 1 §18.8.24 diff --git a/lib/axlsx/stylesheet/num_fmt.rb b/lib/axlsx/stylesheet/num_fmt.rb index 388f0d59..1864fcf2 100644 --- a/lib/axlsx/stylesheet/num_fmt.rb +++ b/lib/axlsx/stylesheet/num_fmt.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A NumFmt object defines an identifier and formatting code for data in cells. # @note The recommended way to manage styles is Styles#add_style diff --git a/lib/axlsx/stylesheet/pattern_fill.rb b/lib/axlsx/stylesheet/pattern_fill.rb index 3ebd4ff6..5f89955d 100644 --- a/lib/axlsx/stylesheet/pattern_fill.rb +++ b/lib/axlsx/stylesheet/pattern_fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A PatternFill is the pattern and solid fill styling for a cell. # @note The recommended way to manage styles is with Styles#add_style diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 3b462d37..3cbe8f75 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx require 'axlsx/stylesheet/border.rb' require 'axlsx/stylesheet/border_pr.rb' diff --git a/lib/axlsx/stylesheet/table_style.rb b/lib/axlsx/stylesheet/table_style.rb index f656ce3d..24c441ce 100644 --- a/lib/axlsx/stylesheet/table_style.rb +++ b/lib/axlsx/stylesheet/table_style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A single table style definition and is a collection for tableStyleElements # @note Table are not supported in this version and only the defaults required for a valid workbook are created. diff --git a/lib/axlsx/stylesheet/table_style_element.rb b/lib/axlsx/stylesheet/table_style_element.rb index 845d6bac..c36ab838 100644 --- a/lib/axlsx/stylesheet/table_style_element.rb +++ b/lib/axlsx/stylesheet/table_style_element.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # an element of style that belongs to a table style. # @note tables and table styles are not supported in this version. This class exists in preparation for that support. diff --git a/lib/axlsx/stylesheet/table_styles.rb b/lib/axlsx/stylesheet/table_styles.rb index a55180a5..16cc7320 100644 --- a/lib/axlsx/stylesheet/table_styles.rb +++ b/lib/axlsx/stylesheet/table_styles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # TableStyles represents a collection of style definitions for table styles and pivot table styles. # @note Support for custom table styles does not exist in this version. Many of the classes required are defined in preparation for future release. Please do not attempt to add custom table styles. diff --git a/lib/axlsx/stylesheet/xf.rb b/lib/axlsx/stylesheet/xf.rb index e58608f7..d42880e0 100644 --- a/lib/axlsx/stylesheet/xf.rb +++ b/lib/axlsx/stylesheet/xf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Xf class defines a formatting record for use in Styles. The recommended way to manage styles for your workbook is with Styles#add_style # @see Styles#add_style diff --git a/lib/axlsx/util/accessors.rb b/lib/axlsx/util/accessors.rb index 8f481e37..d653e32f 100644 --- a/lib/axlsx/util/accessors.rb +++ b/lib/axlsx/util/accessors.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This module defines some of the more common validating attribute # accessors that we use in Axlsx @@ -43,7 +45,7 @@ module Axlsx end # Template for defining validated write accessors - SETTER = "def %s=(value) Axlsx::%s(value); @%s = value; end".freeze + SETTER = "def %s=(value) Axlsx::%s(value); @%s = value; end" # Creates the reader and writer access methods # @param [Array] symbols The names of the attributes to create diff --git a/lib/axlsx/util/constants.rb b/lib/axlsx/util/constants.rb index 55e2b58f..4697bb3a 100644 --- a/lib/axlsx/util/constants.rb +++ b/lib/axlsx/util/constants.rb @@ -1,240 +1,242 @@ +# frozen_string_literal: true + module Axlsx # XML Encoding - ENCODING = "UTF-8".freeze + ENCODING = "UTF-8" # spreadsheetML namespace - XML_NS = "http://schemas.openxmlformats.org/spreadsheetml/2006/main".freeze + XML_NS = "http://schemas.openxmlformats.org/spreadsheetml/2006/main" # content-types namespace - XML_NS_T = "http://schemas.openxmlformats.org/package/2006/content-types".freeze + XML_NS_T = "http://schemas.openxmlformats.org/package/2006/content-types" # extended-properties namespace - APP_NS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties".freeze + APP_NS = "http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" # doc props namespace - APP_NS_VT = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes".freeze + APP_NS_VT = "http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes" # core properties namespace - CORE_NS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties".freeze + CORE_NS = "http://schemas.openxmlformats.org/package/2006/metadata/core-properties" # dc elements (core) namespace - CORE_NS_DC = "http://purl.org/dc/elements/1.1/".freeze + CORE_NS_DC = "http://purl.org/dc/elements/1.1/" # dcmit (core) namespcace - CORE_NS_DCMIT = "http://purl.org/dc/dcmitype/".freeze + CORE_NS_DCMIT = "http://purl.org/dc/dcmitype/" # dc terms namespace - CORE_NS_DCT = "http://purl.org/dc/terms/".freeze + CORE_NS_DCT = "http://purl.org/dc/terms/" # xml schema namespace - CORE_NS_XSI = "http://www.w3.org/2001/XMLSchema-instance".freeze + CORE_NS_XSI = "http://www.w3.org/2001/XMLSchema-instance" # Digital signature namespace - DIGITAL_SIGNATURE_NS = "http://schemas.openxmlformats.org/package/2006/digital-signature".freeze + DIGITAL_SIGNATURE_NS = "http://schemas.openxmlformats.org/package/2006/digital-signature" # spreadsheet drawing namespace - XML_NS_XDR = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing".freeze + XML_NS_XDR = "http://schemas.openxmlformats.org/drawingml/2006/spreadsheetDrawing" # drawing namespace - XML_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main".freeze + XML_NS_A = "http://schemas.openxmlformats.org/drawingml/2006/main" # chart namespace - XML_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart".freeze + XML_NS_C = "http://schemas.openxmlformats.org/drawingml/2006/chart" # relationships namespace - XML_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships".freeze + XML_NS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships" # relationships name space - RELS_R = "http://schemas.openxmlformats.org/package/2006/relationships".freeze + RELS_R = "http://schemas.openxmlformats.org/package/2006/relationships" # table rels namespace - TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table".freeze + TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/table" # pivot table rels namespace - PIVOT_TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable".freeze + PIVOT_TABLE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable" # pivot table cache definition namespace - PIVOT_TABLE_CACHE_DEFINITION_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition".freeze + PIVOT_TABLE_CACHE_DEFINITION_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition" # workbook rels namespace - WORKBOOK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument".freeze + WORKBOOK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" # worksheet rels namespace - WORKSHEET_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet".freeze + WORKSHEET_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" # app rels namespace - APP_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties".freeze + APP_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties" # core rels namespace - CORE_R = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties".freeze + CORE_R = "http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" # digital signature rels namespace - DIGITAL_SIGNATURE_R = "http://schemas.openxmlformats.org/package/2006/relationships/digital- signature/signature".freeze + DIGITAL_SIGNATURE_R = "http://schemas.openxmlformats.org/package/2006/relationships/digital- signature/signature" # styles rels namespace - STYLES_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles".freeze + STYLES_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" # shared strings namespace - SHARED_STRINGS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings".freeze + SHARED_STRINGS_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" # drawing rels namespace - DRAWING_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing".freeze + DRAWING_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing" # chart rels namespace - CHART_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart".freeze + CHART_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart" # image rels namespace - IMAGE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image".freeze + IMAGE_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/image" # hyperlink rels namespace - HYPERLINK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink".freeze + HYPERLINK_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink" # comment rels namespace - COMMENT_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments".freeze + COMMENT_R = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/comments" # comment relation for nil target - COMMENT_R_NULL = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments".freeze + COMMENT_R_NULL = "http://purl.oclc.org/ooxml/officeDocument/relationships/comments" # vml drawing relation namespace VML_DRAWING_R = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing' # VML Drawing content type - VML_DRAWING_CT = "application/vnd.openxmlformats-officedocument.vmlDrawing".freeze + VML_DRAWING_CT = "application/vnd.openxmlformats-officedocument.vmlDrawing" # table content type - TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml".freeze + TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml" # pivot table content type - PIVOT_TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml".freeze + PIVOT_TABLE_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml" # pivot table cache definition content type - PIVOT_TABLE_CACHE_DEFINITION_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml".freeze + PIVOT_TABLE_CACHE_DEFINITION_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml" # workbook content type - WORKBOOK_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml".freeze + WORKBOOK_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet.main+xml" # app content type - APP_CT = "application/vnd.openxmlformats-officedocument.extended-properties+xml".freeze + APP_CT = "application/vnd.openxmlformats-officedocument.extended-properties+xml" # rels content type - RELS_CT = "application/vnd.openxmlformats-package.relationships+xml".freeze + RELS_CT = "application/vnd.openxmlformats-package.relationships+xml" # styles content type - STYLES_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml".freeze + STYLES_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml" # xml content type - XML_CT = "application/xml".freeze + XML_CT = "application/xml" # worksheet content type - WORKSHEET_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml".freeze + WORKSHEET_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml" # shared strings content type - SHARED_STRINGS_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml".freeze + SHARED_STRINGS_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml" # core content type - CORE_CT = "application/vnd.openxmlformats-package.core-properties+xml".freeze + CORE_CT = "application/vnd.openxmlformats-package.core-properties+xml" # digital signature xml content type - DIGITAL_SIGNATURE_XML_CT = "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml".freeze + DIGITAL_SIGNATURE_XML_CT = "application/vnd.openxmlformats-package.digital-signature-xmlsignature+xml" # digital signature origin content type - DIGITAL_SIGNATURE_ORIGIN_CT = "application/vnd.openxmlformats-package.digital-signature-origin".freeze + DIGITAL_SIGNATURE_ORIGIN_CT = "application/vnd.openxmlformats-package.digital-signature-origin" # digital signature certificate content type - DIGITAL_SIGNATURE_CERTIFICATE_CT = "application/vnd.openxmlformats-package.digital-signature-certificate".freeze + DIGITAL_SIGNATURE_CERTIFICATE_CT = "application/vnd.openxmlformats-package.digital-signature-certificate" # chart content type - CHART_CT = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml".freeze + CHART_CT = "application/vnd.openxmlformats-officedocument.drawingml.chart+xml" # comments content type - COMMENT_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml".freeze + COMMENT_CT = "application/vnd.openxmlformats-officedocument.spreadsheetml.comments+xml" # jpeg content type - JPEG_CT = "image/jpeg".freeze + JPEG_CT = "image/jpeg" # gif content type - GIF_CT = "image/gif".freeze + GIF_CT = "image/gif" # png content type - PNG_CT = "image/png".freeze + PNG_CT = "image/png" # drawing content type - DRAWING_CT = "application/vnd.openxmlformats-officedocument.drawing+xml".freeze + DRAWING_CT = "application/vnd.openxmlformats-officedocument.drawing+xml" # xml content type extensions - XML_EX = "xml".freeze + XML_EX = "xml" # jpeg extension - JPEG_EX = "jpeg".freeze + JPEG_EX = "jpeg" # gif extension - GIF_EX = "gif".freeze + GIF_EX = "gif" # png extension - PNG_EX = "png".freeze + PNG_EX = "png" # rels content type extension - RELS_EX = "rels".freeze + RELS_EX = "rels" # workbook part - WORKBOOK_PN = "xl/workbook.xml".freeze + WORKBOOK_PN = "xl/workbook.xml" # styles part - STYLES_PN = "styles.xml".freeze + STYLES_PN = "styles.xml" # shared_strings part - SHARED_STRINGS_PN = "sharedStrings.xml".freeze + SHARED_STRINGS_PN = "sharedStrings.xml" # app part - APP_PN = "docProps/app.xml".freeze + APP_PN = "docProps/app.xml" # core part - CORE_PN = "docProps/core.xml".freeze + CORE_PN = "docProps/core.xml" # content types part - CONTENT_TYPES_PN = "[Content_Types].xml".freeze + CONTENT_TYPES_PN = "[Content_Types].xml" # rels part - RELS_PN = "_rels/.rels".freeze + RELS_PN = "_rels/.rels" # workbook rels part - WORKBOOK_RELS_PN = "xl/_rels/workbook.xml.rels".freeze + WORKBOOK_RELS_PN = "xl/_rels/workbook.xml.rels" # worksheet part - WORKSHEET_PN = "worksheets/sheet%d.xml".freeze + WORKSHEET_PN = "worksheets/sheet%d.xml" # worksheet rels part - WORKSHEET_RELS_PN = "worksheets/_rels/sheet%d.xml.rels".freeze + WORKSHEET_RELS_PN = "worksheets/_rels/sheet%d.xml.rels" # drawing part - DRAWING_PN = "drawings/drawing%d.xml".freeze + DRAWING_PN = "drawings/drawing%d.xml" # drawing rels part - DRAWING_RELS_PN = "drawings/_rels/drawing%d.xml.rels".freeze + DRAWING_RELS_PN = "drawings/_rels/drawing%d.xml.rels" # vml drawing part - VML_DRAWING_PN = "drawings/vmlDrawing%d.vml".freeze + VML_DRAWING_PN = "drawings/vmlDrawing%d.vml" # drawing part - TABLE_PN = "tables/table%d.xml".freeze + TABLE_PN = "tables/table%d.xml" # pivot table parts - PIVOT_TABLE_PN = "pivotTables/pivotTable%d.xml".freeze + PIVOT_TABLE_PN = "pivotTables/pivotTable%d.xml" # pivot table cache definition part name - PIVOT_TABLE_CACHE_DEFINITION_PN = "pivotCache/pivotCacheDefinition%d.xml".freeze + PIVOT_TABLE_CACHE_DEFINITION_PN = "pivotCache/pivotCacheDefinition%d.xml" # pivot table rels parts - PIVOT_TABLE_RELS_PN = "pivotTables/_rels/pivotTable%d.xml.rels".freeze + PIVOT_TABLE_RELS_PN = "pivotTables/_rels/pivotTable%d.xml.rels" # chart part - CHART_PN = "charts/chart%d.xml".freeze + CHART_PN = "charts/chart%d.xml" # chart part - IMAGE_PN = "media/image%d.%s".freeze + IMAGE_PN = "media/image%d.%s" # comment part - COMMENT_PN = "comments%d.xml".freeze + COMMENT_PN = "comments%d.xml" # location of schema files for validation SCHEMA_BASE = (File.dirname(__FILE__) + '/../../schema/').freeze @@ -279,46 +281,46 @@ module Axlsx WORKSHEET_NAME_FORBIDDEN_CHARS = '[]*/\?:'.chars.freeze # error messages RestrictionValidor - ERR_RESTRICTION = "Invalid Data: %s. %s must be one of %s.".freeze + ERR_RESTRICTION = "Invalid Data: %s. %s must be one of %s." # error message DataTypeValidator - ERR_TYPE = "Invalid Data %s for %s. must be %s.".freeze + ERR_TYPE = "Invalid Data %s for %s. must be %s." # error message for RegexValidator - ERR_REGEX = "Invalid Data. %s does not match %s.".freeze + ERR_REGEX = "Invalid Data. %s does not match %s." # error message for RangeValidator - ERR_RANGE = "Invalid Data. %s must be between %s and %s, (inclusive:%s) you gave: %s".freeze + ERR_RANGE = "Invalid Data. %s must be between %s and %s, (inclusive:%s) you gave: %s" # error message for sheets that use explicit empty string name - ERR_SHEET_NAME_EMPTY = "Your worksheet name is empty. Worksheet name can't be empty. Please assign name of your sheet or don't use name option at all.".freeze + ERR_SHEET_NAME_EMPTY = "Your worksheet name is empty. Worksheet name can't be empty. Please assign name of your sheet or don't use name option at all." # error message for sheets that use a name which is longer than 31 bytes - ERR_SHEET_NAME_TOO_LONG = "Your worksheet name '%s' is too long. Worksheet names must be #{WORKSHEET_MAX_NAME_LENGTH} characters (bytes) or less".freeze + ERR_SHEET_NAME_TOO_LONG = "Your worksheet name '%s' is too long. Worksheet names must be #{WORKSHEET_MAX_NAME_LENGTH} characters (bytes) or less" # error message for sheets that use a name which include invalid characters - ERR_SHEET_NAME_CHARACTER_FORBIDDEN = "Your worksheet name '%s' contains a character which is not allowed by MS Excel and will cause repair warnings. Please change the name of your sheet.".freeze + ERR_SHEET_NAME_CHARACTER_FORBIDDEN = "Your worksheet name '%s' contains a character which is not allowed by MS Excel and will cause repair warnings. Please change the name of your sheet." # error message for duplicate sheet names - ERR_DUPLICATE_SHEET_NAME = "There is already a worksheet in this workbook named '%s'. Please use a unique name".freeze + ERR_DUPLICATE_SHEET_NAME = "There is already a worksheet in this workbook named '%s'. Please use a unique name" # error message when user does not provide color and or style options for border in Style#add_sytle - ERR_INVALID_BORDER_OPTIONS = "border hash must include both style and color. e.g. :border => { :color => 'FF000000', :style => :thin }. You provided: %s".freeze + ERR_INVALID_BORDER_OPTIONS = "border hash must include both style and color. e.g. :border => { :color => 'FF000000', :style => :thin }. You provided: %s" # error message for invalid border id reference - ERR_INVALID_BORDER_ID = "The border id you specified (%s) does not exist. Please add a border with Style#add_style before referencing its index.".freeze + ERR_INVALID_BORDER_ID = "The border id you specified (%s) does not exist. Please add a border with Style#add_style before referencing its index." # error message for invalid angles - ERR_ANGLE = "Angles must be a value between -90 and 90. You provided: %s".freeze + ERR_ANGLE = "Angles must be a value between -90 and 90. You provided: %s" # error message for non 'integerish' value - ERR_INTEGERISH = "You value must be, or be castable via to_i, an Integer. You provided %s".freeze + ERR_INTEGERISH = "You value must be, or be castable via to_i, an Integer. You provided %s" # error message for invalid cell reference - ERR_CELL_REFERENCE_INVALID = "Invalid cell definition `%s`".freeze + ERR_CELL_REFERENCE_INVALID = "Invalid cell definition `%s`" # error message for cell reference with last cell missing - ERR_CELL_REFERENCE_MISSING_CELL = "Missing cell `%s` for the specified range `%s`".freeze + ERR_CELL_REFERENCE_MISSING_CELL = "Missing cell `%s` for the specified range `%s`" # Regex to match forbidden control characters # The following will be automatically stripped from worksheets. diff --git a/lib/axlsx/util/mime_type_utils.rb b/lib/axlsx/util/mime_type_utils.rb index f0c3afb1..5dbe0ac5 100644 --- a/lib/axlsx/util/mime_type_utils.rb +++ b/lib/axlsx/util/mime_type_utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open-uri' module Axlsx diff --git a/lib/axlsx/util/options_parser.rb b/lib/axlsx/util/options_parser.rb index 3f2c1937..526a3aed 100644 --- a/lib/axlsx/util/options_parser.rb +++ b/lib/axlsx/util/options_parser.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This module defines a single method for parsing options in class # initializers. diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index eeac6e74..04b33fa5 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This module allows us to define a list of symbols defining which # attributes will be serialized for a class. diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb index 59b25564..1a8bbbec 100644 --- a/lib/axlsx/util/simple_typed_list.rb +++ b/lib/axlsx/util/simple_typed_list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A SimpleTypedList is a type restrictive collection that allows some of the methods from Array and supports basic xml serialization. # @private diff --git a/lib/axlsx/util/storage.rb b/lib/axlsx/util/storage.rb index 4932c93c..2ce0d8f5 100644 --- a/lib/axlsx/util/storage.rb +++ b/lib/axlsx/util/storage.rb @@ -1,9 +1,11 @@ +# frozen_string_literal: true + module Axlsx # The Storage class represents a storage object or stream in a compound file. class Storage # Packing for the Storage when pushing an array of items into a byte stream # Name, name length, type, color, left sibling, right sibling, child, classid, state, created, modified, sector, size - PACKING = "s32 s1 c2 l3 x16 x4 q2 l q".freeze + PACKING = "s32 s1 c2 l3 x16 x4 q2 l q" # storage types TYPES = { diff --git a/lib/axlsx/util/validators.rb b/lib/axlsx/util/validators.rb index b6877a48..952827e9 100644 --- a/lib/axlsx/util/validators.rb +++ b/lib/axlsx/util/validators.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Validate a value against a specific list of allowed values. class RestrictionValidator diff --git a/lib/axlsx/util/zip_command.rb b/lib/axlsx/util/zip_command.rb index 23fd7cf6..00faa942 100644 --- a/lib/axlsx/util/zip_command.rb +++ b/lib/axlsx/util/zip_command.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'open3' require 'shellwords' diff --git a/lib/axlsx/version.rb b/lib/axlsx/version.rb index 3a06c284..4c284c7f 100644 --- a/lib/axlsx/version.rb +++ b/lib/axlsx/version.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The current version VERSION = "3.4.1" diff --git a/lib/axlsx/workbook/defined_name.rb b/lib/axlsx/workbook/defined_name.rb index d3b6e1ef..bcba47ee 100644 --- a/lib/axlsx/workbook/defined_name.rb +++ b/lib/axlsx/workbook/defined_name.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # Sheet1!$1:$1 # diff --git a/lib/axlsx/workbook/defined_names.rb b/lib/axlsx/workbook/defined_names.rb index 017c6d96..9da776fd 100644 --- a/lib/axlsx/workbook/defined_names.rb +++ b/lib/axlsx/workbook/defined_names.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # a simple types list of DefinedName objects class DefinedNames < SimpleTypedList diff --git a/lib/axlsx/workbook/shared_strings_table.rb b/lib/axlsx/workbook/shared_strings_table.rb index b8502206..f0cbf04d 100644 --- a/lib/axlsx/workbook/shared_strings_table.rb +++ b/lib/axlsx/workbook/shared_strings_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Shared String Table class is responsible for managing and serializing common strings in a workbook. # While the ECMA-376 spec allows for both inline and shared strings it seems that at least some applications like iWorks Numbers diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index 71a3c375..bd70a836 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx require 'axlsx/workbook/worksheet/sheet_calc_pr.rb' require 'axlsx/workbook/worksheet/auto_filter/auto_filter.rb' diff --git a/lib/axlsx/workbook/workbook_view.rb b/lib/axlsx/workbook/workbook_view.rb index 27a46dcc..e992a65e 100644 --- a/lib/axlsx/workbook/workbook_view.rb +++ b/lib/axlsx/workbook/workbook_view.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + # # # diff --git a/lib/axlsx/workbook/workbook_views.rb b/lib/axlsx/workbook/workbook_views.rb index 41010d0d..569533f8 100644 --- a/lib/axlsx/workbook/workbook_views.rb +++ b/lib/axlsx/workbook/workbook_views.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # a simple types list of BookView objects class WorkbookViews < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb index bf3426b6..156d4ae8 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'axlsx/workbook/worksheet/auto_filter/filter_column.rb' require 'axlsx/workbook/worksheet/auto_filter/filters.rb' diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb index 32a9df26..92884e97 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The filterColumn collection identifies a particular column in the AutoFilter # range and specifies filter information that has been applied to this column. diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb index 90a5ff48..77cf7b17 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # When multiple values are chosen to filter by, or when a group of date values are chosen to filter by, # this object groups those criteria together. diff --git a/lib/axlsx/workbook/worksheet/border_creator.rb b/lib/axlsx/workbook/worksheet/border_creator.rb index 0e2fa87b..6321916f 100644 --- a/lib/axlsx/workbook/worksheet/border_creator.rb +++ b/lib/axlsx/workbook/worksheet/border_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx class BorderCreator def initialize(worksheet:, cells:, edges: nil, style: nil, color: nil) diff --git a/lib/axlsx/workbook/worksheet/break.rb b/lib/axlsx/workbook/worksheet/break.rb index f8cc452e..c40503be 100644 --- a/lib/axlsx/workbook/worksheet/break.rb +++ b/lib/axlsx/workbook/worksheet/break.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Break class stores the details for row and column page breaks. # @see RowBreaks, ColBreaks diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 13c762ef..930356e5 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'cgi' module Axlsx # A cell in a worksheet. @@ -72,13 +74,13 @@ module Axlsx # Leading characters that indicate a formula. # See: https://owasp.org/www-community/attacks/CSV_Injection - FORMULA_PREFIXES = ['='.freeze].freeze + FORMULA_PREFIXES = ['='].freeze # Leading characters that indicate an array formula. - ARRAY_FORMULA_PREFIXES = ['{='.freeze].freeze + ARRAY_FORMULA_PREFIXES = ['{='].freeze # Trailing character that indicates an array formula. - ARRAY_FORMULA_SUFFIX = '}'.freeze + ARRAY_FORMULA_SUFFIX = '}' # The index of the cellXfs item to be applied to this cell. # @return [Integer] diff --git a/lib/axlsx/workbook/worksheet/cell_serializer.rb b/lib/axlsx/workbook/worksheet/cell_serializer.rb index 94a1f93a..3c8f87dc 100644 --- a/lib/axlsx/workbook/worksheet/cell_serializer.rb +++ b/lib/axlsx/workbook/worksheet/cell_serializer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Cell Serializer class contains the logic for serializing cells based on their type. class CellSerializer diff --git a/lib/axlsx/workbook/worksheet/cfvo.rb b/lib/axlsx/workbook/worksheet/cfvo.rb index faa5d88a..7feb933d 100644 --- a/lib/axlsx/workbook/worksheet/cfvo.rb +++ b/lib/axlsx/workbook/worksheet/cfvo.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional Format Value Object # Describes the values of the interpolation points in a gradient scale. This object is used by ColorScale, DataBar and IconSet classes diff --git a/lib/axlsx/workbook/worksheet/cfvos.rb b/lib/axlsx/workbook/worksheet/cfvos.rb index c5fa80f3..5115577a 100644 --- a/lib/axlsx/workbook/worksheet/cfvos.rb +++ b/lib/axlsx/workbook/worksheet/cfvos.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A collection of Cfvo objects that initializes with the required # first two items diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb index 37c38365..10d421e8 100644 --- a/lib/axlsx/workbook/worksheet/col.rb +++ b/lib/axlsx/workbook/worksheet/col.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Col class defines column attributes for columns in sheets. class Col diff --git a/lib/axlsx/workbook/worksheet/col_breaks.rb b/lib/axlsx/workbook/worksheet/col_breaks.rb index 78ccc565..4a7b7f94 100644 --- a/lib/axlsx/workbook/worksheet/col_breaks.rb +++ b/lib/axlsx/workbook/worksheet/col_breaks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A collection of Brake objects. # Please do not use this class directly. Instead use diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb index 75877915..222e2f4d 100644 --- a/lib/axlsx/workbook/worksheet/color_scale.rb +++ b/lib/axlsx/workbook/worksheet/color_scale.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional Format Rule color scale object # Describes a gradated color scale in this conditional formatting rule. diff --git a/lib/axlsx/workbook/worksheet/cols.rb b/lib/axlsx/workbook/worksheet/cols.rb index 27b1f508..76e0fbf7 100644 --- a/lib/axlsx/workbook/worksheet/cols.rb +++ b/lib/axlsx/workbook/worksheet/cols.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The cols class manages the col object used to manage column widths. # This is where the magic happens with autowidth diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb index aa35feef..b0fd3e3b 100644 --- a/lib/axlsx/workbook/worksheet/comment.rb +++ b/lib/axlsx/workbook/worksheet/comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A comment is the text data for a comment class Comment diff --git a/lib/axlsx/workbook/worksheet/comments.rb b/lib/axlsx/workbook/worksheet/comments.rb index f6f3071b..020b29f5 100644 --- a/lib/axlsx/workbook/worksheet/comments.rb +++ b/lib/axlsx/workbook/worksheet/comments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Comments is a collection of Comment objects for a worksheet class Comments < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting.rb b/lib/axlsx/workbook/worksheet/conditional_formatting.rb index 419e6684..d6293ca8 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional formatting allows styling of ranges based on functions # diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb index 4f84080b..d3693d7e 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional formatting rules specify formulas whose evaluations # format cells diff --git a/lib/axlsx/workbook/worksheet/conditional_formattings.rb b/lib/axlsx/workbook/worksheet/conditional_formattings.rb index 8b510ab9..ba8c02a3 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formattings.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formattings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple, self serializing class for storing conditional formattings class ConditionalFormattings < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb index c9f99dcc..0e505637 100644 --- a/lib/axlsx/workbook/worksheet/data_bar.rb +++ b/lib/axlsx/workbook/worksheet/data_bar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional Format Rule data bar object # Describes a data bar conditional formatting rule. diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb index 741dee86..82868071 100644 --- a/lib/axlsx/workbook/worksheet/data_validation.rb +++ b/lib/axlsx/workbook/worksheet/data_validation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Data validation allows the validation of cell data # diff --git a/lib/axlsx/workbook/worksheet/data_validations.rb b/lib/axlsx/workbook/worksheet/data_validations.rb index 9c07da42..dd5f11b9 100644 --- a/lib/axlsx/workbook/worksheet/data_validations.rb +++ b/lib/axlsx/workbook/worksheet/data_validations.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple, self serializing class for storing conditional formattings class DataValidations < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/date_time_converter.rb b/lib/axlsx/workbook/worksheet/date_time_converter.rb index ff85c64f..ffa2831a 100644 --- a/lib/axlsx/workbook/worksheet/date_time_converter.rb +++ b/lib/axlsx/workbook/worksheet/date_time_converter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "date" module Axlsx diff --git a/lib/axlsx/workbook/worksheet/dimension.rb b/lib/axlsx/workbook/worksheet/dimension.rb index 013097c8..356c0396 100644 --- a/lib/axlsx/workbook/worksheet/dimension.rb +++ b/lib/axlsx/workbook/worksheet/dimension.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class manages the dimensions for a worksheet. # While this node is optional in the specification some readers like diff --git a/lib/axlsx/workbook/worksheet/header_footer.rb b/lib/axlsx/workbook/worksheet/header_footer.rb index 5ad00565..b80f4eeb 100644 --- a/lib/axlsx/workbook/worksheet/header_footer.rb +++ b/lib/axlsx/workbook/worksheet/header_footer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Header/Footer options for printing a worksheet. All settings are optional. # diff --git a/lib/axlsx/workbook/worksheet/icon_set.rb b/lib/axlsx/workbook/worksheet/icon_set.rb index 4e7064e9..0179cc5f 100644 --- a/lib/axlsx/workbook/worksheet/icon_set.rb +++ b/lib/axlsx/workbook/worksheet/icon_set.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Conditional Format Rule icon sets # Describes an icon set conditional formatting rule. diff --git a/lib/axlsx/workbook/worksheet/merged_cells.rb b/lib/axlsx/workbook/worksheet/merged_cells.rb index f54fd252..5ecb1a4e 100644 --- a/lib/axlsx/workbook/worksheet/merged_cells.rb +++ b/lib/axlsx/workbook/worksheet/merged_cells.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple list of merged cells class MergedCells < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/outline_pr.rb b/lib/axlsx/workbook/worksheet/outline_pr.rb index 5db0d825..fc301a76 100644 --- a/lib/axlsx/workbook/worksheet/outline_pr.rb +++ b/lib/axlsx/workbook/worksheet/outline_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The OutlinePr class manages serialization of a worksheet's outlinePr element, which provides various # options to control outlining. diff --git a/lib/axlsx/workbook/worksheet/page_margins.rb b/lib/axlsx/workbook/worksheet/page_margins.rb index a0967817..1e4a34e0 100644 --- a/lib/axlsx/workbook/worksheet/page_margins.rb +++ b/lib/axlsx/workbook/worksheet/page_margins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # PageMargins specify the margins when printing a worksheet. # diff --git a/lib/axlsx/workbook/worksheet/page_set_up_pr.rb b/lib/axlsx/workbook/worksheet/page_set_up_pr.rb index 819c5fa7..d1c62c9e 100644 --- a/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +++ b/lib/axlsx/workbook/worksheet/page_set_up_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Page setup properties of the worksheet # This class name is not a typo, its spec. diff --git a/lib/axlsx/workbook/worksheet/page_setup.rb b/lib/axlsx/workbook/worksheet/page_setup.rb index c10e28ce..fa49142d 100644 --- a/lib/axlsx/workbook/worksheet/page_setup.rb +++ b/lib/axlsx/workbook/worksheet/page_setup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Page setup settings for printing a worksheet. All settings are optional. # diff --git a/lib/axlsx/workbook/worksheet/pane.rb b/lib/axlsx/workbook/worksheet/pane.rb index e752ab22..f88b732c 100644 --- a/lib/axlsx/workbook/worksheet/pane.rb +++ b/lib/axlsx/workbook/worksheet/pane.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Pane options for a worksheet. # diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb index ff131dfb..8c6cb83e 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Table # @note Worksheet#add_pivot_table is the recommended way to create tables for your worksheets. diff --git a/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb b/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb index 8813c84b..136e756e 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Table # @note Worksheet#add_pivot_table is the recommended way to create tables for your worksheets. diff --git a/lib/axlsx/workbook/worksheet/pivot_tables.rb b/lib/axlsx/workbook/worksheet/pivot_tables.rb index c27162c3..7ba09b09 100644 --- a/lib/axlsx/workbook/worksheet/pivot_tables.rb +++ b/lib/axlsx/workbook/worksheet/pivot_tables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple, self serializing class for storing pivot tables class PivotTables < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/print_options.rb b/lib/axlsx/workbook/worksheet/print_options.rb index 7ba52861..e2c73bfa 100644 --- a/lib/axlsx/workbook/worksheet/print_options.rb +++ b/lib/axlsx/workbook/worksheet/print_options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Options for printing a worksheet. All options are boolean and false by default. # diff --git a/lib/axlsx/workbook/worksheet/protected_range.rb b/lib/axlsx/workbook/worksheet/protected_range.rb index e4eb83e5..ac7d96f1 100644 --- a/lib/axlsx/workbook/worksheet/protected_range.rb +++ b/lib/axlsx/workbook/worksheet/protected_range.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The Protected Range class represents a set of cells in the worksheet # @note the recommended way to manage protected ranges with via Worksheet#protect_range diff --git a/lib/axlsx/workbook/worksheet/protected_ranges.rb b/lib/axlsx/workbook/worksheet/protected_ranges.rb index 75b3aee5..1d214d3b 100644 --- a/lib/axlsx/workbook/worksheet/protected_ranges.rb +++ b/lib/axlsx/workbook/worksheet/protected_ranges.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A self serializing collection of ranges that should be protected in # the worksheet diff --git a/lib/axlsx/workbook/worksheet/rich_text.rb b/lib/axlsx/workbook/worksheet/rich_text.rb index 4b643470..13febb0a 100644 --- a/lib/axlsx/workbook/worksheet/rich_text.rb +++ b/lib/axlsx/workbook/worksheet/rich_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple, self serializing class for storing TextRuns class RichText < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/rich_text_run.rb b/lib/axlsx/workbook/worksheet/rich_text_run.rb index f9d2932f..9b61806c 100644 --- a/lib/axlsx/workbook/worksheet/rich_text_run.rb +++ b/lib/axlsx/workbook/worksheet/rich_text_run.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The RichTextRun class creates and self serializing text run. class RichTextRun diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 119cd10b..50326aba 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A Row is a single row in a worksheet. # @note The recommended way to manage rows and cells is to use Worksheet#add_row diff --git a/lib/axlsx/workbook/worksheet/row_breaks.rb b/lib/axlsx/workbook/worksheet/row_breaks.rb index 2da31719..6d1b17c8 100644 --- a/lib/axlsx/workbook/worksheet/row_breaks.rb +++ b/lib/axlsx/workbook/worksheet/row_breaks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A collection of break objects that define row breaks (page breaks) for printing and preview diff --git a/lib/axlsx/workbook/worksheet/selection.rb b/lib/axlsx/workbook/worksheet/selection.rb index 82538fce..377c0b25 100644 --- a/lib/axlsx/workbook/worksheet/selection.rb +++ b/lib/axlsx/workbook/worksheet/selection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Selection options for worksheet panes. # diff --git a/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb b/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb index d692d461..bb78f92e 100644 --- a/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # the SheetCalcPr object for the worksheet # This object contains calculation properties for the worksheet. diff --git a/lib/axlsx/workbook/worksheet/sheet_data.rb b/lib/axlsx/workbook/worksheet/sheet_data.rb index f6a27b0e..1531d5bf 100644 --- a/lib/axlsx/workbook/worksheet/sheet_data.rb +++ b/lib/axlsx/workbook/worksheet/sheet_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This class manages the serialization of rows for worksheets class SheetData diff --git a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb index ad4e4fab..e9ef8f33 100644 --- a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Sheet formatting properties # diff --git a/lib/axlsx/workbook/worksheet/sheet_pr.rb b/lib/axlsx/workbook/worksheet/sheet_pr.rb index 4fccf662..3bbb88d4 100644 --- a/lib/axlsx/workbook/worksheet/sheet_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The SheetPr class manages serialization of a worksheet's sheetPr element. class SheetPr diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb index 42d74695..1b9aff14 100644 --- a/lib/axlsx/workbook/worksheet/sheet_protection.rb +++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The SheetProtection object manages worksheet protection options per sheet. class SheetProtection diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb index dc41d01a..38b9593a 100644 --- a/lib/axlsx/workbook/worksheet/sheet_view.rb +++ b/lib/axlsx/workbook/worksheet/sheet_view.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # View options for a worksheet. # diff --git a/lib/axlsx/workbook/worksheet/table.rb b/lib/axlsx/workbook/worksheet/table.rb index 4f446491..70f27575 100644 --- a/lib/axlsx/workbook/worksheet/table.rb +++ b/lib/axlsx/workbook/worksheet/table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # Table # @note Worksheet#add_table is the recommended way to create tables for your worksheets. diff --git a/lib/axlsx/workbook/worksheet/table_style_info.rb b/lib/axlsx/workbook/worksheet/table_style_info.rb index 537b2eea..1af61d9f 100644 --- a/lib/axlsx/workbook/worksheet/table_style_info.rb +++ b/lib/axlsx/workbook/worksheet/table_style_info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # The table style info class manages style attributes for defined tables in # a worksheet diff --git a/lib/axlsx/workbook/worksheet/tables.rb b/lib/axlsx/workbook/worksheet/tables.rb index 20ba4789..41d3c658 100644 --- a/lib/axlsx/workbook/worksheet/tables.rb +++ b/lib/axlsx/workbook/worksheet/tables.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A simple, self serializing class for storing tables class Tables < SimpleTypedList diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 1fb55ff2..1e8bf2e3 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require_relative "border_creator" module Axlsx diff --git a/lib/axlsx/workbook/worksheet/worksheet_comments.rb b/lib/axlsx/workbook/worksheet/worksheet_comments.rb index 29ea6fc8..0f0355e7 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_comments.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_comments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A wraper class for comments that defines its on worksheet # serailization diff --git a/lib/axlsx/workbook/worksheet/worksheet_drawing.rb b/lib/axlsx/workbook/worksheet/worksheet_drawing.rb index c2819393..ce7edc7c 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_drawing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # This is a utility class for serialing the drawing node in a # worksheet. Drawing objects have their own serialization that exports diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb index 60615f1c..f375582b 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A worksheet hyperlink object. Note that this is not the same as a drawing hyperlink object. class WorksheetHyperlink diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb index 44c6125a..a5b1a512 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module Axlsx # A collection of hyperlink objects for a worksheet class WorksheetHyperlinks < SimpleTypedList diff --git a/lib/caxlsx.rb b/lib/caxlsx.rb index 047ed28f..e97cd68c 100644 --- a/lib/caxlsx.rb +++ b/lib/caxlsx.rb @@ -1 +1,3 @@ +# frozen_string_literal: true + require 'axlsx.rb' diff --git a/test/benchmark.rb b/test/benchmark.rb index 9e651596..38dcc8fc 100755 --- a/test/benchmark.rb +++ b/test/benchmark.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby -s +# frozen_string_literal: true $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" require 'axlsx' diff --git a/test/content_type/tc_content_type.rb b/test/content_type/tc_content_type.rb index e94f311e..a3c6603f 100644 --- a/test/content_type/tc_content_type.rb +++ b/test/content_type/tc_content_type.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestContentType < Test::Unit::TestCase diff --git a/test/content_type/tc_default.rb b/test/content_type/tc_default.rb index e3d8d75e..89125bf1 100644 --- a/test/content_type/tc_default.rb +++ b/test/content_type/tc_default.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDefault < Test::Unit::TestCase diff --git a/test/content_type/tc_override.rb b/test/content_type/tc_override.rb index ad0699b5..73a13410 100644 --- a/test/content_type/tc_override.rb +++ b/test/content_type/tc_override.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestOverride < Test::Unit::TestCase diff --git a/test/doc_props/tc_app.rb b/test/doc_props/tc_app.rb index fbbe0b67..d96723db 100644 --- a/test/doc_props/tc_app.rb +++ b/test/doc_props/tc_app.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestApp < Test::Unit::TestCase diff --git a/test/doc_props/tc_core.rb b/test/doc_props/tc_core.rb index 6d0ce604..9714a6eb 100644 --- a/test/doc_props/tc_core.rb +++ b/test/doc_props/tc_core.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCore < Test::Unit::TestCase diff --git a/test/drawing/tc_area_chart.rb b/test/drawing/tc_area_chart.rb index 14449349..5829149a 100644 --- a/test/drawing/tc_area_chart.rb +++ b/test/drawing/tc_area_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAreaChart < Test::Unit::TestCase diff --git a/test/drawing/tc_area_series.rb b/test/drawing/tc_area_series.rb index d77e241d..e7e53269 100644 --- a/test/drawing/tc_area_series.rb +++ b/test/drawing/tc_area_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAreaSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_axes.rb b/test/drawing/tc_axes.rb index 27a90b0b..2e9aab90 100644 --- a/test/drawing/tc_axes.rb +++ b/test/drawing/tc_axes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAxes < Test::Unit::TestCase diff --git a/test/drawing/tc_axis.rb b/test/drawing/tc_axis.rb index d62f4fbd..ba359fed 100644 --- a/test/drawing/tc_axis.rb +++ b/test/drawing/tc_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAxis < Test::Unit::TestCase diff --git a/test/drawing/tc_bar_3D_chart.rb b/test/drawing/tc_bar_3D_chart.rb index aaef0312..d825ce94 100644 --- a/test/drawing/tc_bar_3D_chart.rb +++ b/test/drawing/tc_bar_3D_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBar3DChart < Test::Unit::TestCase diff --git a/test/drawing/tc_bar_chart.rb b/test/drawing/tc_bar_chart.rb index 9fd52530..0d4fd341 100644 --- a/test/drawing/tc_bar_chart.rb +++ b/test/drawing/tc_bar_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBarChart < Test::Unit::TestCase diff --git a/test/drawing/tc_bar_series.rb b/test/drawing/tc_bar_series.rb index bbc18b1d..450b67e5 100644 --- a/test/drawing/tc_bar_series.rb +++ b/test/drawing/tc_bar_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBarSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_bubble_chart.rb b/test/drawing/tc_bubble_chart.rb index e596c095..b38e636b 100644 --- a/test/drawing/tc_bubble_chart.rb +++ b/test/drawing/tc_bubble_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBubbleChart < Test::Unit::TestCase diff --git a/test/drawing/tc_bubble_series.rb b/test/drawing/tc_bubble_series.rb index ef7875ac..78ac1b23 100644 --- a/test/drawing/tc_bubble_series.rb +++ b/test/drawing/tc_bubble_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBubbleSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_cat_axis.rb b/test/drawing/tc_cat_axis.rb index bae314da..db3272e5 100644 --- a/test/drawing/tc_cat_axis.rb +++ b/test/drawing/tc_cat_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCatAxis < Test::Unit::TestCase diff --git a/test/drawing/tc_cat_axis_data.rb b/test/drawing/tc_cat_axis_data.rb index 09b14be6..23d78090 100644 --- a/test/drawing/tc_cat_axis_data.rb +++ b/test/drawing/tc_cat_axis_data.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # require 'tc_helper.rb' # class TestCatAxisData < Test::Unit::TestCase diff --git a/test/drawing/tc_chart.rb b/test/drawing/tc_chart.rb index f91bfbbd..c7527e15 100644 --- a/test/drawing/tc_chart.rb +++ b/test/drawing/tc_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestChart < Test::Unit::TestCase diff --git a/test/drawing/tc_d_lbls.rb b/test/drawing/tc_d_lbls.rb index ef391824..76840a6e 100644 --- a/test/drawing/tc_d_lbls.rb +++ b/test/drawing/tc_d_lbls.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDLbls < Test::Unit::TestCase diff --git a/test/drawing/tc_data_source.rb b/test/drawing/tc_data_source.rb index 4148439b..ea0f1e37 100644 --- a/test/drawing/tc_data_source.rb +++ b/test/drawing/tc_data_source.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestNumDataSource < Test::Unit::TestCase diff --git a/test/drawing/tc_drawing.rb b/test/drawing/tc_drawing.rb index d8c5d1e9..1e72b462 100644 --- a/test/drawing/tc_drawing.rb +++ b/test/drawing/tc_drawing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDrawing < Test::Unit::TestCase diff --git a/test/drawing/tc_graphic_frame.rb b/test/drawing/tc_graphic_frame.rb index 8b69040a..fc5743be 100644 --- a/test/drawing/tc_graphic_frame.rb +++ b/test/drawing/tc_graphic_frame.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestGraphicFrame < Test::Unit::TestCase diff --git a/test/drawing/tc_hyperlink.rb b/test/drawing/tc_hyperlink.rb index b9df3ad9..cad418f8 100644 --- a/test/drawing/tc_hyperlink.rb +++ b/test/drawing/tc_hyperlink.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestHyperlink < Test::Unit::TestCase diff --git a/test/drawing/tc_line_3d_chart.rb b/test/drawing/tc_line_3d_chart.rb index 618439ff..2107f1a0 100644 --- a/test/drawing/tc_line_3d_chart.rb +++ b/test/drawing/tc_line_3d_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestLine3DChart < Test::Unit::TestCase diff --git a/test/drawing/tc_line_chart.rb b/test/drawing/tc_line_chart.rb index 98fecc72..460b2055 100644 --- a/test/drawing/tc_line_chart.rb +++ b/test/drawing/tc_line_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestLineChart < Test::Unit::TestCase diff --git a/test/drawing/tc_line_series.rb b/test/drawing/tc_line_series.rb index b0435488..893c587f 100644 --- a/test/drawing/tc_line_series.rb +++ b/test/drawing/tc_line_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestLineSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_marker.rb b/test/drawing/tc_marker.rb index 8f521128..3341f8cc 100644 --- a/test/drawing/tc_marker.rb +++ b/test/drawing/tc_marker.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestMarker < Test::Unit::TestCase diff --git a/test/drawing/tc_named_axis_data.rb b/test/drawing/tc_named_axis_data.rb index 63fb4610..01c08784 100644 --- a/test/drawing/tc_named_axis_data.rb +++ b/test/drawing/tc_named_axis_data.rb @@ -1,3 +1,4 @@ +# frozen_string_literal: true # require 'tc_helper.rb' # class TestNamedAxisData < Test::Unit::TestCase diff --git a/test/drawing/tc_num_data.rb b/test/drawing/tc_num_data.rb index b169faef..e0683984 100644 --- a/test/drawing/tc_num_data.rb +++ b/test/drawing/tc_num_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestNumData < Test::Unit::TestCase diff --git a/test/drawing/tc_num_val.rb b/test/drawing/tc_num_val.rb index 3168bd89..e5f3b869 100644 --- a/test/drawing/tc_num_val.rb +++ b/test/drawing/tc_num_val.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestNumVal < Test::Unit::TestCase diff --git a/test/drawing/tc_one_cell_anchor.rb b/test/drawing/tc_one_cell_anchor.rb index 1c28ef52..7f0a7c4a 100644 --- a/test/drawing/tc_one_cell_anchor.rb +++ b/test/drawing/tc_one_cell_anchor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestOneCellAnchor < Test::Unit::TestCase diff --git a/test/drawing/tc_pic.rb b/test/drawing/tc_pic.rb index 45014f53..daa8b4a3 100644 --- a/test/drawing/tc_pic.rb +++ b/test/drawing/tc_pic.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPic < Test::Unit::TestCase diff --git a/test/drawing/tc_picture_locking.rb b/test/drawing/tc_picture_locking.rb index a7daf79b..e6db9f59 100644 --- a/test/drawing/tc_picture_locking.rb +++ b/test/drawing/tc_picture_locking.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPictureLocking < Test::Unit::TestCase diff --git a/test/drawing/tc_pie_3D_chart.rb b/test/drawing/tc_pie_3D_chart.rb index 3a1236db..889e383f 100644 --- a/test/drawing/tc_pie_3D_chart.rb +++ b/test/drawing/tc_pie_3D_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPie3DChart < Test::Unit::TestCase diff --git a/test/drawing/tc_pie_series.rb b/test/drawing/tc_pie_series.rb index 96c61f94..a0d63cfc 100644 --- a/test/drawing/tc_pie_series.rb +++ b/test/drawing/tc_pie_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPieSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_scaling.rb b/test/drawing/tc_scaling.rb index cc02ee92..eae1950d 100644 --- a/test/drawing/tc_scaling.rb +++ b/test/drawing/tc_scaling.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestScaling < Test::Unit::TestCase diff --git a/test/drawing/tc_scatter_chart.rb b/test/drawing/tc_scatter_chart.rb index 2712da99..92bc8486 100644 --- a/test/drawing/tc_scatter_chart.rb +++ b/test/drawing/tc_scatter_chart.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestScatterChart < Test::Unit::TestCase diff --git a/test/drawing/tc_scatter_series.rb b/test/drawing/tc_scatter_series.rb index f9f5aad0..a550271b 100644 --- a/test/drawing/tc_scatter_series.rb +++ b/test/drawing/tc_scatter_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestScatterSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_ser_axis.rb b/test/drawing/tc_ser_axis.rb index 3b752635..6d26b182 100644 --- a/test/drawing/tc_ser_axis.rb +++ b/test/drawing/tc_ser_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSerAxis < Test::Unit::TestCase diff --git a/test/drawing/tc_series.rb b/test/drawing/tc_series.rb index fad4e763..2215d398 100644 --- a/test/drawing/tc_series.rb +++ b/test/drawing/tc_series.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSeries < Test::Unit::TestCase diff --git a/test/drawing/tc_series_title.rb b/test/drawing/tc_series_title.rb index 14eb0fba..8950ab6a 100644 --- a/test/drawing/tc_series_title.rb +++ b/test/drawing/tc_series_title.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSeriesTitle < Test::Unit::TestCase diff --git a/test/drawing/tc_str_data.rb b/test/drawing/tc_str_data.rb index 408e4b98..e8fc0441 100644 --- a/test/drawing/tc_str_data.rb +++ b/test/drawing/tc_str_data.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestStrData < Test::Unit::TestCase diff --git a/test/drawing/tc_str_val.rb b/test/drawing/tc_str_val.rb index 39b96e08..dfff771b 100644 --- a/test/drawing/tc_str_val.rb +++ b/test/drawing/tc_str_val.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestStrVal < Test::Unit::TestCase diff --git a/test/drawing/tc_title.rb b/test/drawing/tc_title.rb index 330a48e6..ee4d12c9 100644 --- a/test/drawing/tc_title.rb +++ b/test/drawing/tc_title.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTitle < Test::Unit::TestCase diff --git a/test/drawing/tc_two_cell_anchor.rb b/test/drawing/tc_two_cell_anchor.rb index 321cc45a..bfdaf4de 100644 --- a/test/drawing/tc_two_cell_anchor.rb +++ b/test/drawing/tc_two_cell_anchor.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTwoCellAnchor < Test::Unit::TestCase diff --git a/test/drawing/tc_val_axis.rb b/test/drawing/tc_val_axis.rb index b3a6fb39..bb464048 100644 --- a/test/drawing/tc_val_axis.rb +++ b/test/drawing/tc_val_axis.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestValAxis < Test::Unit::TestCase diff --git a/test/drawing/tc_view_3D.rb b/test/drawing/tc_view_3D.rb index d5550a73..e09edc13 100644 --- a/test/drawing/tc_view_3D.rb +++ b/test/drawing/tc_view_3D.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestView3D < Test::Unit::TestCase diff --git a/test/drawing/tc_vml_drawing.rb b/test/drawing/tc_vml_drawing.rb index ad12642a..815cc556 100644 --- a/test/drawing/tc_vml_drawing.rb +++ b/test/drawing/tc_vml_drawing.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestVmlDrawing < Test::Unit::TestCase diff --git a/test/drawing/tc_vml_shape.rb b/test/drawing/tc_vml_shape.rb index 188114b6..8e415cc1 100644 --- a/test/drawing/tc_vml_shape.rb +++ b/test/drawing/tc_vml_shape.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestVmlShape < Test::Unit::TestCase diff --git a/test/profile.rb b/test/profile.rb index 7b671831..498f2619 100755 --- a/test/profile.rb +++ b/test/profile.rb @@ -1,4 +1,5 @@ #!/usr/bin/env ruby -s +# frozen_string_literal: true $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" require 'axlsx' diff --git a/test/rels/tc_relationship.rb b/test/rels/tc_relationship.rb index b38c47e1..04dab810 100644 --- a/test/rels/tc_relationship.rb +++ b/test/rels/tc_relationship.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestRelationships < Test::Unit::TestCase diff --git a/test/rels/tc_relationships.rb b/test/rels/tc_relationships.rb index 488880b4..b1ad7995 100644 --- a/test/rels/tc_relationships.rb +++ b/test/rels/tc_relationships.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestRelationships < Test::Unit::TestCase diff --git a/test/stylesheet/tc_border.rb b/test/stylesheet/tc_border.rb index 132dc68a..96bef927 100644 --- a/test/stylesheet/tc_border.rb +++ b/test/stylesheet/tc_border.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBorder < Test::Unit::TestCase diff --git a/test/stylesheet/tc_border_pr.rb b/test/stylesheet/tc_border_pr.rb index c82b282d..a1069f5d 100644 --- a/test/stylesheet/tc_border_pr.rb +++ b/test/stylesheet/tc_border_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBorderPr < Test::Unit::TestCase diff --git a/test/stylesheet/tc_cell_alignment.rb b/test/stylesheet/tc_cell_alignment.rb index 79ed858d..2e95db54 100644 --- a/test/stylesheet/tc_cell_alignment.rb +++ b/test/stylesheet/tc_cell_alignment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCellAlignment < Test::Unit::TestCase diff --git a/test/stylesheet/tc_cell_protection.rb b/test/stylesheet/tc_cell_protection.rb index e70bb1b8..a6cc9a5b 100644 --- a/test/stylesheet/tc_cell_protection.rb +++ b/test/stylesheet/tc_cell_protection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCellProtection < Test::Unit::TestCase diff --git a/test/stylesheet/tc_cell_style.rb b/test/stylesheet/tc_cell_style.rb index a2990967..d280ccd1 100644 --- a/test/stylesheet/tc_cell_style.rb +++ b/test/stylesheet/tc_cell_style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCellStyle < Test::Unit::TestCase diff --git a/test/stylesheet/tc_color.rb b/test/stylesheet/tc_color.rb index 1c14278a..0b23daff 100644 --- a/test/stylesheet/tc_color.rb +++ b/test/stylesheet/tc_color.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestColor < Test::Unit::TestCase diff --git a/test/stylesheet/tc_dxf.rb b/test/stylesheet/tc_dxf.rb index 014f794e..5e25a133 100644 --- a/test/stylesheet/tc_dxf.rb +++ b/test/stylesheet/tc_dxf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDxf < Test::Unit::TestCase diff --git a/test/stylesheet/tc_fill.rb b/test/stylesheet/tc_fill.rb index 89e746da..3990a92b 100644 --- a/test/stylesheet/tc_fill.rb +++ b/test/stylesheet/tc_fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestFill < Test::Unit::TestCase diff --git a/test/stylesheet/tc_font.rb b/test/stylesheet/tc_font.rb index d3d5fdff..3cee3e63 100644 --- a/test/stylesheet/tc_font.rb +++ b/test/stylesheet/tc_font.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestFont < Test::Unit::TestCase diff --git a/test/stylesheet/tc_gradient_fill.rb b/test/stylesheet/tc_gradient_fill.rb index fa7ca434..a150a01b 100644 --- a/test/stylesheet/tc_gradient_fill.rb +++ b/test/stylesheet/tc_gradient_fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestGradientFill < Test::Unit::TestCase diff --git a/test/stylesheet/tc_gradient_stop.rb b/test/stylesheet/tc_gradient_stop.rb index 34b18e36..23a1d58e 100644 --- a/test/stylesheet/tc_gradient_stop.rb +++ b/test/stylesheet/tc_gradient_stop.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestGradientStop < Test::Unit::TestCase diff --git a/test/stylesheet/tc_num_fmt.rb b/test/stylesheet/tc_num_fmt.rb index 33d91f97..490bf59f 100644 --- a/test/stylesheet/tc_num_fmt.rb +++ b/test/stylesheet/tc_num_fmt.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestNumFmt < Test::Unit::TestCase diff --git a/test/stylesheet/tc_pattern_fill.rb b/test/stylesheet/tc_pattern_fill.rb index b2e77b7a..120f5f33 100644 --- a/test/stylesheet/tc_pattern_fill.rb +++ b/test/stylesheet/tc_pattern_fill.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPatternFill < Test::Unit::TestCase diff --git a/test/stylesheet/tc_styles.rb b/test/stylesheet/tc_styles.rb index 31c8cfb1..3b77616f 100644 --- a/test/stylesheet/tc_styles.rb +++ b/test/stylesheet/tc_styles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestStyles < Test::Unit::TestCase diff --git a/test/stylesheet/tc_table_style.rb b/test/stylesheet/tc_table_style.rb index cd07733a..ea3334b7 100644 --- a/test/stylesheet/tc_table_style.rb +++ b/test/stylesheet/tc_table_style.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTableStyle < Test::Unit::TestCase diff --git a/test/stylesheet/tc_table_style_element.rb b/test/stylesheet/tc_table_style_element.rb index febb8b65..93ad9453 100644 --- a/test/stylesheet/tc_table_style_element.rb +++ b/test/stylesheet/tc_table_style_element.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTableStyleElement < Test::Unit::TestCase diff --git a/test/stylesheet/tc_table_styles.rb b/test/stylesheet/tc_table_styles.rb index f09f4e2d..a02cb09b 100644 --- a/test/stylesheet/tc_table_styles.rb +++ b/test/stylesheet/tc_table_styles.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTableStyles < Test::Unit::TestCase diff --git a/test/stylesheet/tc_xf.rb b/test/stylesheet/tc_xf.rb index a381c976..b678ce15 100644 --- a/test/stylesheet/tc_xf.rb +++ b/test/stylesheet/tc_xf.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestXf < Test::Unit::TestCase diff --git a/test/support/capture_warnings.rb b/test/support/capture_warnings.rb index c327a145..632f87a3 100644 --- a/test/support/capture_warnings.rb +++ b/test/support/capture_warnings.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + module CaptureWarnings def capture_warnings # Turn off warnings with setting $VERBOSE to nil diff --git a/test/tc_axlsx.rb b/test/tc_axlsx.rb index 21c0c82a..d1c47b47 100644 --- a/test/tc_axlsx.rb +++ b/test/tc_axlsx.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAxlsx < Test::Unit::TestCase @@ -92,7 +94,7 @@ class TestAxlsx < Test::Unit::TestCase end def test_sanitize_frozen_control_strippped - needs_sanitize = "legit\x08".freeze # Backspace control char + needs_sanitize = "legit\x08" # Backspace control char assert_equal('legit', Axlsx.sanitize(needs_sanitize), 'should strip control chars') end diff --git a/test/tc_helper.rb b/test/tc_helper.rb index cd3b3262..f0e55df7 100644 --- a/test/tc_helper.rb +++ b/test/tc_helper.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + $LOAD_PATH.unshift "#{File.dirname(__FILE__)}/../lib" require 'simplecov' SimpleCov.start do diff --git a/test/tc_package.rb b/test/tc_package.rb index d4581792..f4087c4d 100644 --- a/test/tc_package.rb +++ b/test/tc_package.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' require 'support/capture_warnings' diff --git a/test/util/tc_mime_type_utils.rb b/test/util/tc_mime_type_utils.rb index ee7f447a..568aa61d 100644 --- a/test/util/tc_mime_type_utils.rb +++ b/test/util/tc_mime_type_utils.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestMimeTypeUtils < Test::Unit::TestCase diff --git a/test/util/tc_serialized_attributes.rb b/test/util/tc_serialized_attributes.rb index 4ba90b29..02036bab 100644 --- a/test/util/tc_serialized_attributes.rb +++ b/test/util/tc_serialized_attributes.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class Funk diff --git a/test/util/tc_simple_typed_list.rb b/test/util/tc_simple_typed_list.rb index e1ac6d99..ac65529d 100644 --- a/test/util/tc_simple_typed_list.rb +++ b/test/util/tc_simple_typed_list.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSimpleTypedList < Test::Unit::TestCase diff --git a/test/util/tc_validators.rb b/test/util/tc_validators.rb index 59e4f559..86e2182c 100644 --- a/test/util/tc_validators.rb +++ b/test/util/tc_validators.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestValidators < Test::Unit::TestCase diff --git a/test/workbook/tc_defined_name.rb b/test/workbook/tc_defined_name.rb index 25db45db..4fbd2e58 100644 --- a/test/workbook/tc_defined_name.rb +++ b/test/workbook/tc_defined_name.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDefinedNames < Test::Unit::TestCase diff --git a/test/workbook/tc_shared_strings_table.rb b/test/workbook/tc_shared_strings_table.rb index 2f7de9a7..4aa308f1 100644 --- a/test/workbook/tc_shared_strings_table.rb +++ b/test/workbook/tc_shared_strings_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSharedStringsTable < Test::Unit::TestCase diff --git a/test/workbook/tc_workbook.rb b/test/workbook/tc_workbook.rb index 0bd84d2d..d85c17d9 100644 --- a/test/workbook/tc_workbook.rb +++ b/test/workbook/tc_workbook.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestWorkbook < Test::Unit::TestCase diff --git a/test/workbook/tc_workbook_view.rb b/test/workbook/tc_workbook_view.rb index 07f21f6a..c8909713 100644 --- a/test/workbook/tc_workbook_view.rb +++ b/test/workbook/tc_workbook_view.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestWorkbookView < Test::Unit::TestCase diff --git a/test/workbook/worksheet/auto_filter/tc_auto_filter.rb b/test/workbook/worksheet/auto_filter/tc_auto_filter.rb index ead6c43a..85ba32b7 100644 --- a/test/workbook/worksheet/auto_filter/tc_auto_filter.rb +++ b/test/workbook/worksheet/auto_filter/tc_auto_filter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestAutoFilter < Test::Unit::TestCase diff --git a/test/workbook/worksheet/auto_filter/tc_filter_column.rb b/test/workbook/worksheet/auto_filter/tc_filter_column.rb index 84cb41ca..d89446c6 100644 --- a/test/workbook/worksheet/auto_filter/tc_filter_column.rb +++ b/test/workbook/worksheet/auto_filter/tc_filter_column.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestFilterColumn < Test::Unit::TestCase diff --git a/test/workbook/worksheet/auto_filter/tc_filters.rb b/test/workbook/worksheet/auto_filter/tc_filters.rb index 35f17a7b..4cd8ca00 100644 --- a/test/workbook/worksheet/auto_filter/tc_filters.rb +++ b/test/workbook/worksheet/auto_filter/tc_filters.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestFilters < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_border_creator.rb b/test/workbook/worksheet/tc_border_creator.rb index 7dff4f0f..46891e8b 100644 --- a/test/workbook/worksheet/tc_border_creator.rb +++ b/test/workbook/worksheet/tc_border_creator.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBorderCreator < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_break.rb b/test/workbook/worksheet/tc_break.rb index 638dcd8d..a441abe0 100644 --- a/test/workbook/worksheet/tc_break.rb +++ b/test/workbook/worksheet/tc_break.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestBreak < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_cell.rb b/test/workbook/worksheet/tc_cell.rb index 28a074ae..a534a8dc 100644 --- a/test/workbook/worksheet/tc_cell.rb +++ b/test/workbook/worksheet/tc_cell.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCell < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_cfvo.rb b/test/workbook/worksheet/tc_cfvo.rb index 6098add1..0e2e5332 100644 --- a/test/workbook/worksheet/tc_cfvo.rb +++ b/test/workbook/worksheet/tc_cfvo.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCfvo < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_col.rb b/test/workbook/worksheet/tc_col.rb index d34b84ec..e795c301 100644 --- a/test/workbook/worksheet/tc_col.rb +++ b/test/workbook/worksheet/tc_col.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestCol < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_color_scale.rb b/test/workbook/worksheet/tc_color_scale.rb index 6cba553b..335e8057 100644 --- a/test/workbook/worksheet/tc_color_scale.rb +++ b/test/workbook/worksheet/tc_color_scale.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestColorScale < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_comment.rb b/test/workbook/worksheet/tc_comment.rb index d6fd41d1..65b2ca1d 100644 --- a/test/workbook/worksheet/tc_comment.rb +++ b/test/workbook/worksheet/tc_comment.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestComment < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_comments.rb b/test/workbook/worksheet/tc_comments.rb index e96a581c..445f2342 100644 --- a/test/workbook/worksheet/tc_comments.rb +++ b/test/workbook/worksheet/tc_comments.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestComments < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_conditional_formatting.rb b/test/workbook/worksheet/tc_conditional_formatting.rb index 9eee820b..f706dae3 100644 --- a/test/workbook/worksheet/tc_conditional_formatting.rb +++ b/test/workbook/worksheet/tc_conditional_formatting.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestConditionalFormatting < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_data_bar.rb b/test/workbook/worksheet/tc_data_bar.rb index 35cf5c11..62c6fc34 100644 --- a/test/workbook/worksheet/tc_data_bar.rb +++ b/test/workbook/worksheet/tc_data_bar.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDataBar < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_data_validation.rb b/test/workbook/worksheet/tc_data_validation.rb index 90fea502..4be68673 100644 --- a/test/workbook/worksheet/tc_data_validation.rb +++ b/test/workbook/worksheet/tc_data_validation.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' require 'support/capture_warnings' diff --git a/test/workbook/worksheet/tc_date_time_converter.rb b/test/workbook/worksheet/tc_date_time_converter.rb index 669dee06..5cc9d619 100644 --- a/test/workbook/worksheet/tc_date_time_converter.rb +++ b/test/workbook/worksheet/tc_date_time_converter.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestDateTimeConverter < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_header_footer.rb b/test/workbook/worksheet/tc_header_footer.rb index 45a90825..8a62b281 100644 --- a/test/workbook/worksheet/tc_header_footer.rb +++ b/test/workbook/worksheet/tc_header_footer.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestHeaderFooter < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_icon_set.rb b/test/workbook/worksheet/tc_icon_set.rb index f065c399..beb69919 100644 --- a/test/workbook/worksheet/tc_icon_set.rb +++ b/test/workbook/worksheet/tc_icon_set.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestIconSet < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_outline_pr.rb b/test/workbook/worksheet/tc_outline_pr.rb index cd806d17..95b52530 100644 --- a/test/workbook/worksheet/tc_outline_pr.rb +++ b/test/workbook/worksheet/tc_outline_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestOutlinePr < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_page_margins.rb b/test/workbook/worksheet/tc_page_margins.rb index 820c65be..8c580204 100644 --- a/test/workbook/worksheet/tc_page_margins.rb +++ b/test/workbook/worksheet/tc_page_margins.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPageMargins < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_page_set_up_pr.rb b/test/workbook/worksheet/tc_page_set_up_pr.rb index ab39f038..36a2a6f4 100644 --- a/test/workbook/worksheet/tc_page_set_up_pr.rb +++ b/test/workbook/worksheet/tc_page_set_up_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPageSetUpPr < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_page_setup.rb b/test/workbook/worksheet/tc_page_setup.rb index 494db40b..95703c1c 100644 --- a/test/workbook/worksheet/tc_page_setup.rb +++ b/test/workbook/worksheet/tc_page_setup.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPageSetup < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_pane.rb b/test/workbook/worksheet/tc_pane.rb index 5afc142e..59d411a0 100644 --- a/test/workbook/worksheet/tc_pane.rb +++ b/test/workbook/worksheet/tc_pane.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPane < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_pivot_table.rb b/test/workbook/worksheet/tc_pivot_table.rb index 4fafa04d..f5b23a96 100644 --- a/test/workbook/worksheet/tc_pivot_table.rb +++ b/test/workbook/worksheet/tc_pivot_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' def shared_test_pivot_table_xml_validity(pivot_table) diff --git a/test/workbook/worksheet/tc_pivot_table_cache_definition.rb b/test/workbook/worksheet/tc_pivot_table_cache_definition.rb index f629940f..108fa297 100644 --- a/test/workbook/worksheet/tc_pivot_table_cache_definition.rb +++ b/test/workbook/worksheet/tc_pivot_table_cache_definition.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPivotTableCacheDefinition < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_print_options.rb b/test/workbook/worksheet/tc_print_options.rb index e568d739..10639bcf 100644 --- a/test/workbook/worksheet/tc_print_options.rb +++ b/test/workbook/worksheet/tc_print_options.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestPrintOptions < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_protected_range.rb b/test/workbook/worksheet/tc_protected_range.rb index 1f39ec12..44fe8333 100644 --- a/test/workbook/worksheet/tc_protected_range.rb +++ b/test/workbook/worksheet/tc_protected_range.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestProtectedRange < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_rich_text.rb b/test/workbook/worksheet/tc_rich_text.rb index 77d74ab6..ed3ec9ca 100644 --- a/test/workbook/worksheet/tc_rich_text.rb +++ b/test/workbook/worksheet/tc_rich_text.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class RichText < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_rich_text_run.rb b/test/workbook/worksheet/tc_rich_text_run.rb index ef2a520c..e9011832 100644 --- a/test/workbook/worksheet/tc_rich_text_run.rb +++ b/test/workbook/worksheet/tc_rich_text_run.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class RichTextRun < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index cd805315..9336ae38 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestRow < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_selection.rb b/test/workbook/worksheet/tc_selection.rb index d2edc669..d68500a5 100644 --- a/test/workbook/worksheet/tc_selection.rb +++ b/test/workbook/worksheet/tc_selection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSelection < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_sheet_calc_pr.rb b/test/workbook/worksheet/tc_sheet_calc_pr.rb index 0d810378..cd1f6506 100644 --- a/test/workbook/worksheet/tc_sheet_calc_pr.rb +++ b/test/workbook/worksheet/tc_sheet_calc_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSheetCalcPr < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_sheet_format_pr.rb b/test/workbook/worksheet/tc_sheet_format_pr.rb index 5de2fc53..18d62249 100644 --- a/test/workbook/worksheet/tc_sheet_format_pr.rb +++ b/test/workbook/worksheet/tc_sheet_format_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSheetFormatPr < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_sheet_pr.rb b/test/workbook/worksheet/tc_sheet_pr.rb index 7bff60b7..be87ebf7 100644 --- a/test/workbook/worksheet/tc_sheet_pr.rb +++ b/test/workbook/worksheet/tc_sheet_pr.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSheetPr < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_sheet_protection.rb b/test/workbook/worksheet/tc_sheet_protection.rb index 3305b044..4a5e22e8 100644 --- a/test/workbook/worksheet/tc_sheet_protection.rb +++ b/test/workbook/worksheet/tc_sheet_protection.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' # diff --git a/test/workbook/worksheet/tc_sheet_view.rb b/test/workbook/worksheet/tc_sheet_view.rb index 1098f42a..b52b6954 100644 --- a/test/workbook/worksheet/tc_sheet_view.rb +++ b/test/workbook/worksheet/tc_sheet_view.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestSheetView < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_table.rb b/test/workbook/worksheet/tc_table.rb index 2a3a56db..38f909b9 100644 --- a/test/workbook/worksheet/tc_table.rb +++ b/test/workbook/worksheet/tc_table.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTable < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_table_style_info.rb b/test/workbook/worksheet/tc_table_style_info.rb index 1da1068d..60a4c113 100644 --- a/test/workbook/worksheet/tc_table_style_info.rb +++ b/test/workbook/worksheet/tc_table_style_info.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestTableStyleInfo < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_worksheet.rb b/test/workbook/worksheet/tc_worksheet.rb index fc671a59..3c54e3fc 100644 --- a/test/workbook/worksheet/tc_worksheet.rb +++ b/test/workbook/worksheet/tc_worksheet.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestWorksheet < Test::Unit::TestCase diff --git a/test/workbook/worksheet/tc_worksheet_hyperlink.rb b/test/workbook/worksheet/tc_worksheet_hyperlink.rb index 82f6689b..19bacc0e 100644 --- a/test/workbook/worksheet/tc_worksheet_hyperlink.rb +++ b/test/workbook/worksheet/tc_worksheet_hyperlink.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require 'tc_helper' class TestWorksheetHyperlink < Test::Unit::TestCase -- cgit v1.2.3 From fabe8cb2571c8865270247ca78ddc01d493a9ee1 Mon Sep 17 00:00:00 2001 From: Paul Kmiec Date: Thu, 4 May 2023 16:31:08 -0700 Subject: Fix tests / code to work with frozen string literals --- CHANGELOG.md | 2 + lib/axlsx.rb | 2 +- lib/axlsx/content_type/abstract_content_type.rb | 2 +- lib/axlsx/content_type/content_type.rb | 4 +- lib/axlsx/content_type/default.rb | 2 +- lib/axlsx/content_type/override.rb | 2 +- lib/axlsx/doc_props/app.rb | 4 +- lib/axlsx/doc_props/core.rb | 12 +++--- lib/axlsx/drawing/area_chart.rb | 10 ++--- lib/axlsx/drawing/area_series.rb | 8 ++-- lib/axlsx/drawing/axes.rb | 4 +- lib/axlsx/drawing/axis.rb | 20 +++++----- lib/axlsx/drawing/bar_3D_chart.rb | 14 +++---- lib/axlsx/drawing/bar_chart.rb | 14 +++---- lib/axlsx/drawing/bar_series.rb | 10 ++--- lib/axlsx/drawing/bubble_chart.rb | 4 +- lib/axlsx/drawing/bubble_series.rb | 6 +-- lib/axlsx/drawing/cat_axis.rb | 12 +++--- lib/axlsx/drawing/chart.rb | 18 ++++----- lib/axlsx/drawing/d_lbls.rb | 2 +- lib/axlsx/drawing/drawing.rb | 4 +- lib/axlsx/drawing/graphic_frame.rb | 8 ++-- lib/axlsx/drawing/hyperlink.rb | 2 +- lib/axlsx/drawing/line_3D_chart.rb | 4 +- lib/axlsx/drawing/line_chart.rb | 10 ++--- lib/axlsx/drawing/line_series.rb | 8 ++-- lib/axlsx/drawing/marker.rb | 4 +- lib/axlsx/drawing/num_data.rb | 10 ++--- lib/axlsx/drawing/num_data_source.rb | 12 +++--- lib/axlsx/drawing/num_val.rb | 4 +- lib/axlsx/drawing/one_cell_anchor.rb | 4 +- lib/axlsx/drawing/pic.rb | 8 ++-- lib/axlsx/drawing/picture_locking.rb | 2 +- lib/axlsx/drawing/pie_3D_chart.rb | 4 +- lib/axlsx/drawing/pie_series.rb | 6 +-- lib/axlsx/drawing/scaling.rb | 10 ++--- lib/axlsx/drawing/scatter_chart.rb | 6 +-- lib/axlsx/drawing/scatter_series.rb | 12 +++--- lib/axlsx/drawing/ser_axis.rb | 6 +-- lib/axlsx/drawing/series.rb | 6 +-- lib/axlsx/drawing/series_title.rb | 6 +-- lib/axlsx/drawing/str_data.rb | 8 ++-- lib/axlsx/drawing/str_val.rb | 4 +- lib/axlsx/drawing/title.rb | 10 ++--- lib/axlsx/drawing/two_cell_anchor.rb | 2 +- lib/axlsx/drawing/val_axis.rb | 4 +- lib/axlsx/drawing/view_3D.rb | 2 +- lib/axlsx/drawing/vml_drawing.rb | 2 +- lib/axlsx/drawing/vml_shape.rb | 2 +- lib/axlsx/rels/relationship.rb | 4 +- lib/axlsx/rels/relationships.rb | 4 +- lib/axlsx/stylesheet/border.rb | 2 +- lib/axlsx/stylesheet/border_pr.rb | 6 +-- lib/axlsx/stylesheet/cell_alignment.rb | 2 +- lib/axlsx/stylesheet/cell_protection.rb | 2 +- lib/axlsx/stylesheet/cell_style.rb | 2 +- lib/axlsx/stylesheet/color.rb | 2 +- lib/axlsx/stylesheet/dxf.rb | 2 +- lib/axlsx/stylesheet/fill.rb | 2 +- lib/axlsx/stylesheet/font.rb | 4 +- lib/axlsx/stylesheet/gradient_fill.rb | 2 +- lib/axlsx/stylesheet/gradient_stop.rb | 4 +- lib/axlsx/stylesheet/num_fmt.rb | 4 +- lib/axlsx/stylesheet/pattern_fill.rb | 4 +- lib/axlsx/stylesheet/styles.rb | 4 +- lib/axlsx/stylesheet/table_style.rb | 2 +- lib/axlsx/stylesheet/table_style_element.rb | 2 +- lib/axlsx/stylesheet/table_styles.rb | 2 +- lib/axlsx/stylesheet/xf.rb | 2 +- lib/axlsx/util/serialized_attributes.rb | 4 +- lib/axlsx/util/simple_typed_list.rb | 6 +-- lib/axlsx/workbook/defined_name.rb | 6 +-- lib/axlsx/workbook/defined_names.rb | 2 +- lib/axlsx/workbook/shared_strings_table.rb | 10 ++--- lib/axlsx/workbook/workbook.rb | 8 ++-- lib/axlsx/workbook/workbook_view.rb | 2 +- lib/axlsx/workbook/workbook_views.rb | 2 +- .../workbook/worksheet/auto_filter/auto_filter.rb | 2 +- .../worksheet/auto_filter/filter_column.rb | 2 +- .../workbook/worksheet/auto_filter/filters.rb | 6 +-- lib/axlsx/workbook/worksheet/break.rb | 2 +- lib/axlsx/workbook/worksheet/cell.rb | 2 +- lib/axlsx/workbook/worksheet/cell_serializer.rb | 44 +++++++++++----------- lib/axlsx/workbook/worksheet/cfvo.rb | 2 +- lib/axlsx/workbook/worksheet/cfvos.rb | 2 +- lib/axlsx/workbook/worksheet/col.rb | 2 +- lib/axlsx/workbook/worksheet/col_breaks.rb | 4 +- lib/axlsx/workbook/worksheet/color_scale.rb | 2 +- lib/axlsx/workbook/worksheet/cols.rb | 2 +- lib/axlsx/workbook/worksheet/comment.rb | 8 ++-- lib/axlsx/workbook/worksheet/comments.rb | 6 +-- .../workbook/worksheet/conditional_formatting.rb | 4 +- .../worksheet/conditional_formatting_rule.rb | 4 +- .../workbook/worksheet/conditional_formattings.rb | 2 +- lib/axlsx/workbook/worksheet/data_bar.rb | 2 +- lib/axlsx/workbook/worksheet/data_validation.rb | 8 ++-- lib/axlsx/workbook/worksheet/data_validations.rb | 2 +- lib/axlsx/workbook/worksheet/dimension.rb | 2 +- lib/axlsx/workbook/worksheet/header_footer.rb | 2 +- lib/axlsx/workbook/worksheet/icon_set.rb | 2 +- lib/axlsx/workbook/worksheet/merged_cells.rb | 2 +- lib/axlsx/workbook/worksheet/outline_pr.rb | 2 +- lib/axlsx/workbook/worksheet/page_margins.rb | 2 +- lib/axlsx/workbook/worksheet/page_set_up_pr.rb | 4 +- lib/axlsx/workbook/worksheet/page_setup.rb | 2 +- lib/axlsx/workbook/worksheet/pane.rb | 2 +- lib/axlsx/workbook/worksheet/pivot_table.rb | 22 +++++------ .../worksheet/pivot_table_cache_definition.rb | 10 ++--- lib/axlsx/workbook/worksheet/print_options.rb | 2 +- lib/axlsx/workbook/worksheet/protected_range.rb | 2 +- lib/axlsx/workbook/worksheet/protected_ranges.rb | 2 +- lib/axlsx/workbook/worksheet/rich_text.rb | 2 +- lib/axlsx/workbook/worksheet/rich_text_run.rb | 8 ++-- lib/axlsx/workbook/worksheet/row.rb | 5 +-- lib/axlsx/workbook/worksheet/row_breaks.rb | 4 +- lib/axlsx/workbook/worksheet/selection.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_calc_pr.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_data.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_format_pr.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_pr.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_protection.rb | 2 +- lib/axlsx/workbook/worksheet/sheet_view.rb | 2 +- lib/axlsx/workbook/worksheet/table.rb | 12 +++--- lib/axlsx/workbook/worksheet/table_style_info.rb | 2 +- lib/axlsx/workbook/worksheet/tables.rb | 2 +- lib/axlsx/workbook/worksheet/worksheet.rb | 8 ++-- lib/axlsx/workbook/worksheet/worksheet_comments.rb | 2 +- lib/axlsx/workbook/worksheet/worksheet_drawing.rb | 2 +- .../workbook/worksheet/worksheet_hyperlink.rb | 2 +- .../workbook/worksheet/worksheet_hyperlinks.rb | 2 +- test/drawing/tc_area_series.rb | 2 +- test/drawing/tc_axis.rb | 4 +- test/drawing/tc_d_lbls.rb | 2 +- test/drawing/tc_data_source.rb | 2 +- test/drawing/tc_line_series.rb | 2 +- test/drawing/tc_num_data.rb | 2 +- test/drawing/tc_num_val.rb | 2 +- test/drawing/tc_str_data.rb | 2 +- test/drawing/tc_str_val.rb | 4 +- test/tc_axlsx.rb | 4 +- test/workbook/worksheet/tc_row.rb | 4 +- 141 files changed, 341 insertions(+), 340 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec38447e..4dea8fa7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,8 @@ CHANGELOG --------- - **Unreleased**: 4.0.0 - Drop support for Ruby versions < 2.6 + - Drop support for Ruby versions < 2.7 + - Added frozen string literals - **April.23.23**: 3.4.1 - [PR #209](https://github.com/caxlsx/caxlsx/pull/209) - Revert characters other than `=` being considered as formulas. diff --git a/lib/axlsx.rb b/lib/axlsx.rb index e21efb07..912be81d 100644 --- a/lib/axlsx.rb +++ b/lib/axlsx.rb @@ -111,7 +111,7 @@ module Axlsx # @note This follows the standard spreadsheet convention of naming columns A to Z, followed by AA to AZ etc. # @return [String] def self.col_ref(index) - chars = '' + chars = +'' while index >= 26 do index, char = index.divmod(26) chars.prepend((char + 65).chr) diff --git a/lib/axlsx/content_type/abstract_content_type.rb b/lib/axlsx/content_type/abstract_content_type.rb index dfb7dd91..58ca8b2c 100644 --- a/lib/axlsx/content_type/abstract_content_type.rb +++ b/lib/axlsx/content_type/abstract_content_type.rb @@ -22,7 +22,7 @@ module Axlsx alias :ContentType= :content_type= # Serialize the contenty type to xml - def to_xml_string(node_name = '', str = '') + def to_xml_string(node_name = '', str = +'') str << "<#{node_name} " str << Axlsx.instance_values_for(self).map { |key, value| Axlsx::camel(key) << '="' << value.to_s << '"' }.join(' ') str << '/>' diff --git a/lib/axlsx/content_type/content_type.rb b/lib/axlsx/content_type/content_type.rb index ead50713..15751b17 100644 --- a/lib/axlsx/content_type/content_type.rb +++ b/lib/axlsx/content_type/content_type.rb @@ -14,9 +14,9 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') each { |type| type.to_xml_string(str) } str << '' end diff --git a/lib/axlsx/content_type/default.rb b/lib/axlsx/content_type/default.rb index ad215070..16189fc6 100644 --- a/lib/axlsx/content_type/default.rb +++ b/lib/axlsx/content_type/default.rb @@ -16,7 +16,7 @@ module Axlsx alias :Extension= :extension= # Serializes this object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') super(NODE_NAME, str) end end diff --git a/lib/axlsx/content_type/override.rb b/lib/axlsx/content_type/override.rb index fd98a803..be45db3c 100644 --- a/lib/axlsx/content_type/override.rb +++ b/lib/axlsx/content_type/override.rb @@ -16,7 +16,7 @@ module Axlsx alias :PartName= :part_name= # Serializes this object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') super(NODE_NAME, str) end end 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 << '' - str << ('') + str << (+'') Axlsx.instance_values_for(self).each do |key, value| node_name = Axlsx.camel(key) str << "<#{node_name}>#{value}" 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 << '' - str << ('') - str << ('' << self.creator << '') - str << ('' << (created || Time.now).strftime('%Y-%m-%dT%H:%M:%S') << 'Z') + str << (+'') + str << (+'' << self.creator << '') + str << (+'' << (created || Time.now).strftime('%Y-%m-%dT%H:%M:%S') << 'Z') str << '0' str << '' end diff --git a/lib/axlsx/drawing/area_chart.rb b/lib/axlsx/drawing/area_chart.rb index 9b948808..8339c255 100644 --- a/lib/axlsx/drawing/area_chart.rb +++ b/lib/axlsx/drawing/area_chart.rb @@ -74,16 +74,16 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do - str << ("") - str << ('') - str << ('') + str << (+"") + str << (+'') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } @d_lbls.to_xml_string(str) if @d_lbls yield if block_given? axes.to_xml_string(str, :ids => true) - str << ("") + str << (+"") axes.to_xml_string(str) end end diff --git a/lib/axlsx/drawing/area_series.rb b/lib/axlsx/drawing/area_series.rb index 55c391d9..9d87d078 100644 --- a/lib/axlsx/drawing/area_series.rb +++ b/lib/axlsx/drawing/area_series.rb @@ -71,15 +71,15 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do if color str << '' - str << ('') + str << (+'') str << '' str << '' str << '' - str << ('') + str << (+'') str << '' str << '' str << '' @@ -94,7 +94,7 @@ module Axlsx @labels.to_xml_string(str) unless @labels.nil? @data.to_xml_string(str) unless @data.nil? - str << ('') + str << (+'') end end diff --git a/lib/axlsx/drawing/axes.rb b/lib/axlsx/drawing/axes.rb index c84b4378..0baad85f 100644 --- a/lib/axlsx/drawing/axes.rb +++ b/lib/axlsx/drawing/axes.rb @@ -29,11 +29,11 @@ module Axlsx # @option options ids # If the ids option is specified only the axis identifier is # serialized. Otherwise, each axis is serialized in full. - def to_xml_string(str = '', options = {}) + def to_xml_string(str = +'', options = {}) if options[:ids] # CatAxis must come first in the XML (for Microsoft Excel at least) sorted = axes.sort_by { |name, axis| axis.kind_of?(CatAxis) ? 0 : 1 } - sorted.each { |axis| str << ('') } + sorted.each { |axis| str << (+'') } else axes.each { |axis| axis[1].to_xml_string(str) } end diff --git a/lib/axlsx/drawing/axis.rb b/lib/axlsx/drawing/axis.rb index 6ee2b9f4..38e57da5 100644 --- a/lib/axlsx/drawing/axis.rb +++ b/lib/axlsx/drawing/axis.rb @@ -148,11 +148,11 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') @scaling.to_xml_string str - str << ('') - str << ('') + str << (+'') + str << (+'') str << '' # TODO: shape properties need to be extracted into a class if gridlines == false @@ -167,21 +167,21 @@ module Axlsx # Need to set sourceLinked to 0 if we're setting a format code on this row # otherwise it will never take, as it will always prefer the 'General' formatting # of the cells themselves - str << ('') + str << (+'') str << '' str << '' - str << ('') + str << (+'') # TODO: this is also being used for series colors # time to extract this into a class spPr - Shape Properties if @color str << '' - str << ('') + str << (+'') str << '' end # some potential value in implementing this in full. Very detailed! - str << ('') - str << ('') - str << ('') + str << (+'') + str << (+'') + str << (+'') end end end diff --git a/lib/axlsx/drawing/bar_3D_chart.rb b/lib/axlsx/drawing/bar_3D_chart.rb index 0ba55eb2..37ac7dab 100644 --- a/lib/axlsx/drawing/bar_3D_chart.rb +++ b/lib/axlsx/drawing/bar_3D_chart.rb @@ -120,17 +120,17 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' - str << ('') - str << ('') - str << ('') + str << (+'') + str << (+'') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } @d_lbls.to_xml_string(str) if @d_lbls - str << ('') unless @gap_width.nil? - str << ('') unless @gap_depth.nil? - str << ('') unless @shape.nil? + str << (+'') unless @gap_width.nil? + str << (+'') unless @gap_depth.nil? + str << (+'') unless @shape.nil? axes.to_xml_string(str, :ids => true) str << '' axes.to_xml_string(str) diff --git a/lib/axlsx/drawing/bar_chart.rb b/lib/axlsx/drawing/bar_chart.rb index c3240f32..eca54dfc 100644 --- a/lib/axlsx/drawing/bar_chart.rb +++ b/lib/axlsx/drawing/bar_chart.rb @@ -110,17 +110,17 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' - str << ('') - str << ('') - str << ('') + str << (+'') + str << (+'') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } @d_lbls.to_xml_string(str) if @d_lbls - str << ('') unless @overlap.nil? - str << ('') unless @gap_width.nil? - str << ('') unless @shape.nil? + str << (+'') unless @overlap.nil? + str << (+'') unless @gap_width.nil? + str << (+'') unless @shape.nil? axes.to_xml_string(str, :ids => true) str << '' axes.to_xml_string(str) diff --git a/lib/axlsx/drawing/bar_series.rb b/lib/axlsx/drawing/bar_series.rb index 86ca4e88..c744175f 100644 --- a/lib/axlsx/drawing/bar_series.rb +++ b/lib/axlsx/drawing/bar_series.rb @@ -58,19 +58,19 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do colors.each_with_index do |c, index| str << '' - str << ('') + str << (+'') str << '' - str << ('') + str << (+'') str << '' end if series_color str << '' - str << ('') + str << (+'') str << '' str << '' end @@ -78,7 +78,7 @@ module Axlsx @labels.to_xml_string(str) unless @labels.nil? @data.to_xml_string(str) unless @data.nil? # this is actually only required for shapes other than box - str << ('') + str << (+'') end end diff --git a/lib/axlsx/drawing/bubble_chart.rb b/lib/axlsx/drawing/bubble_chart.rb index 73b74035..b4932042 100644 --- a/lib/axlsx/drawing/bubble_chart.rb +++ b/lib/axlsx/drawing/bubble_chart.rb @@ -35,10 +35,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' - str << ('') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls axes.to_xml_string(str, :ids => true) diff --git a/lib/axlsx/drawing/bubble_series.rb b/lib/axlsx/drawing/bubble_series.rb index e44a3fd8..25335270 100644 --- a/lib/axlsx/drawing/bubble_series.rb +++ b/lib/axlsx/drawing/bubble_series.rb @@ -41,15 +41,15 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do # needs to override the super color here to push in ln/and something else! if color str << '' - str << ('') + str << (+'') str << '' str << '' - str << ('') + str << (+'') str << '' end @xData.to_xml_string(str) unless @xData.nil? diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb index 23568d6f..a36f62d1 100644 --- a/lib/axlsx/drawing/cat_axis.rb +++ b/lib/axlsx/drawing/cat_axis.rb @@ -68,14 +68,14 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' super(str) - str << ('') - str << ('') - str << ('') - str << ('') - str << ('') + str << (+'') + str << (+'') + str << (+'') + str << (+'') + str << (+'') str << '' end end diff --git a/lib/axlsx/drawing/chart.rb b/lib/axlsx/drawing/chart.rb index 636c1713..300a5086 100644 --- a/lib/axlsx/drawing/chart.rb +++ b/lib/axlsx/drawing/chart.rb @@ -204,15 +204,15 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') - str << ('') - str << ('') - str << ('') + str << (+'') + str << (+'') + str << (+'') + str << (+'') str << '' @title.to_xml_string(str) unless @title.empty? - str << ('') + str << (+'') @view_3D.to_xml_string(str) if @view_3D str << '' str << '' @@ -223,13 +223,13 @@ module Axlsx str << '' if @show_legend str << '' - str << ('') + str << (+'') str << '' str << '' str << '' end - str << ('') - str << ('') + str << (+'') + str << (+'') str << '' str << '' if bg_color diff --git a/lib/axlsx/drawing/d_lbls.rb b/lib/axlsx/drawing/d_lbls.rb index cdccf327..4e2bd40c 100644 --- a/lib/axlsx/drawing/d_lbls.rb +++ b/lib/axlsx/drawing/d_lbls.rb @@ -71,7 +71,7 @@ module Axlsx # serializes the data labels # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') validate_attributes_for_chart_type str << '' instance_vals = Axlsx.instance_values_for(self) diff --git a/lib/axlsx/drawing/drawing.rb b/lib/axlsx/drawing/drawing.rb index d36e4349..7be169be 100644 --- a/lib/axlsx/drawing/drawing.rb +++ b/lib/axlsx/drawing/drawing.rb @@ -155,9 +155,9 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') anchors.each { |anchor| anchor.to_xml_string(str) } str << '' end diff --git a/lib/axlsx/drawing/graphic_frame.rb b/lib/axlsx/drawing/graphic_frame.rb index e245b9ab..7d0e818c 100644 --- a/lib/axlsx/drawing/graphic_frame.rb +++ b/lib/axlsx/drawing/graphic_frame.rb @@ -31,11 +31,11 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') # macro attribute should be optional! str << '' str << '' - str << ('') + str << (+'') str << '' str << '' str << '' @@ -43,8 +43,8 @@ module Axlsx str << '' str << '' str << '' - str << ('') - str << ('') + str << (+'') + str << (+'') str << '' str << '' str << '' diff --git a/lib/axlsx/drawing/hyperlink.rb b/lib/axlsx/drawing/hyperlink.rb index 1fd7fdd4..3fb97069 100644 --- a/lib/axlsx/drawing/hyperlink.rb +++ b/lib/axlsx/drawing/hyperlink.rb @@ -92,7 +92,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag 'a:hlinkClick', str, { :'r:id' => relationship.Id, :'xmlns:r' => XML_NS_R } end end diff --git a/lib/axlsx/drawing/line_3D_chart.rb b/lib/axlsx/drawing/line_3D_chart.rb index 51beaa70..6a659550 100644 --- a/lib/axlsx/drawing/line_3D_chart.rb +++ b/lib/axlsx/drawing/line_3D_chart.rb @@ -57,9 +57,9 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do - str << ('') unless @gap_depth.nil? + str << (+'') unless @gap_depth.nil? end end end diff --git a/lib/axlsx/drawing/line_chart.rb b/lib/axlsx/drawing/line_chart.rb index 87757dbb..ab2012c7 100644 --- a/lib/axlsx/drawing/line_chart.rb +++ b/lib/axlsx/drawing/line_chart.rb @@ -74,16 +74,16 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do - str << ("") - str << ('') - str << ('') + str << (+"") + str << (+'') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } @d_lbls.to_xml_string(str) if @d_lbls yield if block_given? axes.to_xml_string(str, :ids => true) - str << ("") + str << (+"") axes.to_xml_string(str) end end diff --git a/lib/axlsx/drawing/line_series.rb b/lib/axlsx/drawing/line_series.rb index b1e36bbe..42c86873 100644 --- a/lib/axlsx/drawing/line_series.rb +++ b/lib/axlsx/drawing/line_series.rb @@ -71,15 +71,15 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do if color str << '' - str << ('') + str << (+'') str << '' str << '' str << '' - str << ('') + str << (+'') str << '' str << '' str << '' @@ -94,7 +94,7 @@ module Axlsx @labels.to_xml_string(str) unless @labels.nil? @data.to_xml_string(str) unless @data.nil? - str << ('') + str << (+'') end end diff --git a/lib/axlsx/drawing/marker.rb b/lib/axlsx/drawing/marker.rb index 0e728fc6..987af605 100644 --- a/lib/axlsx/drawing/marker.rb +++ b/lib/axlsx/drawing/marker.rb @@ -56,9 +56,9 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') [:col, :colOff, :row, :rowOff].each do |k| - str << ('' << self.send(k).to_s << '') + str << (+'' << self.send(k).to_s << '') end end diff --git a/lib/axlsx/drawing/num_data.rb b/lib/axlsx/drawing/num_data.rb index 5c4e832f..79108777 100644 --- a/lib/axlsx/drawing/num_data.rb +++ b/lib/axlsx/drawing/num_data.rb @@ -36,14 +36,14 @@ module Axlsx end # serialize the object - def to_xml_string(str = "") - str << ('') - str << ('' << format_code.to_s << '') - str << ('') + def to_xml_string(str = +'') + str << (+'') + str << (+'' << format_code.to_s << '') + str << (+'') @pt.each_with_index do |num_val, index| num_val.to_xml_string index, str end - str << ('') + str << (+'') end end end diff --git a/lib/axlsx/drawing/num_data_source.rb b/lib/axlsx/drawing/num_data_source.rb index 0159a9d6..af5e31ab 100644 --- a/lib/axlsx/drawing/num_data_source.rb +++ b/lib/axlsx/drawing/num_data_source.rb @@ -44,17 +44,17 @@ module Axlsx # serialize the object # @param [String] str - def to_xml_string(str = "") - str << ('') + def to_xml_string(str = +'') + str << (+'') if @f - str << ('') - str << ('' << @f.to_s << '') + str << (+'') + str << (+'' << @f.to_s << '') end @data.to_xml_string str if @f - str << ('') + str << (+'') end - str << ('') + str << (+'') end end end diff --git a/lib/axlsx/drawing/num_val.rb b/lib/axlsx/drawing/num_val.rb index 3ec9f87b..b614f561 100644 --- a/lib/axlsx/drawing/num_val.rb +++ b/lib/axlsx/drawing/num_val.rb @@ -23,10 +23,10 @@ module Axlsx end # serialize the object - def to_xml_string(idx, str = "") + def to_xml_string(idx, str = +'') Axlsx::validate_unsigned_int(idx) if !v.to_s.empty? - str << ('' << v.to_s << '') + str << (+'' << v.to_s << '') end end end diff --git a/lib/axlsx/drawing/one_cell_anchor.rb b/lib/axlsx/drawing/one_cell_anchor.rb index d9999be5..f98d65a1 100644 --- a/lib/axlsx/drawing/one_cell_anchor.rb +++ b/lib/axlsx/drawing/one_cell_anchor.rb @@ -74,12 +74,12 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' str << '' from.to_xml_string(str) str << '' - str << ('') + str << (+'') @object.to_xml_string(str) str << '' str << '' diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index 1f37cd0f..eec92a9c 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -189,10 +189,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' str << '' - str << ('') + str << (+'') hyperlink.to_xml_string(str) if hyperlink.is_a?(Hyperlink) str << '' picture_locking.to_xml_string(str) @@ -213,9 +213,9 @@ module Axlsx # Return correct xml relationship string portion def relationship_xml_portion if remote? - ('') + (+'') else - ('') + (+'') end end diff --git a/lib/axlsx/drawing/picture_locking.rb b/lib/axlsx/drawing/picture_locking.rb index 08ac4527..9511cb15 100644 --- a/lib/axlsx/drawing/picture_locking.rb +++ b/lib/axlsx/drawing/picture_locking.rb @@ -34,7 +34,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('a:picLocks', str) end end diff --git a/lib/axlsx/drawing/pie_3D_chart.rb b/lib/axlsx/drawing/pie_3D_chart.rb index be6e3ba7..1c68dbb7 100644 --- a/lib/axlsx/drawing/pie_3D_chart.rb +++ b/lib/axlsx/drawing/pie_3D_chart.rb @@ -31,10 +31,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' - str << ('') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls str << '' diff --git a/lib/axlsx/drawing/pie_series.rb b/lib/axlsx/drawing/pie_series.rb index 9cc50aa2..52cd2b66 100644 --- a/lib/axlsx/drawing/pie_series.rb +++ b/lib/axlsx/drawing/pie_series.rb @@ -44,14 +44,14 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' unless @explosion.nil? colors.each_with_index do |c, index| str << '' - str << ('') + str << (+'') str << '' - str << ('') + str << (+'') str << '' end @labels.to_xml_string str unless @labels.nil? diff --git a/lib/axlsx/drawing/scaling.rb b/lib/axlsx/drawing/scaling.rb index 4443f880..fc4b9d10 100644 --- a/lib/axlsx/drawing/scaling.rb +++ b/lib/axlsx/drawing/scaling.rb @@ -47,12 +47,12 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') unless @logBase.nil? - str << ('') unless @orientation.nil? - str << ('') unless @min.nil? - str << ('') unless @max.nil? + str << (+'') unless @logBase.nil? + str << (+'') unless @orientation.nil? + str << (+'') unless @min.nil? + str << (+'') unless @max.nil? str << '' end end diff --git a/lib/axlsx/drawing/scatter_chart.rb b/lib/axlsx/drawing/scatter_chart.rb index 37d528ec..b518c594 100644 --- a/lib/axlsx/drawing/scatter_chart.rb +++ b/lib/axlsx/drawing/scatter_chart.rb @@ -49,11 +49,11 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do str << '' - str << ('') - str << ('') + str << (+'') + str << (+'') @series.each { |ser| ser.to_xml_string(str) } d_lbls.to_xml_string(str) if @d_lbls axes.to_xml_string(str, :ids => true) diff --git a/lib/axlsx/drawing/scatter_series.rb b/lib/axlsx/drawing/scatter_series.rb index 9ea9b8a7..e52306f5 100644 --- a/lib/axlsx/drawing/scatter_series.rb +++ b/lib/axlsx/drawing/scatter_series.rb @@ -80,22 +80,22 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') super(str) do # needs to override the super color here to push in ln/and something else! if color str << '' - str << ('') + str << (+'') str << '' str << '' - str << ('') + str << (+'') str << '' str << '' str << '' - str << ('') + str << (+'') str << '' str << '' - str << ('') + str << (+'') str << '' str << marker_symbol_xml str << '' @@ -110,7 +110,7 @@ module Axlsx end @xData.to_xml_string(str) unless @xData.nil? @yData.to_xml_string(str) unless @yData.nil? - str << ('') + str << (+'') end str end diff --git a/lib/axlsx/drawing/ser_axis.rb b/lib/axlsx/drawing/ser_axis.rb index 4834c355..63628b14 100644 --- a/lib/axlsx/drawing/ser_axis.rb +++ b/lib/axlsx/drawing/ser_axis.rb @@ -32,11 +32,11 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' super(str) - str << ('') unless @tick_lbl_skip.nil? - str << ('') unless @tick_mark_skip.nil? + str << (+'') unless @tick_lbl_skip.nil? + str << (+'') unless @tick_mark_skip.nil? str << '' end end diff --git a/lib/axlsx/drawing/series.rb b/lib/axlsx/drawing/series.rb index 17c5d24e..a468a6b7 100644 --- a/lib/axlsx/drawing/series.rb +++ b/lib/axlsx/drawing/series.rb @@ -57,10 +57,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') - str << ('') + str << (+'') + str << (+'') title.to_xml_string(str) unless title.nil? yield if block_given? str << '' diff --git a/lib/axlsx/drawing/series_title.rb b/lib/axlsx/drawing/series_title.rb index 124e30a0..2887495c 100644 --- a/lib/axlsx/drawing/series_title.rb +++ b/lib/axlsx/drawing/series_title.rb @@ -6,16 +6,16 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') clean_value = Axlsx::trust_input ? @text.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@text.to_s)) str << '' str << '' - str << ('' << Axlsx::cell_range([@cell]) << '') + str << (+'' << Axlsx::cell_range([@cell]) << '') str << '' str << '' str << '' - str << ('' << clean_value << '') + str << (+'' << clean_value << '') str << '' str << '' str << '' diff --git a/lib/axlsx/drawing/str_data.rb b/lib/axlsx/drawing/str_data.rb index ab1c25ad..0765671f 100644 --- a/lib/axlsx/drawing/str_data.rb +++ b/lib/axlsx/drawing/str_data.rb @@ -27,13 +27,13 @@ module Axlsx end # serialize the object - def to_xml_string(str = "") - str << ('') - str << ('') + def to_xml_string(str = +'') + str << (+'') + str << (+'') @pt.each_with_index do |value, index| value.to_xml_string index, str end - str << ('') + str << (+'') end end end diff --git a/lib/axlsx/drawing/str_val.rb b/lib/axlsx/drawing/str_val.rb index f6d36d41..821c7037 100644 --- a/lib/axlsx/drawing/str_val.rb +++ b/lib/axlsx/drawing/str_val.rb @@ -23,10 +23,10 @@ module Axlsx end # serialize the object - def to_xml_string(idx, str = "") + def to_xml_string(idx, str = +'') Axlsx::validate_unsigned_int(idx) if !v.to_s.empty? - str << ('' << ::CGI.escapeHTML(v.to_s) << '') + str << (+'' << ::CGI.escapeHTML(v.to_s) << '') end end end diff --git a/lib/axlsx/drawing/title.rb b/lib/axlsx/drawing/title.rb index 9fd90d29..7bd41b17 100644 --- a/lib/axlsx/drawing/title.rb +++ b/lib/axlsx/drawing/title.rb @@ -69,18 +69,18 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' unless empty? clean_value = Axlsx::trust_input ? @text.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@text.to_s)) str << '' if @cell.is_a?(Cell) str << '' - str << ('' << Axlsx::cell_range([@cell]) << '') + str << (+'' << Axlsx::cell_range([@cell]) << '') str << '' str << '' str << '' - str << ('' << clean_value << '') + str << (+'' << clean_value << '') str << '' str << '' str << '' @@ -90,8 +90,8 @@ module Axlsx str << '' str << '' str << '' - str << ('') - str << ('' << clean_value << '') + str << (+'') + str << (+'' << clean_value << '') str << '' str << '' str << '' diff --git a/lib/axlsx/drawing/two_cell_anchor.rb b/lib/axlsx/drawing/two_cell_anchor.rb index 7b01ae13..bebfd28c 100644 --- a/lib/axlsx/drawing/two_cell_anchor.rb +++ b/lib/axlsx/drawing/two_cell_anchor.rb @@ -81,7 +81,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' str << '' from.to_xml_string str diff --git a/lib/axlsx/drawing/val_axis.rb b/lib/axlsx/drawing/val_axis.rb index 8ebdcc92..1200eb5d 100644 --- a/lib/axlsx/drawing/val_axis.rb +++ b/lib/axlsx/drawing/val_axis.rb @@ -26,10 +26,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' super(str) - str << ('') + str << (+'') str << '' end end diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index a414b46a..9b1b5cb2 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -96,7 +96,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' %w(rot_x h_percent rot_y depth_percent r_ang_ax perspective).each do |key| str << element_for_attribute(key, 'c') diff --git a/lib/axlsx/drawing/vml_drawing.rb b/lib/axlsx/drawing/vml_drawing.rb index 0805421e..1da4e51a 100644 --- a/lib/axlsx/drawing/vml_drawing.rb +++ b/lib/axlsx/drawing/vml_drawing.rb @@ -20,7 +20,7 @@ module Axlsx # serialize the vml_drawing to xml. # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << <' end diff --git a/lib/axlsx/rels/relationships.rb b/lib/axlsx/rels/relationships.rb index 64126ed7..ec5b16e9 100644 --- a/lib/axlsx/rels/relationships.rb +++ b/lib/axlsx/rels/relationships.rb @@ -21,9 +21,9 @@ module Axlsx # serialize relationships # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') each { |rel| rel.to_xml_string(str) } str << '' end diff --git a/lib/axlsx/stylesheet/border.rb b/lib/axlsx/stylesheet/border.rb index ed172ba8..163479b1 100644 --- a/lib/axlsx/stylesheet/border.rb +++ b/lib/axlsx/stylesheet/border.rb @@ -56,7 +56,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' diff --git a/lib/axlsx/stylesheet/border_pr.rb b/lib/axlsx/stylesheet/border_pr.rb index 8c1d2ede..154b25f4 100644 --- a/lib/axlsx/stylesheet/border_pr.rb +++ b/lib/axlsx/stylesheet/border_pr.rb @@ -62,10 +62,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('<' << @name.to_s << ' style="' << @style.to_s << '">') + def to_xml_string(str = +'') + str << (+'<' << @name.to_s << ' style="' << @style.to_s << '">') @color.to_xml_string(str) if @color.is_a?(Color) - str << ('') + str << (+'') end end end diff --git a/lib/axlsx/stylesheet/cell_alignment.rb b/lib/axlsx/stylesheet/cell_alignment.rb index c5eb383e..4a0c0686 100644 --- a/lib/axlsx/stylesheet/cell_alignment.rb +++ b/lib/axlsx/stylesheet/cell_alignment.rb @@ -119,7 +119,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('alignment', str) end end diff --git a/lib/axlsx/stylesheet/cell_protection.rb b/lib/axlsx/stylesheet/cell_protection.rb index 3c75d509..caa01ced 100644 --- a/lib/axlsx/stylesheet/cell_protection.rb +++ b/lib/axlsx/stylesheet/cell_protection.rb @@ -33,7 +33,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('protection', str) end end diff --git a/lib/axlsx/stylesheet/cell_style.rb b/lib/axlsx/stylesheet/cell_style.rb index 3d198afd..5dc9a90d 100644 --- a/lib/axlsx/stylesheet/cell_style.rb +++ b/lib/axlsx/stylesheet/cell_style.rb @@ -63,7 +63,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('cellStyle', str) end end diff --git a/lib/axlsx/stylesheet/color.rb b/lib/axlsx/stylesheet/color.rb index a1743cb2..47617da5 100644 --- a/lib/axlsx/stylesheet/color.rb +++ b/lib/axlsx/stylesheet/color.rb @@ -72,7 +72,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '', tag_name = 'color') + def to_xml_string(str = +'', tag_name = 'color') serialized_tag('' + tag_name + '', str) end end diff --git a/lib/axlsx/stylesheet/dxf.rb b/lib/axlsx/stylesheet/dxf.rb index 0bbae6ca..8c32a75f 100644 --- a/lib/axlsx/stylesheet/dxf.rb +++ b/lib/axlsx/stylesheet/dxf.rb @@ -64,7 +64,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' # Dxf elements have no attributes. All of the instance variables # are child elements. diff --git a/lib/axlsx/stylesheet/fill.rb b/lib/axlsx/stylesheet/fill.rb index e6561e26..313a24a3 100644 --- a/lib/axlsx/stylesheet/fill.rb +++ b/lib/axlsx/stylesheet/fill.rb @@ -21,7 +21,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' @fill_type.to_xml_string(str) str << '' diff --git a/lib/axlsx/stylesheet/font.rb b/lib/axlsx/stylesheet/font.rb index 920f6f97..463b8fc0 100644 --- a/lib/axlsx/stylesheet/font.rb +++ b/lib/axlsx/stylesheet/font.rb @@ -148,10 +148,10 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' Axlsx.instance_values_for(self).each do |k, v| - v.is_a?(Color) ? v.to_xml_string(str) : (str << ('<' << k.to_s << ' val="' << Axlsx.booleanize(v).to_s << '"/>')) + v.is_a?(Color) ? v.to_xml_string(str) : (str << (+'<' << k.to_s << ' val="' << Axlsx.booleanize(v).to_s << '"/>')) end str << '' end diff --git a/lib/axlsx/stylesheet/gradient_fill.rb b/lib/axlsx/stylesheet/gradient_fill.rb index 1c58c12a..6cd0a052 100644 --- a/lib/axlsx/stylesheet/gradient_fill.rb +++ b/lib/axlsx/stylesheet/gradient_fill.rb @@ -92,7 +92,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' diff --git a/lib/axlsx/stylesheet/gradient_stop.rb b/lib/axlsx/stylesheet/gradient_stop.rb index fd53a41a..83f39a55 100644 --- a/lib/axlsx/stylesheet/gradient_stop.rb +++ b/lib/axlsx/stylesheet/gradient_stop.rb @@ -29,8 +29,8 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') self.color.to_xml_string(str) str << '' end diff --git a/lib/axlsx/stylesheet/num_fmt.rb b/lib/axlsx/stylesheet/num_fmt.rb index 1864fcf2..1a7add0e 100644 --- a/lib/axlsx/stylesheet/num_fmt.rb +++ b/lib/axlsx/stylesheet/num_fmt.rb @@ -69,12 +69,12 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('numFmt', str) end # Override to avoid removing underscores - def serialized_attributes(str = '', additional_attributes = {}) + def serialized_attributes(str = +'', additional_attributes = {}) attributes = declared_attributes.merge! additional_attributes attributes.each do |key, value| str << "#{Axlsx.camel(key, false)}=\"#{Axlsx.booleanize(value)}\" " diff --git a/lib/axlsx/stylesheet/pattern_fill.rb b/lib/axlsx/stylesheet/pattern_fill.rb index 5f89955d..cabce9f5 100644 --- a/lib/axlsx/stylesheet/pattern_fill.rb +++ b/lib/axlsx/stylesheet/pattern_fill.rb @@ -58,8 +58,8 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') if fgColor.is_a?(Color) fgColor.to_xml_string str, "fgColor" end diff --git a/lib/axlsx/stylesheet/styles.rb b/lib/axlsx/stylesheet/styles.rb index 3cbe8f75..809630f2 100644 --- a/lib/axlsx/stylesheet/styles.rb +++ b/lib/axlsx/stylesheet/styles.rb @@ -485,8 +485,8 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') instance_vals = Axlsx.instance_values_for(self) [:numFmts, :fonts, :fills, :borders, :cellStyleXfs, :cellXfs, :cellStyles, :dxfs, :tableStyles].each do |key| instance_vals[key.to_s].to_xml_string(str) unless instance_vals[key.to_s].nil? diff --git a/lib/axlsx/stylesheet/table_style.rb b/lib/axlsx/stylesheet/table_style.rb index 24c441ce..4423c518 100644 --- a/lib/axlsx/stylesheet/table_style.rb +++ b/lib/axlsx/stylesheet/table_style.rb @@ -42,7 +42,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << ' self.size } str << '>' diff --git a/lib/axlsx/stylesheet/table_style_element.rb b/lib/axlsx/stylesheet/table_style_element.rb index c36ab838..2e64d9a3 100644 --- a/lib/axlsx/stylesheet/table_style_element.rb +++ b/lib/axlsx/stylesheet/table_style_element.rb @@ -69,7 +69,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('tableStyleElement', str) end end diff --git a/lib/axlsx/stylesheet/table_styles.rb b/lib/axlsx/stylesheet/table_styles.rb index 16cc7320..49f6e601 100644 --- a/lib/axlsx/stylesheet/table_styles.rb +++ b/lib/axlsx/stylesheet/table_styles.rb @@ -33,7 +33,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << ' self.size } str << '>' diff --git a/lib/axlsx/stylesheet/xf.rb b/lib/axlsx/stylesheet/xf.rb index d42880e0..45d362ca 100644 --- a/lib/axlsx/stylesheet/xf.rb +++ b/lib/axlsx/stylesheet/xf.rb @@ -134,7 +134,7 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' diff --git a/lib/axlsx/util/serialized_attributes.rb b/lib/axlsx/util/serialized_attributes.rb index 04b33fa5..b7247e0d 100644 --- a/lib/axlsx/util/serialized_attributes.rb +++ b/lib/axlsx/util/serialized_attributes.rb @@ -49,7 +49,7 @@ module Axlsx # serialization to. # @param [Hash] additional_attributes An option key value hash for # defining values that are not serializable attributes list. - def serialized_attributes(str = '', additional_attributes = {}) + def serialized_attributes(str = +'', additional_attributes = {}) attributes = declared_attributes.merge! additional_attributes attributes.each do |key, value| str << "#{Axlsx.camel(key, false)}=\"#{Axlsx.camel(Axlsx.booleanize(value), false)}\" " @@ -73,7 +73,7 @@ module Axlsx # @param [String] str The string instance to which serialized data is appended # @param [Array] additional_attributes An array of additional attribute names. # @return [String] The serialized output. - def serialized_element_attributes(str = '', additional_attributes = [], &block) + def serialized_element_attributes(str = +'', additional_attributes = [], &block) attrs = self.class.xml_element_attributes + additional_attributes values = Axlsx.instance_values_for(self) attrs.each do |attribute_name| diff --git a/lib/axlsx/util/simple_typed_list.rb b/lib/axlsx/util/simple_typed_list.rb index 1a8bbbec..2bd6b648 100644 --- a/lib/axlsx/util/simple_typed_list.rb +++ b/lib/axlsx/util/simple_typed_list.rb @@ -171,12 +171,12 @@ module Axlsx }, __FILE__, __LINE__ - 4 end - def to_xml_string(str = '') + def to_xml_string(str = +'') classname = @allowed_types[0].name.split('::').last el_name = serialize_as.to_s || (classname[0, 1].downcase + classname[1..-1]) - str << ('<' << el_name << ' count="' << size.to_s << '">') + str << (+'<' << el_name << ' count="' << size.to_s << '">') each { |item| item.to_xml_string(str) } - str << ('') + str << (+'') end end end diff --git a/lib/axlsx/workbook/defined_name.rb b/lib/axlsx/workbook/defined_name.rb index bcba47ee..4ddcff2c 100644 --- a/lib/axlsx/workbook/defined_name.rb +++ b/lib/axlsx/workbook/defined_name.rb @@ -120,12 +120,12 @@ module Axlsx serializable_attributes :short_cut_key, :status_bar, :help, :description, :custom_menu, :comment, :workbook_parameter, :publish_to_server, :xlm, :vb_proceedure, :function, :hidden, :local_sheet_id - def to_xml_string(str = '') + def to_xml_string(str = +'') raise ArgumentError, 'you must specify the name for this defined name. Please read the documentation for Axlsx::DefinedName for more details' unless name - str << ('' << @formula << '') + str << (+'>' << @formula << '') end end end diff --git a/lib/axlsx/workbook/defined_names.rb b/lib/axlsx/workbook/defined_names.rb index 9da776fd..e59acf4b 100644 --- a/lib/axlsx/workbook/defined_names.rb +++ b/lib/axlsx/workbook/defined_names.rb @@ -11,7 +11,7 @@ module Axlsx # Serialize to xml # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << '' diff --git a/lib/axlsx/workbook/shared_strings_table.rb b/lib/axlsx/workbook/shared_strings_table.rb index f0cbf04d..17007b08 100644 --- a/lib/axlsx/workbook/shared_strings_table.rb +++ b/lib/axlsx/workbook/shared_strings_table.rb @@ -36,7 +36,7 @@ module Axlsx @index = 0 @xml_space = xml_space @unique_cells = {} - @shared_xml_string = "" + @shared_xml_string = +'' shareable_cells = cells.flatten.select { |cell| cell.plain_string? || cell.contains_rich_text? } @count = shareable_cells.size resolve(shareable_cells) @@ -45,11 +45,11 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') Axlsx::sanitize(@shared_xml_string) - str << ('' << @shared_xml_string << '') + str << (+'' << @shared_xml_string << '') end private diff --git a/lib/axlsx/workbook/workbook.rb b/lib/axlsx/workbook/workbook.rb index bd70a836..ab16a4ed 100644 --- a/lib/axlsx/workbook/workbook.rb +++ b/lib/axlsx/workbook/workbook.rb @@ -405,11 +405,11 @@ module Axlsx # Serialize the workbook # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') add_worksheet(name: 'Sheet1') unless worksheets.size > 0 str << '' - str << ('') - str << ('') + str << (+'') + str << (+'') views.to_xml_string(str) str << '' if is_reversed @@ -422,7 +422,7 @@ module Axlsx unless pivot_tables.empty? str << '' pivot_tables.each do |pivot_table| - str << ('') + str << (+'') end str << '' end diff --git a/lib/axlsx/workbook/workbook_view.rb b/lib/axlsx/workbook/workbook_view.rb index e992a65e..398563f9 100644 --- a/lib/axlsx/workbook/workbook_view.rb +++ b/lib/axlsx/workbook/workbook_view.rb @@ -68,7 +68,7 @@ module Axlsx # Serialize the WorkbookView # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' diff --git a/lib/axlsx/workbook/workbook_views.rb b/lib/axlsx/workbook/workbook_views.rb index 569533f8..45d146f1 100644 --- a/lib/axlsx/workbook/workbook_views.rb +++ b/lib/axlsx/workbook/workbook_views.rb @@ -11,7 +11,7 @@ module Axlsx # Serialize to xml # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << "" diff --git a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb index 156d4ae8..5a74d79a 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/auto_filter.rb @@ -69,7 +69,7 @@ module Axlsx # serialize the object # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return unless range str << "" diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb index 92884e97..f014eb18 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb @@ -87,7 +87,7 @@ module Axlsx end # Serialize the object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" @filter.to_xml_string(str) str << "" diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb index 77cf7b17..0fc5c968 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb @@ -76,7 +76,7 @@ module Axlsx end # Serialize the object to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" filter_items.each { |filter| filter.to_xml_string(str) } date_group_items.each { |date_group_item| date_group_item.to_xml_string(str) } @@ -120,7 +120,7 @@ module Axlsx # Serializes the filter value object # @param [String] str The string to concact the serialization information to. - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" end end @@ -237,7 +237,7 @@ module Axlsx # Serialize the object to xml # @param [String] str The string object this serialization will be concatenated to. - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('dateGroupItem', str) end end diff --git a/lib/axlsx/workbook/worksheet/break.rb b/lib/axlsx/workbook/worksheet/break.rb index c40503be..ca99a661 100644 --- a/lib/axlsx/workbook/worksheet/break.rb +++ b/lib/axlsx/workbook/worksheet/break.rb @@ -27,7 +27,7 @@ module Axlsx serializable_attributes :id, :min, :max, :man, :pt # serializes the break to xml - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('brk', str) end end diff --git a/lib/axlsx/workbook/worksheet/cell.rb b/lib/axlsx/workbook/worksheet/cell.rb index 930356e5..929a7c28 100644 --- a/lib/axlsx/workbook/worksheet/cell.rb +++ b/lib/axlsx/workbook/worksheet/cell.rb @@ -388,7 +388,7 @@ module Axlsx # @param [Integer] c_index The cell index in the row. # @param [String] str The string index the cell content will be appended to. Defaults to empty string. # @return [String] xml text for the cell - def to_xml_string(r_index, c_index, str = '') + def to_xml_string(r_index, c_index, str = +'') CellSerializer.to_xml_string r_index, c_index, self, str end diff --git a/lib/axlsx/workbook/worksheet/cell_serializer.rb b/lib/axlsx/workbook/worksheet/cell_serializer.rb index 3c8f87dc..b4c16b57 100644 --- a/lib/axlsx/workbook/worksheet/cell_serializer.rb +++ b/lib/axlsx/workbook/worksheet/cell_serializer.rb @@ -9,8 +9,8 @@ module Axlsx # @param [Integer] column_index The index of the cell's column # @param [String] str The string to apend serialization to. # @return [String] - def to_xml_string(row_index, column_index, cell, str = '') - str << ('' if cell.value.nil? method = cell.type @@ -21,7 +21,7 @@ module Axlsx # builds an xml text run based on this cells attributes. # @param [String] str The string instance this run will be concated to. # @return [String] - def run_xml_string(cell, str = '') + def run_xml_string(cell, str = +'') if cell.is_text_run? valid = RichTextRun::INLINE_STYLES - [:value, :type] data = Hash[Axlsx.instance_values_for(cell).map { |k, v| [k.to_sym, v] }] @@ -30,7 +30,7 @@ module Axlsx elsif cell.contains_rich_text? cell.value.to_xml_string(str) else - str << ('' << cell.clean_value << '') + str << (+'' << cell.clean_value << '') end str end @@ -39,7 +39,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def iso_8601(cell, str = '') + def iso_8601(cell, str = +'') value_serialization 'd', cell.value, str end @@ -47,7 +47,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def date(cell, str = '') + def date(cell, str = +'') value_serialization false, DateTimeConverter::date_to_serial(cell.value).to_s, str end @@ -55,7 +55,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def time(cell, str = '') + def time(cell, str = +'') value_serialization false, DateTimeConverter::time_to_serial(cell.value).to_s, str end @@ -63,7 +63,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def boolean(cell, str = '') + def boolean(cell, str = +'') value_serialization 'b', cell.value.to_s, str end @@ -71,7 +71,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def float(cell, str = '') + def float(cell, str = +'') numeric cell, str end @@ -79,7 +79,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def integer(cell, str = '') + def integer(cell, str = +'') numeric cell, str end @@ -87,25 +87,25 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def formula_serialization(cell, str = '') - str << ('t="str">' << cell.clean_value.to_s.sub('=', '') << '') - str << ('' << cell.formula_value.to_s << '') unless cell.formula_value.nil? + def formula_serialization(cell, str = +'') + str << (+'t="str">' << cell.clean_value.to_s.sub('=', '') << '') + str << (+'' << cell.formula_value.to_s << '') unless cell.formula_value.nil? end # Serializes cells that are type array formula # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def array_formula_serialization(cell, str = '') - str << ('t="str">' << '' << cell.clean_value.to_s.sub('{=', '').sub(/}$/, '') << '') - str << ('' << cell.formula_value.to_s << '') unless cell.formula_value.nil? + def array_formula_serialization(cell, str = +'') + str << (+'t="str">' << '' << cell.clean_value.to_s.sub('{=', '').sub(/}$/, '') << '') + str << (+'' << cell.formula_value.to_s << '') unless cell.formula_value.nil? end # Serializes cells that are type inline_string # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def inline_string_serialization(cell, str = '') + def inline_string_serialization(cell, str = +'') str << 't="inlineStr">' run_xml_string cell, str str << '' @@ -115,7 +115,7 @@ module Axlsx # @param [Cell] cell The cell that is being serialized # @param [String] str The string the serialized content will be appended to. # @return [String] - def string(cell, str = '') + def string(cell, str = +'') if cell.is_array_formula? array_formula_serialization cell, str elsif cell.is_formula? @@ -153,13 +153,13 @@ module Axlsx private - def numeric(cell, str = '') + def numeric(cell, str = +'') value_serialization 'n', cell.value, str end - def value_serialization(serialization_type, serialization_value, str = '') - str << ('t="' << serialization_type.to_s << '"') if serialization_type - str << ('>' << serialization_value.to_s << '') + def value_serialization(serialization_type, serialization_value, str = +'') + str << (+'t="' << serialization_type.to_s << '"') if serialization_type + str << (+'>' << serialization_value.to_s << '') end end end diff --git a/lib/axlsx/workbook/worksheet/cfvo.rb b/lib/axlsx/workbook/worksheet/cfvo.rb index 7feb933d..9aeb55ed 100644 --- a/lib/axlsx/workbook/worksheet/cfvo.rb +++ b/lib/axlsx/workbook/worksheet/cfvo.rb @@ -55,7 +55,7 @@ module Axlsx # serialize the Csvo object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('cfvo', str) end end diff --git a/lib/axlsx/workbook/worksheet/cfvos.rb b/lib/axlsx/workbook/worksheet/cfvos.rb index 5115577a..3c41953a 100644 --- a/lib/axlsx/workbook/worksheet/cfvos.rb +++ b/lib/axlsx/workbook/worksheet/cfvos.rb @@ -11,7 +11,7 @@ module Axlsx # Serialize the Cfvo object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') each { |cfvo| cfvo.to_xml_string(str) } end end diff --git a/lib/axlsx/workbook/worksheet/col.rb b/lib/axlsx/workbook/worksheet/col.rb index 10d421e8..539a6007 100644 --- a/lib/axlsx/workbook/worksheet/col.rb +++ b/lib/axlsx/workbook/worksheet/col.rb @@ -137,7 +137,7 @@ module Axlsx # Serialize this columns data to an xml string # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('col', str) end end diff --git a/lib/axlsx/workbook/worksheet/col_breaks.rb b/lib/axlsx/workbook/worksheet/col_breaks.rb index 4a7b7f94..2e176f0d 100644 --- a/lib/axlsx/workbook/worksheet/col_breaks.rb +++ b/lib/axlsx/workbook/worksheet/col_breaks.rb @@ -25,10 +25,10 @@ module Axlsx # # # - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? - str << ('') + str << (+'') each { |brk| brk.to_xml_string(str) } str << '' end diff --git a/lib/axlsx/workbook/worksheet/color_scale.rb b/lib/axlsx/workbook/worksheet/color_scale.rb index 222e2f4d..fb84668b 100644 --- a/lib/axlsx/workbook/worksheet/color_scale.rb +++ b/lib/axlsx/workbook/worksheet/color_scale.rb @@ -84,7 +84,7 @@ module Axlsx # Serialize this color_scale object data to an xml string # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' value_objects.to_xml_string(str) colors.each { |color| color.to_xml_string(str) } diff --git a/lib/axlsx/workbook/worksheet/cols.rb b/lib/axlsx/workbook/worksheet/cols.rb index 76e0fbf7..7dd3f175 100644 --- a/lib/axlsx/workbook/worksheet/cols.rb +++ b/lib/axlsx/workbook/worksheet/cols.rb @@ -14,7 +14,7 @@ module Axlsx # Serialize the Cols object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << '' diff --git a/lib/axlsx/workbook/worksheet/comment.rb b/lib/axlsx/workbook/worksheet/comment.rb index b0fd3e3b..1da779aa 100644 --- a/lib/axlsx/workbook/worksheet/comment.rb +++ b/lib/axlsx/workbook/worksheet/comment.rb @@ -61,17 +61,17 @@ module Axlsx # serialize the object # @param [String] str # @return [String] - def to_xml_string(str = "") + def to_xml_string(str = +'') author = @comments.authors[author_index] - str << ('') + str << (+'') str << '' unless author.to_s == "" str << '' - str << ("" << ::CGI.escapeHTML(author.to_s) << ":\n") + str << (+"" << ::CGI.escapeHTML(author.to_s) << ":\n") end str << '' str << '' - str << ('' << ::CGI.escapeHTML(text) << '') + str << (+'' << ::CGI.escapeHTML(text) << '') str << '' end diff --git a/lib/axlsx/workbook/worksheet/comments.rb b/lib/axlsx/workbook/worksheet/comments.rb index 020b29f5..b121ccd7 100644 --- a/lib/axlsx/workbook/worksheet/comments.rb +++ b/lib/axlsx/workbook/worksheet/comments.rb @@ -64,11 +64,11 @@ module Axlsx # serialize the object # @param [String] str # @return [String] - def to_xml_string(str = "") + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') authors.each do |author| - str << ('' << author.to_s << '') + str << (+'' << author.to_s << '') end str << '' each do |comment| diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting.rb b/lib/axlsx/workbook/worksheet/conditional_formatting.rb index d6293ca8..bd5f5bc6 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting.rb @@ -74,8 +74,8 @@ module Axlsx # # @param [String] str # @return [String] - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') str << rules.collect { |rule| rule.to_xml_string }.join(' ') str << '' end diff --git a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb index d3693d7e..1845f327 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formatting_rule.rb @@ -204,11 +204,11 @@ module Axlsx # Serializes the conditional formatting rule # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('' << [*self.formula].join('') << '') if @formula + str << (+'' << [*self.formula].join('') << '') if @formula @color_scale.to_xml_string(str) if @color_scale && @type == :colorScale @data_bar.to_xml_string(str) if @data_bar && @type == :dataBar @icon_set.to_xml_string(str) if @icon_set && @type == :iconSet diff --git a/lib/axlsx/workbook/worksheet/conditional_formattings.rb b/lib/axlsx/workbook/worksheet/conditional_formattings.rb index ba8c02a3..16ee1e99 100644 --- a/lib/axlsx/workbook/worksheet/conditional_formattings.rb +++ b/lib/axlsx/workbook/worksheet/conditional_formattings.rb @@ -16,7 +16,7 @@ module Axlsx attr_reader :worksheet # serialize the conditional formattings - def to_xml_string(str = "") + def to_xml_string(str = +'') return if empty? each { |item| item.to_xml_string(str) } diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb index 0e505637..108a5c16 100644 --- a/lib/axlsx/workbook/worksheet/data_bar.rb +++ b/lib/axlsx/workbook/worksheet/data_bar.rb @@ -107,7 +107,7 @@ module Axlsx # Serialize this object to an xml string # @param [String] str # @return [String] - def to_xml_string(str = "") + def to_xml_string(str = +'') serialized_tag('dataBar', str) do value_objects.to_xml_string(str) self.color.to_xml_string(str) diff --git a/lib/axlsx/workbook/worksheet/data_validation.rb b/lib/axlsx/workbook/worksheet/data_validation.rb index 82868071..1b9cb46a 100644 --- a/lib/axlsx/workbook/worksheet/data_validation.rb +++ b/lib/axlsx/workbook/worksheet/data_validation.rb @@ -233,16 +233,16 @@ module Axlsx # Serializes the data validation # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') valid_attributes = get_valid_attributes str << '' - str << ('' << self.formula1 << '') if @formula1 and valid_attributes.include?(:formula1) - str << ('' << self.formula2 << '') if @formula2 and valid_attributes.include?(:formula2) + str << (+'' << self.formula1 << '') if @formula1 and valid_attributes.include?(:formula1) + str << (+'' << self.formula2 << '') if @formula2 and valid_attributes.include?(:formula2) str << '' end diff --git a/lib/axlsx/workbook/worksheet/data_validations.rb b/lib/axlsx/workbook/worksheet/data_validations.rb index dd5f11b9..a8c2a5b3 100644 --- a/lib/axlsx/workbook/worksheet/data_validations.rb +++ b/lib/axlsx/workbook/worksheet/data_validations.rb @@ -16,7 +16,7 @@ module Axlsx attr_reader :worksheet # serialize the conditional formattings - def to_xml_string(str = "") + def to_xml_string(str = +'') return if empty? str << "" diff --git a/lib/axlsx/workbook/worksheet/dimension.rb b/lib/axlsx/workbook/worksheet/dimension.rb index 356c0396..42e02e72 100644 --- a/lib/axlsx/workbook/worksheet/dimension.rb +++ b/lib/axlsx/workbook/worksheet/dimension.rb @@ -36,7 +36,7 @@ module Axlsx # serialize the object # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if worksheet.rows.empty? str << "" % sqref diff --git a/lib/axlsx/workbook/worksheet/header_footer.rb b/lib/axlsx/workbook/worksheet/header_footer.rb index b80f4eeb..c60d6678 100644 --- a/lib/axlsx/workbook/worksheet/header_footer.rb +++ b/lib/axlsx/workbook/worksheet/header_footer.rb @@ -42,7 +42,7 @@ module Axlsx # Serializes the header/footer object. # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('headerFooter', str) do serialized_element_attributes(str) do |value| value = ::CGI.escapeHTML(value) diff --git a/lib/axlsx/workbook/worksheet/icon_set.rb b/lib/axlsx/workbook/worksheet/icon_set.rb index 0179cc5f..c4b5f2ff 100644 --- a/lib/axlsx/workbook/worksheet/icon_set.rb +++ b/lib/axlsx/workbook/worksheet/icon_set.rb @@ -63,7 +63,7 @@ module Axlsx # Serialize this object to an xml string # @param [String] str # @return [String] - def to_xml_string(str = "") + def to_xml_string(str = +'') serialized_tag('iconSet', str) do @value_objects.each { |cfvo| cfvo.to_xml_string(str) } end diff --git a/lib/axlsx/workbook/worksheet/merged_cells.rb b/lib/axlsx/workbook/worksheet/merged_cells.rb index 5ecb1a4e..c0ca1ebe 100644 --- a/lib/axlsx/workbook/worksheet/merged_cells.rb +++ b/lib/axlsx/workbook/worksheet/merged_cells.rb @@ -28,7 +28,7 @@ module Axlsx # serialize the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << "" diff --git a/lib/axlsx/workbook/worksheet/outline_pr.rb b/lib/axlsx/workbook/worksheet/outline_pr.rb index fc301a76..4cfeea2d 100644 --- a/lib/axlsx/workbook/worksheet/outline_pr.rb +++ b/lib/axlsx/workbook/worksheet/outline_pr.rb @@ -27,7 +27,7 @@ module Axlsx # Serialize the object # @param [String] str serialized output will be appended to this object if provided. # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" end end diff --git a/lib/axlsx/workbook/worksheet/page_margins.rb b/lib/axlsx/workbook/worksheet/page_margins.rb index 1e4a34e0..4d133c5a 100644 --- a/lib/axlsx/workbook/worksheet/page_margins.rb +++ b/lib/axlsx/workbook/worksheet/page_margins.rb @@ -92,7 +92,7 @@ module Axlsx # @return [String] # @note For compatibility, this is a noop unless custom margins have been specified. # @see #custom_margins_specified? - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('pageMargins', str) end end diff --git a/lib/axlsx/workbook/worksheet/page_set_up_pr.rb b/lib/axlsx/workbook/worksheet/page_set_up_pr.rb index d1c62c9e..9a2b778b 100644 --- a/lib/axlsx/workbook/worksheet/page_set_up_pr.rb +++ b/lib/axlsx/workbook/worksheet/page_set_up_pr.rb @@ -37,8 +37,8 @@ module Axlsx end # serialize to xml - def to_xml_string(str = '') - str << ('') + def to_xml_string(str = +'') + str << (+'') end end end diff --git a/lib/axlsx/workbook/worksheet/page_setup.rb b/lib/axlsx/workbook/worksheet/page_setup.rb index fa49142d..0bd0cdb8 100644 --- a/lib/axlsx/workbook/worksheet/page_setup.rb +++ b/lib/axlsx/workbook/worksheet/page_setup.rb @@ -232,7 +232,7 @@ module Axlsx # Serializes the page settings element. # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('pageSetup', str) end end diff --git a/lib/axlsx/workbook/worksheet/pane.rb b/lib/axlsx/workbook/worksheet/pane.rb index f88b732c..a018dc74 100644 --- a/lib/axlsx/workbook/worksheet/pane.rb +++ b/lib/axlsx/workbook/worksheet/pane.rb @@ -122,7 +122,7 @@ module Axlsx # Serializes the data validation # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') finalize serialized_tag 'pane', str end diff --git a/lib/axlsx/workbook/worksheet/pivot_table.rb b/lib/axlsx/workbook/worksheet/pivot_table.rb index 8c6cb83e..e97b8119 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table.rb @@ -186,13 +186,13 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') - str << ('') - str << ('') + str << (+'') + str << (+'') header_cell_values.each do |cell_value| subtotal = !no_subtotals_on_headers.include?(cell_value) @@ -205,12 +205,12 @@ module Axlsx str << '' str << ' ' else - str << ('') + str << (+'') rows.each do |row_value| - str << ('') + str << (+'') end str << '' - str << ('') + str << (+'') rows.size.times do |i| str << '' end @@ -229,16 +229,16 @@ module Axlsx str << '' end else - str << ('') + str << (+'') columns.each do |column_value| - str << ('') + str << (+'') end str << '' end unless pages.empty? - str << ('') + str << (+'') pages.each do |page_value| - str << ('') + str << (+'') end str << '' end diff --git a/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb b/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb index 136e756e..d42c1fda 100644 --- a/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb +++ b/lib/axlsx/workbook/worksheet/pivot_table_cache_definition.rb @@ -45,15 +45,15 @@ module Axlsx # Serializes the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' - str << ('') + str << (+'') str << '' - str << ('') + str << (+'') str << '' - str << ('') + str << (+'') pivot_table.header_cells.each do |cell| - str << ('') + str << (+'') str << '' str << '' str << '' diff --git a/lib/axlsx/workbook/worksheet/print_options.rb b/lib/axlsx/workbook/worksheet/print_options.rb index e2c73bfa..6e1b2bfd 100644 --- a/lib/axlsx/workbook/worksheet/print_options.rb +++ b/lib/axlsx/workbook/worksheet/print_options.rb @@ -33,7 +33,7 @@ module Axlsx # @note As all attributes default to "false" according to the xml schema definition, the generated xml includes only those attributes that are set to true. # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag 'printOptions', str end end diff --git a/lib/axlsx/workbook/worksheet/protected_range.rb b/lib/axlsx/workbook/worksheet/protected_range.rb index ac7d96f1..64a5795c 100644 --- a/lib/axlsx/workbook/worksheet/protected_range.rb +++ b/lib/axlsx/workbook/worksheet/protected_range.rb @@ -41,7 +41,7 @@ module Axlsx # @param [String] str if this string object is provided we append # our output to that object. Use this - it helps limit the number of # objects created during serialization - def to_xml_string(str = "") + def to_xml_string(str = +'') serialized_tag 'protectedRange', str end end diff --git a/lib/axlsx/workbook/worksheet/protected_ranges.rb b/lib/axlsx/workbook/worksheet/protected_ranges.rb index 1d214d3b..f8ce82c5 100644 --- a/lib/axlsx/workbook/worksheet/protected_ranges.rb +++ b/lib/axlsx/workbook/worksheet/protected_ranges.rb @@ -28,7 +28,7 @@ module Axlsx # Serializes the protected ranges # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << '' diff --git a/lib/axlsx/workbook/worksheet/rich_text.rb b/lib/axlsx/workbook/worksheet/rich_text.rb index 13febb0a..e1a3ad4b 100644 --- a/lib/axlsx/workbook/worksheet/rich_text.rb +++ b/lib/axlsx/workbook/worksheet/rich_text.rb @@ -47,7 +47,7 @@ module Axlsx # renders the RichTextRuns in this collection # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') each { |run| run.to_xml_string(str) } str end diff --git a/lib/axlsx/workbook/worksheet/rich_text_run.rb b/lib/axlsx/workbook/worksheet/rich_text_run.rb index 9b61806c..ee988318 100644 --- a/lib/axlsx/workbook/worksheet/rich_text_run.rb +++ b/lib/axlsx/workbook/worksheet/rich_text_run.rb @@ -205,7 +205,7 @@ module Axlsx # Serializes the RichTextRun # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') valid = RichTextRun::INLINE_STYLES data = Hash[Axlsx.instance_values_for(self).map { |k, v| [k.to_sym, v] }] data = data.select { |key, value| valid.include?(key) && !value.nil? } @@ -214,15 +214,15 @@ module Axlsx data.keys.each do |key| case key when :font_name - str << ('') + str << (+'') when :color str << data[key].to_xml_string else - str << ('<' << key.to_s << ' val="' << xml_value(data[key]) << '"/>') + str << (+'<' << key.to_s << ' val="' << xml_value(data[key]) << '"/>') end end clean_value = Axlsx::trust_input ? @value.to_s : ::CGI.escapeHTML(Axlsx::sanitize(@value.to_s)) - str << ('' << clean_value << '') + str << (+'' << clean_value << '') end private diff --git a/lib/axlsx/workbook/worksheet/row.rb b/lib/axlsx/workbook/worksheet/row.rb index 50326aba..0c139164 100644 --- a/lib/axlsx/workbook/worksheet/row.rb +++ b/lib/axlsx/workbook/worksheet/row.rb @@ -88,10 +88,9 @@ module Axlsx # @param [Integer] r_index The row index, 0 based. # @param [String] str The string this rows xml will be appended to. # @return [String] - def to_xml_string(r_index, str = '') + def to_xml_string(r_index, str = +'') serialized_tag('row', str, :r => r_index + 1) do - tmp = '' # time / memory tradeoff, lots of calls to rubyzip costs more - # time.. + tmp = +'' # time / memory tradeoff, lots of calls to rubyzip costs more time.. each_with_index { |cell, c_index| cell.to_xml_string(r_index, c_index, tmp) } str << tmp end diff --git a/lib/axlsx/workbook/worksheet/row_breaks.rb b/lib/axlsx/workbook/worksheet/row_breaks.rb index 6d1b17c8..3e945b78 100644 --- a/lib/axlsx/workbook/worksheet/row_breaks.rb +++ b/lib/axlsx/workbook/worksheet/row_breaks.rb @@ -23,10 +23,10 @@ module Axlsx # # # - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? - str << ('') + str << (+'') each { |brk| brk.to_xml_string(str) } str << '' end diff --git a/lib/axlsx/workbook/worksheet/selection.rb b/lib/axlsx/workbook/worksheet/selection.rb index 377c0b25..556651e3 100644 --- a/lib/axlsx/workbook/worksheet/selection.rb +++ b/lib/axlsx/workbook/worksheet/selection.rb @@ -94,7 +94,7 @@ module Axlsx # Serializes the data validation # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag 'selection', str end end diff --git a/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb b/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb index bb78f92e..e85cbf2c 100644 --- a/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_calc_pr.rb @@ -23,7 +23,7 @@ module Axlsx # @param [String] str the string to append this objects serialized # content to. # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" end end diff --git a/lib/axlsx/workbook/worksheet/sheet_data.rb b/lib/axlsx/workbook/worksheet/sheet_data.rb index 1531d5bf..611da1aa 100644 --- a/lib/axlsx/workbook/worksheet/sheet_data.rb +++ b/lib/axlsx/workbook/worksheet/sheet_data.rb @@ -16,7 +16,7 @@ module Axlsx # Serialize the sheet data # @param [String] str the string this objects serializaton will be concacted to. # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' worksheet.rows.each_with_index do |row, index| row.to_xml_string(index, str) diff --git a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb index e9ef8f33..227b9037 100644 --- a/lib/axlsx/workbook/worksheet/sheet_format_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_format_pr.rb @@ -48,7 +48,7 @@ module Axlsx # serializes this object to an xml string # @param [String] str The string this objects serialization will be appended to # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << "" end diff --git a/lib/axlsx/workbook/worksheet/sheet_pr.rb b/lib/axlsx/workbook/worksheet/sheet_pr.rb index 3bbb88d4..f90e7d6c 100644 --- a/lib/axlsx/workbook/worksheet/sheet_pr.rb +++ b/lib/axlsx/workbook/worksheet/sheet_pr.rb @@ -50,7 +50,7 @@ module Axlsx # Serialize the object # @param [String] str serialized output will be appended to this object if provided. # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') update_properties str << "" tab_color.to_xml_string(str, 'tabColor') if tab_color diff --git a/lib/axlsx/workbook/worksheet/sheet_protection.rb b/lib/axlsx/workbook/worksheet/sheet_protection.rb index 1b9aff14..faf34f97 100644 --- a/lib/axlsx/workbook/worksheet/sheet_protection.rb +++ b/lib/axlsx/workbook/worksheet/sheet_protection.rb @@ -75,7 +75,7 @@ module Axlsx # Serialize the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('sheetProtection', str) end diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb index 38b9593a..d06715fe 100644 --- a/lib/axlsx/workbook/worksheet/sheet_view.rb +++ b/lib/axlsx/workbook/worksheet/sheet_view.rb @@ -192,7 +192,7 @@ module Axlsx # Serializes the data validation # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' str << '' - str << ('') - str << ('') - str << ('') + str << (+'
') + str << (+'') + str << (+'') header_cells.each_with_index do |cell, index| - str << ('') + str << (+'') end str << '' table_style_info.to_xml_string(str) diff --git a/lib/axlsx/workbook/worksheet/table_style_info.rb b/lib/axlsx/workbook/worksheet/table_style_info.rb index 1af61d9f..3793d488 100644 --- a/lib/axlsx/workbook/worksheet/table_style_info.rb +++ b/lib/axlsx/workbook/worksheet/table_style_info.rb @@ -43,7 +43,7 @@ module Axlsx # seralizes this object to an xml string # @param [String] str the string to contact this objects serialization to. - def to_xml_string(str = '') + def to_xml_string(str = +'') serialized_tag('tableStyleInfo', str) end end diff --git a/lib/axlsx/workbook/worksheet/tables.rb b/lib/axlsx/workbook/worksheet/tables.rb index 41d3c658..121a0d7f 100644 --- a/lib/axlsx/workbook/worksheet/tables.rb +++ b/lib/axlsx/workbook/worksheet/tables.rb @@ -25,7 +25,7 @@ module Axlsx # renders the tables xml # @param [String] str # @return [String] - def to_xml_string(str = "") + def to_xml_string(str = +'') return if empty? str << "" diff --git a/lib/axlsx/workbook/worksheet/worksheet.rb b/lib/axlsx/workbook/worksheet/worksheet.rb index 1e8bf2e3..0a44027f 100644 --- a/lib/axlsx/workbook/worksheet/worksheet.rb +++ b/lib/axlsx/workbook/worksheet/worksheet.rb @@ -628,18 +628,18 @@ module Axlsx end # Returns a sheet node serialization for this sheet in the workbook. - def to_sheet_node_xml_string(str = '') + def to_sheet_node_xml_string(str = +'') add_autofilter_defined_name_to_workbook str << '') + str << (+'name="' << name << '" ') + str << (+'r:id="' << rId << '">') end # Serializes the worksheet object to an xml string # This intentionally does not use nokogiri for performance reasons # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') add_autofilter_defined_name_to_workbook auto_filter.apply if auto_filter.range str << '' diff --git a/lib/axlsx/workbook/worksheet/worksheet_comments.rb b/lib/axlsx/workbook/worksheet/worksheet_comments.rb index 0f0355e7..c5f5ad13 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_comments.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_comments.rb @@ -51,7 +51,7 @@ module Axlsx # Seraalize the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return unless has_comments? str << "" diff --git a/lib/axlsx/workbook/worksheet/worksheet_drawing.rb b/lib/axlsx/workbook/worksheet/worksheet_drawing.rb index ce7edc7c..18c7189a 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_drawing.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_drawing.rb @@ -52,7 +52,7 @@ module Axlsx # Serialize the drawing for the worksheet # @param [String] str - def to_xml_string(str = '') + def to_xml_string(str = +'') return unless has_drawing? str << "" diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb index f375582b..c4cb8983 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb @@ -58,7 +58,7 @@ module Axlsx # Seralize the object # @param [String] str # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') str << '' diff --git a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb index a5b1a512..f19630f8 100644 --- a/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb +++ b/lib/axlsx/workbook/worksheet/worksheet_hyperlinks.rb @@ -29,7 +29,7 @@ module Axlsx # seralize the collection of hyperlinks # @return [String] - def to_xml_string(str = '') + def to_xml_string(str = +'') return if empty? str << '' diff --git a/test/drawing/tc_area_series.rb b/test/drawing/tc_area_series.rb index e7e53269..c9b9a949 100644 --- a/test/drawing/tc_area_series.rb +++ b/test/drawing/tc_area_series.rb @@ -63,7 +63,7 @@ class TestAreaSeries < Test::Unit::TestCase end def wrap_with_namespaces(series) - '' str << '' doc = Nokogiri::XML(@axis.to_xml_string(str)) @@ -103,7 +103,7 @@ class TestAxis < Test::Unit::TestCase def test_to_xml_string @axis.cross_axis = Axlsx::CatAxis.new - str = '' + str = +'' str << '' doc = Nokogiri::XML(@axis.to_xml_string(str)) diff --git a/test/drawing/tc_d_lbls.rb b/test/drawing/tc_d_lbls.rb index 76840a6e..b7d664b4 100644 --- a/test/drawing/tc_d_lbls.rb +++ b/test/drawing/tc_d_lbls.rb @@ -46,7 +46,7 @@ class TestDLbls < Test::Unit::TestCase end def test_to_xml_string - str = '' + str = +'' str << '' @d_lbls.to_xml_string(str) str << '' diff --git a/test/drawing/tc_data_source.rb b/test/drawing/tc_data_source.rb index ea0f1e37..fd500819 100644 --- a/test/drawing/tc_data_source.rb +++ b/test/drawing/tc_data_source.rb @@ -14,7 +14,7 @@ class TestNumDataSource < Test::Unit::TestCase end def test_to_xml_string_strLit - str = '' + str = +'' str << '' str << @data_source.to_xml_string doc = Nokogiri::XML(str) diff --git a/test/drawing/tc_line_series.rb b/test/drawing/tc_line_series.rb index 893c587f..7223fca3 100644 --- a/test/drawing/tc_line_series.rb +++ b/test/drawing/tc_line_series.rb @@ -63,7 +63,7 @@ class TestLineSeries < Test::Unit::TestCase end def wrap_with_namespaces(series) - '' + str = +'' str << '' str << @num_data.to_xml_string doc = Nokogiri::XML(str) diff --git a/test/drawing/tc_num_val.rb b/test/drawing/tc_num_val.rb index e5f3b869..7ad6ace4 100644 --- a/test/drawing/tc_num_val.rb +++ b/test/drawing/tc_num_val.rb @@ -18,7 +18,7 @@ class TestNumVal < Test::Unit::TestCase end def test_to_xml_string - str = '' + str = +'' str << '' str << @num_val.to_xml_string(0) doc = Nokogiri::XML(str) diff --git a/test/drawing/tc_str_data.rb b/test/drawing/tc_str_data.rb index e8fc0441..f80bf24b 100644 --- a/test/drawing/tc_str_data.rb +++ b/test/drawing/tc_str_data.rb @@ -8,7 +8,7 @@ class TestStrData < Test::Unit::TestCase end def test_to_xml_string_strLit - str = '' + str = +'' str << '' str << @str_data.to_xml_string doc = Nokogiri::XML(str) diff --git a/test/drawing/tc_str_val.rb b/test/drawing/tc_str_val.rb index dfff771b..c094c450 100644 --- a/test/drawing/tc_str_val.rb +++ b/test/drawing/tc_str_val.rb @@ -13,7 +13,7 @@ class TestStrVal < Test::Unit::TestCase end def test_to_xml_string - str = '' + str = +'' str << '' str << @str_val.to_xml_string(0) doc = Nokogiri::XML(str) @@ -22,7 +22,7 @@ class TestStrVal < Test::Unit::TestCase end def test_to_xml_string_special_characters - str = '' + str = +'' str << '' str << @str_val_with_special_characters.to_xml_string(0) doc = Nokogiri::XML(str) diff --git a/test/tc_axlsx.rb b/test/tc_axlsx.rb index d1c47b47..95c77d88 100644 --- a/test/tc_axlsx.rb +++ b/test/tc_axlsx.rb @@ -100,7 +100,7 @@ class TestAxlsx < Test::Unit::TestCase end def test_sanitize_unfrozen_control_strippped - needs_sanitize = "legit\x08" # Backspace control char + needs_sanitize = +"legit\x08" # Backspace control char sanitized_str = Axlsx.sanitize(needs_sanitize) assert_equal('legit', sanitized_str, 'should strip control chars') @@ -108,7 +108,7 @@ class TestAxlsx < Test::Unit::TestCase end def test_sanitize_unfrozen_no_sanitize - legit_str = 'legit' + legit_str = +'legit' sanitized_str = Axlsx.sanitize(legit_str) assert_equal(sanitized_str, legit_str, 'should preserve value') diff --git a/test/workbook/worksheet/tc_row.rb b/test/workbook/worksheet/tc_row.rb index 9336ae38..273487ac 100644 --- a/test/workbook/worksheet/tc_row.rb +++ b/test/workbook/worksheet/tc_row.rb @@ -133,7 +133,7 @@ class TestRow < Test::Unit::TestCase @row.outlineLevel = 2 @row.collapsed = true @row.hidden = true - r_s_xml = Nokogiri::XML(@row.to_xml_string(0, '')) + r_s_xml = Nokogiri::XML(@row.to_xml_string(0)) assert_equal(1, r_s_xml.xpath(".//row[@r=1]").size) end @@ -141,7 +141,7 @@ class TestRow < Test::Unit::TestCase def test_to_xml_string_with_custom_height @row.add_cell 1 @row.height = 20 - r_s_xml = Nokogiri::XML(@row.to_xml_string(0, '')) + r_s_xml = Nokogiri::XML(@row.to_xml_string(0)) assert_equal(1, r_s_xml.xpath(".//row[@r=1][@ht=20][@customHeight=1]").size) end -- cgit v1.2.3 From 816ca05a3903fa4595c4e8382c6201e2615e72f4 Mon Sep 17 00:00:00 2001 From: Zsolt Kozaroczy Date: Fri, 5 May 2023 11:43:26 +0200 Subject: Revert changelog Co-authored-by: Geremia Taglialatela --- CHANGELOG.md | 1 - 1 file changed, 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4dea8fa7..49cae46a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,7 +2,6 @@ CHANGELOG --------- - **Unreleased**: 4.0.0 - Drop support for Ruby versions < 2.6 - - Drop support for Ruby versions < 2.7 - Added frozen string literals - **April.23.23**: 3.4.1 -- cgit v1.2.3