diff options
| author | Zsolt Kozaroczy <[email protected]> | 2023-06-09 10:57:54 +0200 |
|---|---|---|
| committer | GitHub <[email protected]> | 2023-06-09 10:57:54 +0200 |
| commit | de23c1204a4999f747740cd119b0f74247b2f9d5 (patch) | |
| tree | afcdf2020763faeb08aa302e2210c9702a80f45c | |
| parent | 2965ebd4c719ad34a75e70cb1640e94093c8c763 (diff) | |
| parent | 956d0b5e06580b6465a67159a9c0d1dd719f6442 (diff) | |
| download | caxlsx-de23c1204a4999f747740cd119b0f74247b2f9d5.tar.gz caxlsx-de23c1204a4999f747740cd119b0f74247b2f9d5.zip | |
Merge pull request #279 from tagliala/chore/fix-safe-offenses-in-vml-shape
Refactor random char generation
| -rw-r--r-- | .rubocop_todo.yml | 10 | ||||
| -rw-r--r-- | lib/axlsx/drawing/vml_shape.rb | 2 |
2 files changed, 1 insertions, 11 deletions
diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index b68f9b61..1af7d16e 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -248,11 +248,6 @@ Style/NumericPredicate: - 'lib/axlsx/util/validators.rb' - 'lib/axlsx/workbook/worksheet/worksheet.rb' -# This cop supports safe autocorrection (--autocorrect). -Style/OperatorMethodCall: - Exclude: - - 'lib/axlsx/drawing/vml_shape.rb' - # Configuration parameters: AllowedMethods. # AllowedMethods: respond_to_missing? Style/OptionalBooleanParameter: @@ -319,11 +314,6 @@ Style/QuotedSymbols: - 'lib/axlsx/workbook/worksheet/worksheet_hyperlink.rb' # This cop supports safe autocorrection (--autocorrect). -Style/RandomWithOffset: - Exclude: - - 'lib/axlsx/drawing/vml_shape.rb' - -# This cop supports safe autocorrection (--autocorrect). Style/RedundantRegexpEscape: Exclude: - 'lib/axlsx/workbook/worksheet/pivot_table.rb' diff --git a/lib/axlsx/drawing/vml_shape.rb b/lib/axlsx/drawing/vml_shape.rb index f1cd8951..4b21528f 100644 --- a/lib/axlsx/drawing/vml_shape.rb +++ b/lib/axlsx/drawing/vml_shape.rb @@ -24,7 +24,7 @@ module Axlsx @right_offset = 50 @bottom_offset = 5 @visible = true - @id = (0...8).map { 65.+(rand(25)).chr }.join + @id = Array.new(8) { rand(65..89).chr }.join parse_options options yield self if block_given? end |
