diff options
| author | Geremia Taglialatela <[email protected]> | 2023-05-23 00:43:50 +0200 |
|---|---|---|
| committer | Geremia Taglialatela <[email protected]> | 2023-05-31 09:43:02 +0200 |
| commit | b7155f6956c24ca71929c3376a5658e0df425061 (patch) | |
| tree | ab804a24fce766cb76b0d00caf71a3b3ab1e213c /lib | |
| parent | 8918a00eb0ff7b40240be5c94c4c245c95579acb (diff) | |
| download | caxlsx-b7155f6956c24ca71929c3376a5658e0df425061.tar.gz caxlsx-b7155f6956c24ca71929c3376a5658e0df425061.zip | |
Fix Style/MutableConstant offenses
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/axlsx/drawing/cat_axis.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/drawing/line_3D_chart.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/drawing/pic.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/drawing/view_3D.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/stylesheet/dxf.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/util/storage.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/auto_filter/filters.rb | 4 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/data_bar.rb | 2 | ||||
| -rw-r--r-- | lib/axlsx/workbook/worksheet/sheet_view.rb | 2 |
10 files changed, 12 insertions, 12 deletions
diff --git a/lib/axlsx/drawing/cat_axis.rb b/lib/axlsx/drawing/cat_axis.rb index 2f40f29f..d26e3dc9 100644 --- a/lib/axlsx/drawing/cat_axis.rb +++ b/lib/axlsx/drawing/cat_axis.rb @@ -42,7 +42,7 @@ module Axlsx alias :tickMarkSkip :tick_mark_skip # regex for validating label offset - LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)/ + LBL_OFFSET_REGEX = /0*(([0-9])|([1-9][0-9])|([1-9][0-9][0-9])|1000)/.freeze # @see tick_lbl_skip def tick_lbl_skip=(v) Axlsx::validate_unsigned_int(v); @tick_lbl_skip = v; end diff --git a/lib/axlsx/drawing/line_3D_chart.rb b/lib/axlsx/drawing/line_3D_chart.rb index f9f9606e..60572785 100644 --- a/lib/axlsx/drawing/line_3D_chart.rb +++ b/lib/axlsx/drawing/line_3D_chart.rb @@ -26,7 +26,7 @@ module Axlsx alias :gapDepth :gap_depth # validation regex for gap amount percent - GAP_AMOUNT_PERCENT = /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/ + GAP_AMOUNT_PERCENT = /0*(([0-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)%/.freeze # the category axis # @return [Axis] diff --git a/lib/axlsx/drawing/pic.rb b/lib/axlsx/drawing/pic.rb index fa08bd83..320a5254 100644 --- a/lib/axlsx/drawing/pic.rb +++ b/lib/axlsx/drawing/pic.rb @@ -30,7 +30,7 @@ module Axlsx end # allowed mime types - ALLOWED_MIME_TYPES = %w(image/jpeg image/png image/gif) + ALLOWED_MIME_TYPES = %w(image/jpeg image/png image/gif).freeze # The name to use for this picture # @return [String] diff --git a/lib/axlsx/drawing/view_3D.rb b/lib/axlsx/drawing/view_3D.rb index 9b1b5cb2..9b3489a3 100644 --- a/lib/axlsx/drawing/view_3D.rb +++ b/lib/axlsx/drawing/view_3D.rb @@ -18,10 +18,10 @@ module Axlsx end # Validation for hPercent - H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)/ + H_PERCENT_REGEX = /0*(([5-9])|([1-9][0-9])|([1-4][0-9][0-9])|500)/.freeze # validation for depthPercent - DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)/ + DEPTH_PERCENT_REGEX = /0*(([2-9][0-9])|([1-9][0-9][0-9])|(1[0-9][0-9][0-9])|2000)/.freeze # x rotation for the chart # must be between -90 and 90 diff --git a/lib/axlsx/stylesheet/dxf.rb b/lib/axlsx/stylesheet/dxf.rb index 8c32a75f..2c10443a 100644 --- a/lib/axlsx/stylesheet/dxf.rb +++ b/lib/axlsx/stylesheet/dxf.rb @@ -8,7 +8,7 @@ module Axlsx # The order in which the child elements is put in the XML seems to # be important for Excel - CHILD_ELEMENTS = [:font, :numFmt, :fill, :alignment, :border, :protection] + CHILD_ELEMENTS = [:font, :numFmt, :fill, :alignment, :border, :protection].freeze # does not support extList (ExtensionList) # The cell alignment for this style diff --git a/lib/axlsx/util/storage.rb b/lib/axlsx/util/storage.rb index 1e12b2d4..00cd6b3c 100644 --- a/lib/axlsx/util/storage.rb +++ b/lib/axlsx/util/storage.rb @@ -35,7 +35,7 @@ module Axlsx COLORS = { :red => 0, :black => 1 - } + }.freeze # The color of this node in the directory tree. Defaults to black if not specified # @return [Integer] color diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb index 16096a52..e5c3ef77 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filter_column.rb @@ -28,7 +28,7 @@ module Axlsx serializable_attributes :col_id, :hidden_button, :show_button # Allowed filters - FILTERS = [:filters] # , :top10, :custom_filters, :dynamic_filters, :color_filters, :icon_filters] + FILTERS = [:filters].freeze # , :top10, :custom_filters, :dynamic_filters, :color_filters, :icon_filters] # Zero-based index indicating the AutoFilter column to which this filter information applies. # @return [Integer] diff --git a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb index 38bafe85..95e1b885 100644 --- a/lib/axlsx/workbook/worksheet/auto_filter/filters.rb +++ b/lib/axlsx/workbook/worksheet/auto_filter/filters.rb @@ -24,7 +24,7 @@ module Axlsx serializable_attributes :blank, :calendar_type # Allowed calendar types - CALENDAR_TYPES = %w(gregorian gregorianUs gregorianMeFrench gregorianArabic hijri hebrew taiwan japan thai korea saka gregorianXlitEnglish gregorianXlitFrench none) + CALENDAR_TYPES = %w(gregorian gregorianUs gregorianMeFrench gregorianArabic hijri hebrew taiwan japan thai korea saka gregorianXlitEnglish gregorianXlitFrench none).freeze # Flag indicating whether to filter by blank. # @return [Boolean] @@ -157,7 +157,7 @@ module Axlsx serializable_attributes :date_time_grouping, :year, :month, :day, :hour, :minute, :second # Allowed date time groupings - DATE_TIME_GROUPING = %w(year month day hour minute second) + DATE_TIME_GROUPING = %w(year month day hour minute second).freeze # Grouping level # This must be one of year, month, day, hour, minute or second. diff --git a/lib/axlsx/workbook/worksheet/data_bar.rb b/lib/axlsx/workbook/worksheet/data_bar.rb index 482bd029..db224b5e 100644 --- a/lib/axlsx/workbook/worksheet/data_bar.rb +++ b/lib/axlsx/workbook/worksheet/data_bar.rb @@ -38,7 +38,7 @@ module Axlsx serializable_attributes :min_length, :max_length, :show_value # instance values that must be serialized as their own elements - e.g. not attributes. - CHILD_ELEMENTS = [:value_objects, :color] + CHILD_ELEMENTS = [:value_objects, :color].freeze # minLength attribute # The minimum length of the data bar, as a percentage of the cell width. diff --git a/lib/axlsx/workbook/worksheet/sheet_view.rb b/lib/axlsx/workbook/worksheet/sheet_view.rb index 73e7533e..b64920bb 100644 --- a/lib/axlsx/workbook/worksheet/sheet_view.rb +++ b/lib/axlsx/workbook/worksheet/sheet_view.rb @@ -50,7 +50,7 @@ module Axlsx :view, :top_left_cell, :color_id, :zoom_scale # instance values that must be serialized as their own elements - e.g. not attributes. - CHILD_ELEMENTS = [:pane, :selections] + CHILD_ELEMENTS = [:pane, :selections].freeze # The pane object for the sheet view # @return [Pane] |
