write_xlsx 1.10.0 → 1.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (80) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +5 -1
  3. data/Changes +3 -0
  4. data/README.md +1 -1
  5. data/examples/autofilter.rb +1 -1
  6. data/examples/chart_area.rb +12 -12
  7. data/examples/chart_bar.rb +12 -12
  8. data/examples/chart_clustered.rb +12 -12
  9. data/examples/chart_column.rb +12 -12
  10. data/examples/chart_combined.rb +25 -25
  11. data/examples/chart_data_labels.rb +99 -99
  12. data/examples/chart_data_table.rb +25 -25
  13. data/examples/chart_data_tools.rb +50 -50
  14. data/examples/chart_doughnut.rb +29 -29
  15. data/examples/chart_gauge.rb +18 -18
  16. data/examples/chart_line.rb +32 -32
  17. data/examples/chart_pareto.rb +16 -16
  18. data/examples/chart_pie.rb +17 -17
  19. data/examples/chart_radar.rb +38 -38
  20. data/examples/chart_scatter.rb +12 -12
  21. data/examples/chart_secondary_axis.rb +13 -13
  22. data/examples/chart_stock.rb +12 -12
  23. data/examples/chart_styles.rb +5 -5
  24. data/examples/colors.rb +11 -11
  25. data/examples/comments2.rb +15 -15
  26. data/examples/conditional_format.rb +74 -74
  27. data/examples/data_validate.rb +64 -64
  28. data/examples/date_time.rb +3 -3
  29. data/examples/demo.rb +14 -14
  30. data/examples/diag_border.rb +6 -6
  31. data/examples/dynamic_arrays.rb +2 -2
  32. data/examples/formats.rb +10 -10
  33. data/examples/hyperlink1.rb +4 -4
  34. data/examples/ignore_errors.rb +2 -2
  35. data/examples/indent.rb +2 -2
  36. data/examples/macros.rb +4 -4
  37. data/examples/merge1.rb +1 -1
  38. data/examples/merge2.rb +9 -9
  39. data/examples/merge3.rb +5 -5
  40. data/examples/merge4.rb +20 -20
  41. data/examples/merge5.rb +18 -18
  42. data/examples/merge6.rb +7 -7
  43. data/examples/outline.rb +1 -1
  44. data/examples/outline_collapsed.rb +1 -1
  45. data/examples/panes.rb +4 -4
  46. data/examples/properties.rb +9 -9
  47. data/examples/protection.rb +2 -2
  48. data/examples/rich_strings.rb +6 -6
  49. data/examples/shape1.rb +7 -7
  50. data/examples/shape2.rb +16 -16
  51. data/examples/shape3.rb +5 -5
  52. data/examples/shape4.rb +7 -7
  53. data/examples/shape5.rb +7 -7
  54. data/examples/shape6.rb +7 -7
  55. data/examples/shape7.rb +10 -10
  56. data/examples/shape8.rb +10 -10
  57. data/examples/shape_all.rb +4 -4
  58. data/examples/sparklines1.rb +11 -11
  59. data/examples/sparklines2.rb +76 -76
  60. data/examples/tables.rb +87 -87
  61. data/examples/watermark.rb +1 -1
  62. data/lib/write_xlsx/chart/bar.rb +4 -4
  63. data/lib/write_xlsx/chart/line.rb +1 -1
  64. data/lib/write_xlsx/chart/radar.rb +2 -2
  65. data/lib/write_xlsx/chart/scatter.rb +4 -4
  66. data/lib/write_xlsx/chart/series.rb +27 -27
  67. data/lib/write_xlsx/chart/stock.rb +5 -5
  68. data/lib/write_xlsx/chart.rb +30 -30
  69. data/lib/write_xlsx/colors.rb +19 -19
  70. data/lib/write_xlsx/package/conditional_format.rb +3 -3
  71. data/lib/write_xlsx/package/table.rb +8 -8
  72. data/lib/write_xlsx/shape.rb +5 -5
  73. data/lib/write_xlsx/sheets.rb +1 -1
  74. data/lib/write_xlsx/sparkline.rb +286 -286
  75. data/lib/write_xlsx/utility.rb +23 -23
  76. data/lib/write_xlsx/version.rb +1 -1
  77. data/lib/write_xlsx/workbook.rb +20 -20
  78. data/lib/write_xlsx/worksheet/cell_data.rb +1 -1
  79. data/lib/write_xlsx/worksheet.rb +28 -28
  80. metadata +2 -2
@@ -683,7 +683,7 @@ module Writexlsx
683
683
  end
684
684
 
685
685
  def line_fill_properties(params)
686
- return { :_defined => 0 } unless params
686
+ return { _defined: 0 } unless params
687
687
 
688
688
  ret = params.dup
689
689
  ret[:dash_type] = yield if block_given? && ret[:dash_type]
@@ -693,17 +693,17 @@ module Writexlsx
693
693
 
694
694
  def dash_types
695
695
  {
696
- :solid => 'solid',
697
- :round_dot => 'sysDot',
698
- :square_dot => 'sysDash',
699
- :dash => 'dash',
700
- :dash_dot => 'dashDot',
701
- :long_dash => 'lgDash',
702
- :long_dash_dot => 'lgDashDot',
703
- :long_dash_dot_dot => 'lgDashDotDot',
704
- :dot => 'dot',
705
- :system_dash_dot => 'sysDashDot',
706
- :system_dash_dot_dot => 'sysDashDotDot'
696
+ solid: 'solid',
697
+ round_dot: 'sysDot',
698
+ square_dot: 'sysDash',
699
+ dash: 'dash',
700
+ dash_dot: 'dashDot',
701
+ long_dash: 'lgDash',
702
+ long_dash_dot: 'lgDashDot',
703
+ long_dash_dot_dot: 'lgDashDotDot',
704
+ dot: 'dot',
705
+ system_dash_dot: 'sysDashDot',
706
+ system_dash_dot_dot: 'sysDashDotDot'
707
707
  }
708
708
  end
709
709
 
@@ -766,16 +766,16 @@ module Writexlsx
766
766
 
767
767
  def params_to_font(params)
768
768
  {
769
- :_name => params[:name],
770
- :_color => params[:color],
771
- :_size => params[:size],
772
- :_bold => params[:bold],
773
- :_italic => params[:italic],
774
- :_underline => params[:underline],
775
- :_pitch_family => params[:pitch_family],
776
- :_charset => params[:charset],
777
- :_baseline => params[:baseline] || 0,
778
- :_rotation => params[:rotation]
769
+ _name: params[:name],
770
+ _color: params[:color],
771
+ _size: params[:size],
772
+ _bold: params[:bold],
773
+ _italic: params[:italic],
774
+ _underline: params[:underline],
775
+ _pitch_family: params[:pitch_family],
776
+ _charset: params[:charset],
777
+ _baseline: params[:baseline] || 0,
778
+ _rotation: params[:rotation]
779
779
  }
780
780
  end
781
781
 
@@ -862,7 +862,7 @@ module Writexlsx
862
862
 
863
863
  if !latin_attributes.empty? || has_color
864
864
  @writer.tag_elements(tag, style_attributes) do
865
- write_a_solid_fill(:color => font[:_color]) if has_color
865
+ write_a_solid_fill(color: font[:_color]) if has_color
866
866
  write_a_latin(latin_attributes) unless latin_attributes.empty?
867
867
  end
868
868
  else
@@ -1,3 +1,3 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- WriteXLSX_VERSION = "1.10.0"
3
+ WriteXLSX_VERSION = "1.10.1"
@@ -95,18 +95,18 @@ module Writexlsx
95
95
 
96
96
  if @excel2003_style
97
97
  add_format(default_formats.merge(
98
- :xf_index => 0,
99
- :font_family => 0,
100
- :font => 'Arial',
101
- :size => 10,
102
- :theme => -1
98
+ xf_index: 0,
99
+ font_family: 0,
100
+ font: 'Arial',
101
+ size: 10,
102
+ theme: -1
103
103
  ))
104
104
  else
105
- add_format(default_formats.merge(:xf_index => 0))
105
+ add_format(default_formats.merge(xf_index: 0))
106
106
  end
107
107
 
108
108
  # Add a default URL format.
109
- @default_url_format = add_format(:hyperlink => 1)
109
+ @default_url_format = add_format(hyperlink: 1)
110
110
 
111
111
  set_color_palette
112
112
  end
@@ -273,7 +273,7 @@ module Writexlsx
273
273
  #
274
274
  def add_format(property_hash = {})
275
275
  properties = {}
276
- properties.update(:font => 'Arial', :size => 10, :theme => -1) if @excel2003_style
276
+ properties.update(font: 'Arial', size: 10, theme: -1) if @excel2003_style
277
277
  properties.update(property_hash)
278
278
 
279
279
  format = Format.new(@formats, properties)
@@ -376,18 +376,18 @@ module Writexlsx
376
376
 
377
377
  # List of valid input parameters.
378
378
  valid = {
379
- :title => 1,
380
- :subject => 1,
381
- :author => 1,
382
- :keywords => 1,
383
- :comments => 1,
384
- :last_author => 1,
385
- :created => 1,
386
- :category => 1,
387
- :manager => 1,
388
- :company => 1,
389
- :status => 1,
390
- :hyperlink_base => 1
379
+ title: 1,
380
+ subject: 1,
381
+ author: 1,
382
+ keywords: 1,
383
+ comments: 1,
384
+ last_author: 1,
385
+ created: 1,
386
+ category: 1,
387
+ manager: 1,
388
+ company: 1,
389
+ status: 1,
390
+ hyperlink_base: 1
391
391
  }
392
392
 
393
393
  # Check for valid input parameters.
@@ -64,7 +64,7 @@ module Writexlsx
64
64
  end
65
65
 
66
66
  def data
67
- { :sst_id => token }
67
+ { sst_id: token }
68
68
  end
69
69
 
70
70
  TYPE_STR_ATTRS = %w[t s].freeze
@@ -273,23 +273,23 @@ module Writexlsx
273
273
 
274
274
  def protect_default_settings # :nodoc:
275
275
  {
276
- :sheet => true,
277
- :content => false,
278
- :objects => false,
279
- :scenarios => false,
280
- :format_cells => false,
281
- :format_columns => false,
282
- :format_rows => false,
283
- :insert_columns => false,
284
- :insert_rows => false,
285
- :insert_hyperlinks => false,
286
- :delete_columns => false,
287
- :delete_rows => false,
288
- :select_locked_cells => true,
289
- :sort => false,
290
- :autofilter => false,
291
- :pivot_tables => false,
292
- :select_unlocked_cells => true
276
+ sheet: true,
277
+ content: false,
278
+ objects: false,
279
+ scenarios: false,
280
+ format_cells: false,
281
+ format_columns: false,
282
+ format_rows: false,
283
+ insert_columns: false,
284
+ insert_rows: false,
285
+ insert_hyperlinks: false,
286
+ delete_columns: false,
287
+ delete_rows: false,
288
+ select_locked_cells: true,
289
+ sort: false,
290
+ autofilter: false,
291
+ pivot_tables: false,
292
+ select_unlocked_cells: true
293
293
  }
294
294
  end
295
295
  private :protect_default_settings
@@ -1295,7 +1295,7 @@ module Writexlsx
1295
1295
  # Convert single cell to range
1296
1296
  if args.first.to_s =~ /^([A-Za-z]+[0-9]+)$/
1297
1297
  range = "#{::Regexp.last_match(1)}:#{::Regexp.last_match(1)}"
1298
- params = [range] + args[1..]
1298
+ params = [range] + args[1..-1]
1299
1299
  else
1300
1300
  params = args
1301
1301
  end
@@ -2987,7 +2987,7 @@ EOS
2987
2987
  # Set the button caption.
2988
2988
  caption = params[:caption] || "Button #{button_number}"
2989
2989
 
2990
- button.font = { :_caption => caption }
2990
+ button.font = { _caption: caption }
2991
2991
 
2992
2992
  # Set the macro name.
2993
2993
  button.macro = if params[:macro]
@@ -4412,15 +4412,15 @@ EOS
4412
4412
 
4413
4413
  @writer.tag_elements('ignoredErrors') do
4414
4414
  {
4415
- :number_stored_as_text => 'numberStoredAsText',
4416
- :eval_error => 'evalError',
4417
- :formula_differs => 'formula',
4418
- :formula_range => 'formulaRange',
4419
- :formula_unlocked => 'unlockedFormula',
4420
- :empty_cell_reference => 'emptyCellReference',
4421
- :list_data_validation => 'listDataValidation',
4422
- :calculated_column => 'calculatedColumn',
4423
- :two_digit_text_year => 'twoDigitTextYear'
4415
+ number_stored_as_text: 'numberStoredAsText',
4416
+ eval_error: 'evalError',
4417
+ formula_differs: 'formula',
4418
+ formula_range: 'formulaRange',
4419
+ formula_unlocked: 'unlockedFormula',
4420
+ empty_cell_reference: 'emptyCellReference',
4421
+ list_data_validation: 'listDataValidation',
4422
+ calculated_column: 'calculatedColumn',
4423
+ two_digit_text_year: 'twoDigitTextYear'
4424
4424
  }.each do |key, value|
4425
4425
  write_ignored_error(value, ignore[key]) if ignore[key]
4426
4426
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: write_xlsx
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.0
4
+ version: 1.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hideo NAKAMURA
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-01-29 00:00:00.000000000 Z
11
+ date: 2023-01-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubyzip