write_xlsx 1.08.2 → 1.09.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (73) hide show
  1. checksums.yaml +4 -4
  2. data/Changes +9 -0
  3. data/README.md +1 -1
  4. data/examples/background.rb +19 -0
  5. data/lib/write_xlsx/chart/axis.rb +3 -3
  6. data/lib/write_xlsx/chart/scatter.rb +0 -15
  7. data/lib/write_xlsx/chart/series.rb +1 -1
  8. data/lib/write_xlsx/chart.rb +28 -28
  9. data/lib/write_xlsx/chartsheet.rb +3 -3
  10. data/lib/write_xlsx/drawing.rb +39 -39
  11. data/lib/write_xlsx/format.rb +11 -179
  12. data/lib/write_xlsx/package/app.rb +2 -2
  13. data/lib/write_xlsx/package/button.rb +8 -8
  14. data/lib/write_xlsx/package/comments.rb +8 -8
  15. data/lib/write_xlsx/package/content_types.rb +18 -9
  16. data/lib/write_xlsx/package/core.rb +5 -5
  17. data/lib/write_xlsx/package/custom.rb +2 -2
  18. data/lib/write_xlsx/package/metadata.rb +159 -0
  19. data/lib/write_xlsx/package/packager.rb +21 -0
  20. data/lib/write_xlsx/package/shared_strings.rb +6 -6
  21. data/lib/write_xlsx/package/styles.rb +11 -11
  22. data/lib/write_xlsx/package/table.rb +23 -23
  23. data/lib/write_xlsx/package/theme.rb +1 -1
  24. data/lib/write_xlsx/package/vml.rb +43 -43
  25. data/lib/write_xlsx/shape.rb +17 -15
  26. data/lib/write_xlsx/sparkline.rb +340 -340
  27. data/lib/write_xlsx/utility.rb +4 -23
  28. data/lib/write_xlsx/version.rb +1 -1
  29. data/lib/write_xlsx/workbook.rb +171 -644
  30. data/lib/write_xlsx/worksheet/cell_data.rb +25 -3
  31. data/lib/write_xlsx/worksheet/data_validation.rb +20 -20
  32. data/lib/write_xlsx/worksheet/hyperlink.rb +4 -4
  33. data/lib/write_xlsx/worksheet/page_setup.rb +12 -12
  34. data/lib/write_xlsx/worksheet.rb +295 -4184
  35. data/test/perl_output/background.xlsx +0 -0
  36. data/test/regression/images/logo.gif +0 -0
  37. data/test/regression/images/logo.jpg +0 -0
  38. data/test/regression/images/red.gif +0 -0
  39. data/test/regression/test_background01.rb +23 -0
  40. data/test/regression/test_background02.rb +23 -0
  41. data/test/regression/test_background03.rb +24 -0
  42. data/test/regression/test_background04.rb +25 -0
  43. data/test/regression/test_background05.rb +25 -0
  44. data/test/regression/test_background06.rb +31 -0
  45. data/test/regression/test_background07.rb +37 -0
  46. data/test/regression/test_chart_axis47.rb +52 -0
  47. data/test/regression/test_chart_axis48.rb +53 -0
  48. data/test/regression/test_dynamic_array01.rb +25 -0
  49. data/test/regression/test_image56.rb +23 -0
  50. data/test/regression/test_image57.rb +23 -0
  51. data/test/regression/test_set_column10.rb +55 -0
  52. data/test/regression/test_set_column11.rb +48 -0
  53. data/test/regression/test_set_row01.rb +35 -0
  54. data/test/regression/test_set_row02.rb +35 -0
  55. data/test/regression/test_set_row03.rb +35 -0
  56. data/test/regression/test_set_row04.rb +35 -0
  57. data/test/regression/xlsx_files/background01.xlsx +0 -0
  58. data/test/regression/xlsx_files/background02.xlsx +0 -0
  59. data/test/regression/xlsx_files/background03.xlsx +0 -0
  60. data/test/regression/xlsx_files/background04.xlsx +0 -0
  61. data/test/regression/xlsx_files/background05.xlsx +0 -0
  62. data/test/regression/xlsx_files/background06.xlsx +0 -0
  63. data/test/regression/xlsx_files/background07.xlsx +0 -0
  64. data/test/regression/xlsx_files/chart_axis47.xlsx +0 -0
  65. data/test/regression/xlsx_files/chart_axis48.xlsx +0 -0
  66. data/test/regression/xlsx_files/dynamic_array01.xlsx +0 -0
  67. data/test/regression/xlsx_files/image56.xlsx +0 -0
  68. data/test/regression/xlsx_files/image57.xlsx +0 -0
  69. data/test/regression/xlsx_files/set_row01.xlsx +0 -0
  70. data/test/regression/xlsx_files/set_row03.xlsx +0 -0
  71. data/test/test_example_match.rb +12 -0
  72. data/test/worksheet/test_pixels_to_row_col.rb +46 -0
  73. metadata +78 -2
@@ -108,20 +108,6 @@ module Writexlsx
108
108
  # The function takes a date and time in ISO8601 "yyyy-mm-ddThh:mm:ss.ss" format
109
109
  # and converts it to a decimal number representing a valid Excel date.
110
110
  #
111
- # Dates and times in Excel are represented by real numbers. The integer part of
112
- # the number stores the number of days since the epoch and the fractional part
113
- # stores the percentage of the day in seconds. The epoch can be either 1900 or
114
- # 1904.
115
- #
116
- # Parameter: Date and time string in one of the following formats:
117
- # yyyy-mm-ddThh:mm:ss.ss # Standard
118
- # yyyy-mm-ddT # Date only
119
- # Thh:mm:ss.ss # Time only
120
- #
121
- # Returns:
122
- # A decimal number representing a valid Excel date, or
123
- # nil if the date is invalid.
124
- #
125
111
  def convert_date_time(date_time_string) #:nodoc:
126
112
  date_time = date_time_string.to_s.sub(/^\s+/, '').sub(/\s+$/, '').sub(/Z$/, '')
127
113
 
@@ -352,11 +338,6 @@ module Writexlsx
352
338
  # Check that row and col are valid and store max and min values for use in
353
339
  # other methods/elements.
354
340
  #
355
- # The ignore_row/ignore_col flags is used to indicate that we wish to
356
- # perform the dimension check without storing the value.
357
- #
358
- # The ignore flags are use by set_row() and data_validate.
359
- #
360
341
  def check_dimensions_and_update_max_min_values(row, col, ignore_row = 0, ignore_col = 0) #:nodoc:
361
342
  check_dimensions(row, col)
362
343
  store_row_max_min_values(row) if ignore_row == 0
@@ -486,9 +467,9 @@ module Writexlsx
486
467
 
487
468
  def v_shape_attributes_base(id, z_index)
488
469
  [
489
- ['id', "_x0000_s#{id}"],
490
- ['type', type],
491
- ['style', (v_shape_style_base(z_index, vertices) + style_addition).join]
470
+ ['id', "_x0000_s#{id}"],
471
+ ['type', type],
472
+ ['style', (v_shape_style_base(z_index, vertices) + style_addition).join]
492
473
  ]
493
474
  end
494
475
 
@@ -943,7 +924,7 @@ module Writexlsx
943
924
  else
944
925
  @writer.empty_tag(tag, attributes)
945
926
  end
946
- end
927
+ end
947
928
 
948
929
  #
949
930
  # Convert the user specified colour index or string to a rgb colour.
@@ -1 +1 @@
1
- WriteXLSX_VERSION = "1.08.2"
1
+ WriteXLSX_VERSION = "1.09.0"