rubyXL 3.4.5 → 3.4.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/Gemfile +3 -3
  4. data/Gemfile.lock +76 -51
  5. data/LICENSE.txt +1 -1
  6. data/README.rdoc +10 -2
  7. data/Rakefile +3 -3
  8. data/VERSION +1 -1
  9. data/lib/rubyXL/convenience_methods/cell.rb +11 -1
  10. data/lib/rubyXL/convenience_methods/color.rb +5 -3
  11. data/lib/rubyXL/convenience_methods/worksheet.rb +77 -0
  12. data/lib/rubyXL/objects/chartsheet.rb +1 -1
  13. data/lib/rubyXL/objects/data_validation.rb +2 -0
  14. data/lib/rubyXL/objects/document_properties.rb +2 -2
  15. data/lib/rubyXL/objects/external_links.rb +25 -1
  16. data/lib/rubyXL/objects/ooxml_object.rb +13 -1
  17. data/lib/rubyXL/objects/relationships.rb +1 -1
  18. data/lib/rubyXL/objects/sheet_data.rb +11 -4
  19. data/lib/rubyXL/objects/storage.rb +1 -0
  20. data/lib/rubyXL/objects/text.rb +1 -1
  21. data/lib/rubyXL/objects/theme.rb +1 -1
  22. data/lib/rubyXL/objects/workbook.rb +24 -10
  23. data/lib/rubyXL/objects/worksheet.rb +7 -7
  24. data/lib/rubyXL/worksheet.rb +2 -0
  25. data/rdoc/README_rdoc.html +22 -10
  26. data/rdoc/RubyXL/AExtension.html +14 -51
  27. data/rdoc/RubyXL/AExtensionStorageArea.html +10 -14
  28. data/rdoc/RubyXL/ActiveX.html +16 -42
  29. data/rdoc/RubyXL/ActiveXBinary.html +10 -19
  30. data/rdoc/RubyXL/AdjustHandleList.html +10 -14
  31. data/rdoc/RubyXL/Alignment.html +10 -14
  32. data/rdoc/RubyXL/AlternateContent.html +10 -14
  33. data/rdoc/RubyXL/Authors.html +10 -14
  34. data/rdoc/RubyXL/AutoFilter.html +10 -14
  35. data/rdoc/RubyXL/AutoFilterColumn.html +10 -14
  36. data/rdoc/RubyXL/BinaryImageFile.html +10 -22
  37. data/rdoc/RubyXL/BodyProperties.html +10 -14
  38. data/rdoc/RubyXL/BooleanNode.html +10 -14
  39. data/rdoc/RubyXL/BooleanValue.html +10 -14
  40. data/rdoc/RubyXL/Border.html +13 -70
  41. data/rdoc/RubyXL/BorderEdge.html +13 -44
  42. data/rdoc/RubyXL/Borders.html +13 -31
  43. data/rdoc/RubyXL/Break.html +10 -14
  44. data/rdoc/RubyXL/BreakList.html +10 -14
  45. data/rdoc/RubyXL/CT_AdjPoint2D.html +10 -14
  46. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +10 -14
  47. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +10 -14
  48. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +10 -14
  49. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +10 -14
  50. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +10 -14
  51. data/rdoc/RubyXL/CT_Backdrop.html +10 -14
  52. data/rdoc/RubyXL/CT_Bevel.html +10 -14
  53. data/rdoc/RubyXL/CT_BiLevelEffect.html +10 -14
  54. data/rdoc/RubyXL/CT_BlendEffect.html +10 -14
  55. data/rdoc/RubyXL/CT_Blip.html +10 -14
  56. data/rdoc/RubyXL/CT_BlipFillProperties.html +10 -14
  57. data/rdoc/RubyXL/CT_BlurEffect.html +10 -14
  58. data/rdoc/RubyXL/CT_Camera.html +10 -14
  59. data/rdoc/RubyXL/CT_Color.html +10 -14
  60. data/rdoc/RubyXL/CT_ColorChangeEffect.html +10 -14
  61. data/rdoc/RubyXL/CT_ColorMapping.html +10 -14
  62. data/rdoc/RubyXL/CT_ColorScheme.html +10 -14
  63. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +10 -14
  64. data/rdoc/RubyXL/CT_ConnectionSite.html +10 -14
  65. data/rdoc/RubyXL/CT_ConnectionSiteList.html +10 -14
  66. data/rdoc/RubyXL/CT_DashStop.html +10 -14
  67. data/rdoc/RubyXL/CT_DashStopList.html +10 -14
  68. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +10 -14
  69. data/rdoc/RubyXL/CT_DuotoneEffect.html +10 -14
  70. data/rdoc/RubyXL/CT_EffectContainer.html +10 -14
  71. data/rdoc/RubyXL/CT_EffectList.html +10 -14
  72. data/rdoc/RubyXL/CT_EffectReference.html +10 -14
  73. data/rdoc/RubyXL/CT_EffectStyleItem.html +10 -14
  74. data/rdoc/RubyXL/CT_EffectStyleList.html +10 -14
  75. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +10 -14
  76. data/rdoc/RubyXL/CT_FillEffect.html +10 -14
  77. data/rdoc/RubyXL/CT_FillOverlayEffect.html +10 -14
  78. data/rdoc/RubyXL/CT_FillStyleList.html +10 -14
  79. data/rdoc/RubyXL/CT_FlatText.html +10 -14
  80. data/rdoc/RubyXL/CT_FontCollection.html +10 -14
  81. data/rdoc/RubyXL/CT_FontReference.html +10 -14
  82. data/rdoc/RubyXL/CT_GeomGuideList.html +10 -14
  83. data/rdoc/RubyXL/CT_GlowEffect.html +10 -14
  84. data/rdoc/RubyXL/CT_GradientFillProperties.html +10 -14
  85. data/rdoc/RubyXL/CT_GradientStop.html +10 -14
  86. data/rdoc/RubyXL/CT_GradientStopList.html +10 -14
  87. data/rdoc/RubyXL/CT_HSLEffect.html +10 -14
  88. data/rdoc/RubyXL/CT_HslColor.html +10 -14
  89. data/rdoc/RubyXL/CT_Hyperlink.html +10 -14
  90. data/rdoc/RubyXL/CT_InnerShadowEffect.html +10 -14
  91. data/rdoc/RubyXL/CT_LightRig.html +10 -14
  92. data/rdoc/RubyXL/CT_LineEndProperties.html +10 -14
  93. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +10 -14
  94. data/rdoc/RubyXL/CT_LineProperties.html +10 -14
  95. data/rdoc/RubyXL/CT_LineStyleList.html +10 -14
  96. data/rdoc/RubyXL/CT_LinearShadeProperties.html +10 -14
  97. data/rdoc/RubyXL/CT_LuminanceEffect.html +10 -14
  98. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +10 -14
  99. data/rdoc/RubyXL/CT_OuterShadowEffect.html +10 -14
  100. data/rdoc/RubyXL/CT_Path2D.html +10 -14
  101. data/rdoc/RubyXL/CT_Path2DArcTo.html +10 -14
  102. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +10 -14
  103. data/rdoc/RubyXL/CT_Path2DList.html +10 -14
  104. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +10 -14
  105. data/rdoc/RubyXL/CT_Path2DTo.html +10 -14
  106. data/rdoc/RubyXL/CT_PathShadeProperties.html +10 -14
  107. data/rdoc/RubyXL/CT_PatternFillProperties.html +10 -14
  108. data/rdoc/RubyXL/CT_Point3D.html +10 -14
  109. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +10 -14
  110. data/rdoc/RubyXL/CT_PresetColor.html +10 -14
  111. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +10 -14
  112. data/rdoc/RubyXL/CT_PresetShadowEffect.html +10 -14
  113. data/rdoc/RubyXL/CT_PresetTextShape.html +10 -14
  114. data/rdoc/RubyXL/CT_ReflectionEffect.html +10 -14
  115. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +10 -14
  116. data/rdoc/RubyXL/CT_RelativeRect.html +10 -14
  117. data/rdoc/RubyXL/CT_SRgbColor.html +10 -14
  118. data/rdoc/RubyXL/CT_ScRgbColor.html +10 -14
  119. data/rdoc/RubyXL/CT_Scene3D.html +10 -14
  120. data/rdoc/RubyXL/CT_SchemeColor.html +10 -14
  121. data/rdoc/RubyXL/CT_Shape3D.html +10 -14
  122. data/rdoc/RubyXL/CT_ShapeStyle.html +10 -14
  123. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +10 -14
  124. data/rdoc/RubyXL/CT_SphereCoords.html +10 -14
  125. data/rdoc/RubyXL/CT_StretchInfoProperties.html +10 -14
  126. data/rdoc/RubyXL/CT_StyleMatrix.html +10 -14
  127. data/rdoc/RubyXL/CT_StyleMatrixReference.html +10 -14
  128. data/rdoc/RubyXL/CT_SupplementalFont.html +10 -14
  129. data/rdoc/RubyXL/CT_SystemColor.html +10 -14
  130. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +10 -14
  131. data/rdoc/RubyXL/CT_TextBlipBullet.html +10 -14
  132. data/rdoc/RubyXL/CT_TextCharBullet.html +10 -14
  133. data/rdoc/RubyXL/CT_TextCharacterProperties.html +10 -14
  134. data/rdoc/RubyXL/CT_TextFont.html +10 -14
  135. data/rdoc/RubyXL/CT_TextListStyle.html +10 -14
  136. data/rdoc/RubyXL/CT_TextNormalAutofit.html +10 -14
  137. data/rdoc/RubyXL/CT_TextParagraphProperties.html +10 -14
  138. data/rdoc/RubyXL/CT_TextSpacing.html +10 -14
  139. data/rdoc/RubyXL/CT_TextTabStop.html +10 -14
  140. data/rdoc/RubyXL/CT_TextTabStopList.html +10 -14
  141. data/rdoc/RubyXL/CT_TileInfoProperties.html +10 -14
  142. data/rdoc/RubyXL/CT_TintEffect.html +10 -14
  143. data/rdoc/RubyXL/CT_Transform2D.html +10 -14
  144. data/rdoc/RubyXL/CT_TransformEffect.html +10 -14
  145. data/rdoc/RubyXL/CT_Vector3D.html +10 -14
  146. data/rdoc/RubyXL/CT_XYAdjustHandle.html +10 -14
  147. data/rdoc/RubyXL/CalculationChain.html +13 -39
  148. data/rdoc/RubyXL/CalculationChainCell.html +10 -14
  149. data/rdoc/RubyXL/CalculationProperties.html +10 -14
  150. data/rdoc/RubyXL/Cell.html +28 -221
  151. data/rdoc/RubyXL/CellConvenienceMethods.html +70 -475
  152. data/rdoc/RubyXL/CellExt.html +10 -14
  153. data/rdoc/RubyXL/CellSmartTag.html +10 -14
  154. data/rdoc/RubyXL/CellSmartTagProperty.html +10 -14
  155. data/rdoc/RubyXL/CellSmartTags.html +10 -14
  156. data/rdoc/RubyXL/CellStyle.html +10 -14
  157. data/rdoc/RubyXL/CellStyleXFs.html +13 -31
  158. data/rdoc/RubyXL/CellStyles.html +13 -31
  159. data/rdoc/RubyXL/CellValue.html +13 -31
  160. data/rdoc/RubyXL/CellWatch.html +10 -14
  161. data/rdoc/RubyXL/CellWatches.html +10 -14
  162. data/rdoc/RubyXL/CellXFs.html +13 -31
  163. data/rdoc/RubyXL/ChartColorsFile.html +10 -22
  164. data/rdoc/RubyXL/ChartFile.html +15 -44
  165. data/rdoc/RubyXL/ChartStyleFile.html +10 -22
  166. data/rdoc/RubyXL/ChartUserShapesFile.html +10 -22
  167. data/rdoc/RubyXL/Chartsheet.html +15 -61
  168. data/rdoc/RubyXL/ChartsheetPageSetup.html +10 -14
  169. data/rdoc/RubyXL/ChartsheetProperties.html +10 -14
  170. data/rdoc/RubyXL/ChartsheetProtection.html +10 -14
  171. data/rdoc/RubyXL/ChartsheetView.html +10 -14
  172. data/rdoc/RubyXL/ChartsheetViews.html +10 -14
  173. data/rdoc/RubyXL/Color.html +13 -36
  174. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +15 -60
  175. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +19 -76
  176. data/rdoc/RubyXL/ColorConvenienceClasses.html +8 -11
  177. data/rdoc/RubyXL/ColorConvenienceMethods.html +11 -28
  178. data/rdoc/RubyXL/ColorFilter.html +10 -14
  179. data/rdoc/RubyXL/ColorScale.html +10 -14
  180. data/rdoc/RubyXL/ColorSet.html +10 -14
  181. data/rdoc/RubyXL/Colors.html +10 -14
  182. data/rdoc/RubyXL/ColumnRange.html +13 -62
  183. data/rdoc/RubyXL/ColumnRanges.html +13 -70
  184. data/rdoc/RubyXL/Comment.html +10 -14
  185. data/rdoc/RubyXL/CommentList.html +10 -14
  186. data/rdoc/RubyXL/CommentsFile.html +13 -44
  187. data/rdoc/RubyXL/ConditionalFormatValue.html +10 -14
  188. data/rdoc/RubyXL/ConditionalFormatting.html +10 -14
  189. data/rdoc/RubyXL/ConditionalFormattingRule.html +10 -14
  190. data/rdoc/RubyXL/Connection.html +10 -14
  191. data/rdoc/RubyXL/ConnectionTable.html +10 -14
  192. data/rdoc/RubyXL/ConnectionTables.html +10 -14
  193. data/rdoc/RubyXL/ConnectionTextField.html +10 -14
  194. data/rdoc/RubyXL/ConnectionTextFields.html +10 -14
  195. data/rdoc/RubyXL/Connections.html +13 -39
  196. data/rdoc/RubyXL/ContentTypeDefault.html +10 -14
  197. data/rdoc/RubyXL/ContentTypeOverride.html +10 -14
  198. data/rdoc/RubyXL/ContentTypes.html +13 -52
  199. data/rdoc/RubyXL/ControlPropertiesFile.html +12 -19
  200. data/rdoc/RubyXL/CorePropertiesFile.html +15 -150
  201. data/rdoc/RubyXL/CustomColor.html +10 -14
  202. data/rdoc/RubyXL/CustomColorList.html +10 -14
  203. data/rdoc/RubyXL/CustomFilter.html +10 -14
  204. data/rdoc/RubyXL/CustomFilters.html +10 -14
  205. data/rdoc/RubyXL/CustomGeometry.html +10 -14
  206. data/rdoc/RubyXL/CustomProperties.html +10 -14
  207. data/rdoc/RubyXL/CustomPropertiesFile.html +10 -22
  208. data/rdoc/RubyXL/CustomProperty.html +10 -14
  209. data/rdoc/RubyXL/CustomPropertyFile.html +10 -22
  210. data/rdoc/RubyXL/CustomSheetView.html +10 -14
  211. data/rdoc/RubyXL/CustomSheetViews.html +10 -14
  212. data/rdoc/RubyXL/CustomWorkbookView.html +10 -14
  213. data/rdoc/RubyXL/CustomWorkbookViews.html +10 -14
  214. data/rdoc/RubyXL/CustomXMLFile.html +10 -19
  215. data/rdoc/RubyXL/DXF.html +10 -14
  216. data/rdoc/RubyXL/DXFs.html +10 -14
  217. data/rdoc/RubyXL/DataBar.html +10 -14
  218. data/rdoc/RubyXL/DataConsolidate.html +10 -14
  219. data/rdoc/RubyXL/DataConsolidationReference.html +10 -14
  220. data/rdoc/RubyXL/DataConsolidationReferences.html +10 -14
  221. data/rdoc/RubyXL/DataType.html +8 -34
  222. data/rdoc/RubyXL/DataValidation.html +10 -14
  223. data/rdoc/RubyXL/DataValidations.html +10 -14
  224. data/rdoc/RubyXL/DateGroupItem.html +10 -14
  225. data/rdoc/RubyXL/DefinedName.html +10 -14
  226. data/rdoc/RubyXL/DefinedNameExt.html +10 -14
  227. data/rdoc/RubyXL/DefinedNames.html +10 -14
  228. data/rdoc/RubyXL/DefinedNamesExt.html +10 -14
  229. data/rdoc/RubyXL/DocumentPropertiesFile.html +13 -57
  230. data/rdoc/RubyXL/DrawingFile.html +15 -44
  231. data/rdoc/RubyXL/DynamicFilter.html +10 -14
  232. data/rdoc/RubyXL/EmbeddedControl.html +10 -14
  233. data/rdoc/RubyXL/EmbeddedControls.html +10 -14
  234. data/rdoc/RubyXL/Extension.html +10 -14
  235. data/rdoc/RubyXL/ExtensionStorageArea.html +10 -14
  236. data/rdoc/RubyXL/Extents.html +10 -14
  237. data/rdoc/RubyXL/ExternalBook.html +10 -14
  238. data/rdoc/RubyXL/ExternalLinksFile.html +16 -45
  239. data/rdoc/RubyXL/ExternalReference.html +10 -14
  240. data/rdoc/RubyXL/ExternalReferences.html +10 -14
  241. data/rdoc/RubyXL/ExtraColorSchemeList.html +10 -14
  242. data/rdoc/RubyXL/FieldItem.html +10 -14
  243. data/rdoc/RubyXL/FileRecoveryProperties.html +10 -14
  244. data/rdoc/RubyXL/FileSharing.html +10 -14
  245. data/rdoc/RubyXL/FileVersion.html +10 -14
  246. data/rdoc/RubyXL/Fill.html +13 -31
  247. data/rdoc/RubyXL/Fills.html +13 -31
  248. data/rdoc/RubyXL/FilterContainer.html +10 -14
  249. data/rdoc/RubyXL/FloatNode.html +10 -14
  250. data/rdoc/RubyXL/FloatValue.html +10 -14
  251. data/rdoc/RubyXL/Font.html +13 -36
  252. data/rdoc/RubyXL/FontConvenienceMethods.html +11 -197
  253. data/rdoc/RubyXL/FontScheme.html +10 -14
  254. data/rdoc/RubyXL/Fonts.html +13 -31
  255. data/rdoc/RubyXL/Formula.html +10 -14
  256. data/rdoc/RubyXL/FunctionGroup.html +10 -14
  257. data/rdoc/RubyXL/FunctionGroups.html +10 -14
  258. data/rdoc/RubyXL/GenericStorageObject.html +14 -75
  259. data/rdoc/RubyXL/GradientFill.html +10 -14
  260. data/rdoc/RubyXL/HeaderFooterSettings.html +10 -14
  261. data/rdoc/RubyXL/Hyperlink.html +10 -14
  262. data/rdoc/RubyXL/HyperlinkRelFile.html +10 -19
  263. data/rdoc/RubyXL/Hyperlinks.html +10 -14
  264. data/rdoc/RubyXL/IconFilter.html +10 -14
  265. data/rdoc/RubyXL/IconSet.html +10 -14
  266. data/rdoc/RubyXL/IgnoredError.html +10 -14
  267. data/rdoc/RubyXL/IgnoredErrors.html +10 -14
  268. data/rdoc/RubyXL/IndexedColors.html +10 -14
  269. data/rdoc/RubyXL/InputCells.html +10 -14
  270. data/rdoc/RubyXL/IntegerNode.html +10 -14
  271. data/rdoc/RubyXL/IntegerValue.html +10 -14
  272. data/rdoc/RubyXL/LegacyCell.html +11 -28
  273. data/rdoc/RubyXL/LegacyWorksheet.html +16 -88
  274. data/rdoc/RubyXL/MRUColors.html +10 -14
  275. data/rdoc/RubyXL/MacrosFile.html +10 -22
  276. data/rdoc/RubyXL/MergedCell.html +10 -14
  277. data/rdoc/RubyXL/MergedCells.html +10 -14
  278. data/rdoc/RubyXL/NumFmt.html +10 -14
  279. data/rdoc/RubyXL/NumberFormat.html +13 -31
  280. data/rdoc/RubyXL/NumberFormats.html +13 -36
  281. data/rdoc/RubyXL/OLEObject.html +10 -14
  282. data/rdoc/RubyXL/OLEObjectFile.html +10 -22
  283. data/rdoc/RubyXL/OLEObjects.html +10 -14
  284. data/rdoc/RubyXL/OLESize.html +10 -14
  285. data/rdoc/RubyXL/OOXMLContainerObject.html +24 -116
  286. data/rdoc/RubyXL/OOXMLIgnored.html +14 -46
  287. data/rdoc/RubyXL/OOXMLObject.html +12 -19
  288. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +39 -84
  289. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +28 -141
  290. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +15 -169
  291. data/rdoc/RubyXL/OOXMLTopLevelObject.html +19 -103
  292. data/rdoc/RubyXL/OdbcOleDbProperties.html +10 -14
  293. data/rdoc/RubyXL/Offset.html +10 -14
  294. data/rdoc/RubyXL/OlapProperties.html +10 -14
  295. data/rdoc/RubyXL/OleItem.html +99 -0
  296. data/rdoc/RubyXL/OleItems.html +99 -0
  297. data/rdoc/RubyXL/OleLink.html +99 -0
  298. data/rdoc/RubyXL/OutlineProperties.html +10 -14
  299. data/rdoc/RubyXL/PageMargins.html +10 -14
  300. data/rdoc/RubyXL/PageSetup.html +10 -14
  301. data/rdoc/RubyXL/PageSetupProperties.html +10 -14
  302. data/rdoc/RubyXL/Pane.html +10 -14
  303. data/rdoc/RubyXL/Parser.html +13 -44
  304. data/rdoc/RubyXL/PatternFill.html +10 -14
  305. data/rdoc/RubyXL/PhoneticProperties.html +10 -14
  306. data/rdoc/RubyXL/PhoneticRun.html +10 -14
  307. data/rdoc/RubyXL/PivotArea.html +10 -14
  308. data/rdoc/RubyXL/PivotCache.html +10 -14
  309. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +12 -27
  310. data/rdoc/RubyXL/PivotCacheRecordsFile.html +10 -22
  311. data/rdoc/RubyXL/PivotCaches.html +10 -14
  312. data/rdoc/RubyXL/PivotReference.html +10 -14
  313. data/rdoc/RubyXL/PivotReferences.html +10 -14
  314. data/rdoc/RubyXL/PivotTableFile.html +12 -27
  315. data/rdoc/RubyXL/PivotTableSelection.html +10 -14
  316. data/rdoc/RubyXL/PresetGeometry.html +10 -14
  317. data/rdoc/RubyXL/PrintOptions.html +10 -14
  318. data/rdoc/RubyXL/PrinterSettingsFile.html +10 -22
  319. data/rdoc/RubyXL/ProtectedRange.html +10 -14
  320. data/rdoc/RubyXL/ProtectedRanges.html +10 -14
  321. data/rdoc/RubyXL/Protection.html +10 -14
  322. data/rdoc/RubyXL/QueryParameter.html +10 -14
  323. data/rdoc/RubyXL/QueryParameters.html +10 -14
  324. data/rdoc/RubyXL/QueryTable.html +15 -44
  325. data/rdoc/RubyXL/QueryTableDeletedField.html +10 -14
  326. data/rdoc/RubyXL/QueryTableDeletedFields.html +10 -14
  327. data/rdoc/RubyXL/QueryTableField.html +10 -14
  328. data/rdoc/RubyXL/QueryTableFields.html +10 -14
  329. data/rdoc/RubyXL/QueryTableRefresh.html +10 -14
  330. data/rdoc/RubyXL/RID.html +10 -14
  331. data/rdoc/RubyXL/RawOOXML.html +14 -51
  332. data/rdoc/RubyXL/Reference.html +14 -192
  333. data/rdoc/RubyXL/Relationship.html +10 -14
  334. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +11 -28
  335. data/rdoc/RubyXL/RelationshipSupport.html +14 -108
  336. data/rdoc/RubyXL/RevisionPointer.html +10 -14
  337. data/rdoc/RubyXL/RichText.html +14 -32
  338. data/rdoc/RubyXL/RichTextRun.html +13 -31
  339. data/rdoc/RubyXL/Row.html +22 -154
  340. data/rdoc/RubyXL/RowExt.html +10 -14
  341. data/rdoc/RubyXL/RunProperties.html +10 -14
  342. data/rdoc/RubyXL/Scenario.html +10 -14
  343. data/rdoc/RubyXL/Scenarios.html +10 -14
  344. data/rdoc/RubyXL/Selection.html +13 -31
  345. data/rdoc/RubyXL/ShapeGuide.html +10 -14
  346. data/rdoc/RubyXL/ShapeTextRectangle.html +10 -14
  347. data/rdoc/RubyXL/SharedStringsTable.html +14 -121
  348. data/rdoc/RubyXL/Sheet.html +10 -14
  349. data/rdoc/RubyXL/SheetCalculationProperties.html +10 -14
  350. data/rdoc/RubyXL/SheetData.html +15 -46
  351. data/rdoc/RubyXL/SheetDataExt.html +10 -14
  352. data/rdoc/RubyXL/SheetDataSet.html +10 -14
  353. data/rdoc/RubyXL/SheetName.html +10 -14
  354. data/rdoc/RubyXL/SheetNames.html +10 -14
  355. data/rdoc/RubyXL/Sheets.html +10 -14
  356. data/rdoc/RubyXL/SlicerCacheFile.html +10 -22
  357. data/rdoc/RubyXL/SlicerFile.html +10 -22
  358. data/rdoc/RubyXL/SmartTagProperties.html +10 -14
  359. data/rdoc/RubyXL/SmartTagType.html +10 -14
  360. data/rdoc/RubyXL/SmartTagTypes.html +10 -14
  361. data/rdoc/RubyXL/SmartTags.html +10 -14
  362. data/rdoc/RubyXL/SortCondition.html +10 -14
  363. data/rdoc/RubyXL/SortState.html +10 -14
  364. data/rdoc/RubyXL/Sqref.html +14 -46
  365. data/rdoc/RubyXL/Stop.html +10 -14
  366. data/rdoc/RubyXL/StringNode.html +10 -14
  367. data/rdoc/RubyXL/StringNodeW3C.html +14 -46
  368. data/rdoc/RubyXL/StringValue.html +10 -14
  369. data/rdoc/RubyXL/Stylesheet.html +14 -94
  370. data/rdoc/RubyXL/TableFile.html +10 -22
  371. data/rdoc/RubyXL/TableParts.html +10 -14
  372. data/rdoc/RubyXL/TableStyle.html +10 -14
  373. data/rdoc/RubyXL/TableStyles.html +10 -14
  374. data/rdoc/RubyXL/Text.html +13 -52
  375. data/rdoc/RubyXL/TextImportSettings.html +10 -14
  376. data/rdoc/RubyXL/Theme.html +14 -67
  377. data/rdoc/RubyXL/ThemeElements.html +10 -14
  378. data/rdoc/RubyXL/ThumbnailFile.html +10 -22
  379. data/rdoc/RubyXL/Top10.html +10 -14
  380. data/rdoc/RubyXL/VMLDrawingFile.html +12 -27
  381. data/rdoc/RubyXL/Variant.html +10 -14
  382. data/rdoc/RubyXL/Vector.html +13 -31
  383. data/rdoc/RubyXL/VectorValue.html +10 -14
  384. data/rdoc/RubyXL/VisualProperties.html +10 -14
  385. data/rdoc/RubyXL/WebPublishObject.html +10 -14
  386. data/rdoc/RubyXL/WebPublishObjects.html +10 -14
  387. data/rdoc/RubyXL/WebPublishingItem.html +10 -14
  388. data/rdoc/RubyXL/WebPublishingItems.html +10 -14
  389. data/rdoc/RubyXL/WebPublishingProperties.html +10 -14
  390. data/rdoc/RubyXL/WebQueryProperties.html +10 -14
  391. data/rdoc/RubyXL/Workbook.html +76 -465
  392. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +11 -223
  393. data/rdoc/RubyXL/WorkbookProperties.html +10 -14
  394. data/rdoc/RubyXL/WorkbookProtection.html +10 -14
  395. data/rdoc/RubyXL/WorkbookRoot.html +16 -101
  396. data/rdoc/RubyXL/WorkbookView.html +10 -14
  397. data/rdoc/RubyXL/WorkbookViews.html +10 -14
  398. data/rdoc/RubyXL/Worksheet.html +16 -132
  399. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +171 -987
  400. data/rdoc/RubyXL/WorksheetDimensions.html +10 -14
  401. data/rdoc/RubyXL/WorksheetFormatProperties.html +10 -14
  402. data/rdoc/RubyXL/WorksheetProperties.html +10 -14
  403. data/rdoc/RubyXL/WorksheetProtection.html +10 -14
  404. data/rdoc/RubyXL/WorksheetView.html +10 -14
  405. data/rdoc/RubyXL/WorksheetViews.html +10 -14
  406. data/rdoc/RubyXL/XF.html +10 -14
  407. data/rdoc/RubyXL.html +11 -321
  408. data/rdoc/created.rid +26 -26
  409. data/rdoc/css/rdoc.css +55 -6
  410. data/rdoc/index.html +13 -390
  411. data/rdoc/js/darkfish.js +22 -99
  412. data/rdoc/js/navigation.js +4 -40
  413. data/rdoc/js/navigation.js.gz +0 -0
  414. data/rdoc/js/search.js +32 -31
  415. data/rdoc/js/search_index.js +1 -1
  416. data/rdoc/js/search_index.js.gz +0 -0
  417. data/rdoc/js/searcher.js +6 -6
  418. data/rdoc/js/searcher.js.gz +0 -0
  419. data/rdoc/table_of_contents.html +33 -7
  420. data/rubyXL.gemspec +24 -31
  421. data/spec/lib/cell_spec.rb +44 -2
  422. data/spec/lib/rgb_color_spec.rb +16 -0
  423. data/spec/lib/worksheet_spec.rb +301 -0
  424. metadata +12 -10
  425. data/rdoc/js/jquery.js +0 -4
Binary file
data/rdoc/js/searcher.js CHANGED
@@ -51,20 +51,20 @@ Searcher.prototype = new function() {
51
51
 
52
52
  /* ----- Utilities ------ */
53
53
  function splitQuery(query) {
54
- return jQuery.grep(query.split(/(\s+|::?|\(\)?)/), function(string) {
54
+ return query.split(/(\s+|::?|\(\)?)/).filter(function(string) {
55
55
  return string.match(/\S/);
56
56
  });
57
57
  }
58
58
 
59
59
  function buildRegexps(queries) {
60
- return jQuery.map(queries, function(query) {
60
+ return queries.map(function(query) {
61
61
  return new RegExp(query.replace(/(.)/g, '([$1])([^$1]*?)'), 'i');
62
62
  });
63
63
  }
64
64
 
65
65
  function buildHilighters(queries) {
66
- return jQuery.map(queries, function(query) {
67
- return jQuery.map(query.split(''), function(l, i) {
66
+ return queries.map(function(query) {
67
+ return query.split('').map(function(l, i) {
68
68
  return '\u0001$' + (i*2+1) + '\u0002$' + (i*2+2);
69
69
  }).join('');
70
70
  });
@@ -221,9 +221,9 @@ Searcher.prototype = new function() {
221
221
  }
222
222
 
223
223
  function triggerResults(results, isLast) {
224
- jQuery.each(this.handlers, function(i, fn) {
224
+ this.handlers.forEach(function(fn) {
225
225
  fn.call(this, results, isLast)
226
- })
226
+ });
227
227
  }
228
228
  }
229
229
 
Binary file
@@ -4,24 +4,26 @@
4
4
  <head>
5
5
  <meta charset="UTF-8">
6
6
 
7
- <title>Table of Contents - rubyXL 3.4.5</title>
7
+ <title>Table of Contents - rubyXL 3.4.18</title>
8
8
 
9
9
  <script type="text/javascript">
10
10
  var rdoc_rel_prefix = "./";
11
11
  var index_rel_prefix = "./";
12
12
  </script>
13
13
 
14
- <script src="./js/jquery.js"></script>
15
- <script src="./js/darkfish.js"></script>
14
+ <script src="./js/navigation.js" defer></script>
15
+ <script src="./js/search.js" defer></script>
16
+ <script src="./js/search_index.js" defer></script>
17
+ <script src="./js/searcher.js" defer></script>
18
+ <script src="./js/darkfish.js" defer></script>
16
19
 
17
20
  <link href="./css/fonts.css" rel="stylesheet">
18
21
  <link href="./css/rdoc.css" rel="stylesheet">
19
22
 
20
23
 
21
-
22
24
  <body id="top" class="table-of-contents">
23
25
  <main role="main">
24
- <h1 class="class">Table of Contents - rubyXL 3.4.5</h1>
26
+ <h1 class="class">Table of Contents - rubyXL 3.4.18</h1>
25
27
 
26
28
  <h2 id="pages">Pages</h2>
27
29
  <ul>
@@ -67,12 +69,12 @@
67
69
  <li><a href="README_rdoc.html#label-I-2FO">I/O</a>
68
70
  <li><a href="README_rdoc.html#label-Miscellaneous">Miscellaneous</a>
69
71
  <li><a href="README_rdoc.html#label-Suppress+warnings+about+malformed+input+files">Suppress warnings about malformed input files</a>
72
+ <li><a href="README_rdoc.html#label-Data+validation+-28colloquially+referred+to+as+-22dropdown+list-22-29">Data validation (colloquially referred to as “dropdown list”)</a>
70
73
  <li><a href="README_rdoc.html#label-For+more+information">For more information</a>
71
74
  <li><a href="README_rdoc.html#label-Contributing+to+rubyXL">Contributing to rubyXL</a>
72
75
  <li><a href="README_rdoc.html#label-Copyright">Copyright</a>
73
76
  </ul>
74
77
  </li>
75
-
76
78
  </ul>
77
79
 
78
80
  <h2 id="classes">Classes and Modules</h2>
@@ -887,6 +889,15 @@
887
889
  <li class="class">
888
890
  <a href="RubyXL/OlapProperties.html">RubyXL::OlapProperties</a>
889
891
  </li>
892
+ <li class="class">
893
+ <a href="RubyXL/OleItem.html">RubyXL::OleItem</a>
894
+ </li>
895
+ <li class="class">
896
+ <a href="RubyXL/OleItems.html">RubyXL::OleItems</a>
897
+ </li>
898
+ <li class="class">
899
+ <a href="RubyXL/OleLink.html">RubyXL::OleLink</a>
900
+ </li>
890
901
  <li class="class">
891
902
  <a href="RubyXL/OutlineProperties.html">RubyXL::OutlineProperties</a>
892
903
  </li>
@@ -1494,6 +1505,11 @@
1494
1505
  &mdash;
1495
1506
  <span class="container">RubyXL::GenericStorageObject</span>
1496
1507
 
1508
+ <li class="method">
1509
+ <a href="RubyXL/WorksheetConvenienceMethods.html#method-i-add_validation_list">#add_validation_list</a>
1510
+ &mdash;
1511
+ <span class="container">RubyXL::WorksheetConvenienceMethods</span>
1512
+
1497
1513
  <li class="method">
1498
1514
  <a href="RubyXL/Workbook.html#method-i-add_worksheet">#add_worksheet</a>
1499
1515
  &mdash;
@@ -1974,6 +1990,11 @@
1974
1990
  &mdash;
1975
1991
  <span class="container">RubyXL::WorkbookConvenienceMethods</span>
1976
1992
 
1993
+ <li class="method">
1994
+ <a href="RubyXL/OOXMLObjectClassMethods.html#method-i-define_relationship">#define_relationship</a>
1995
+ &mdash;
1996
+ <span class="container">RubyXL::OOXMLObjectClassMethods</span>
1997
+
1977
1998
  <li class="method">
1978
1999
  <a href="RubyXL/RelationshipSupport/ClassMehods.html#method-i-define_relationship">#define_relationship</a>
1979
2000
  &mdash;
@@ -2644,6 +2665,11 @@
2644
2665
  &mdash;
2645
2666
  <span class="container">RubyXL::RelationshipSupport</span>
2646
2667
 
2668
+ <li class="method">
2669
+ <a href="RubyXL/CellConvenienceMethods.html#method-i-remove_formula">#remove_formula</a>
2670
+ &mdash;
2671
+ <span class="container">RubyXL::CellConvenienceMethods</span>
2672
+
2647
2673
  <li class="method">
2648
2674
  <a href="RubyXL/Cell.html#method-i-row">#row</a>
2649
2675
  &mdash;
@@ -2944,7 +2970,7 @@
2944
2970
 
2945
2971
  <footer id="validator-badges" role="contentinfo">
2946
2972
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
2947
- <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.1.1.
2973
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.2.
2948
2974
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
2949
2975
  </footer>
2950
2976
 
data/rubyXL.gemspec CHANGED
@@ -1,17 +1,17 @@
1
- # Generated by jeweler
1
+ # Generated by juwelier
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
3
+ # Instead, edit Juwelier::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: rubyXL 3.4.5 ruby lib
5
+ # stub: rubyXL 3.4.18 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "rubyXL".freeze
9
- s.version = "3.4.5"
9
+ s.version = "3.4.18"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib".freeze]
13
13
  s.authors = ["Vivek Bhagwat".freeze, "Wesha".freeze]
14
- s.date = "2019-06-13"
14
+ s.date = "2021-08-03"
15
15
  s.description = "rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents".freeze
16
16
  s.email = "bhagwat.vivek@gmail.com".freeze
17
17
  s.extra_rdoc_files = [
@@ -341,6 +341,9 @@ Gem::Specification.new do |s|
341
341
  "rdoc/RubyXL/OdbcOleDbProperties.html",
342
342
  "rdoc/RubyXL/Offset.html",
343
343
  "rdoc/RubyXL/OlapProperties.html",
344
+ "rdoc/RubyXL/OleItem.html",
345
+ "rdoc/RubyXL/OleItems.html",
346
+ "rdoc/RubyXL/OleLink.html",
344
347
  "rdoc/RubyXL/OutlineProperties.html",
345
348
  "rdoc/RubyXL/PageMargins.html",
346
349
  "rdoc/RubyXL/PageSetup.html",
@@ -486,7 +489,6 @@ Gem::Specification.new do |s|
486
489
  "rdoc/images/zoom.png",
487
490
  "rdoc/index.html",
488
491
  "rdoc/js/darkfish.js",
489
- "rdoc/js/jquery.js",
490
492
  "rdoc/js/navigation.js",
491
493
  "rdoc/js/navigation.js.gz",
492
494
  "rdoc/js/search.js",
@@ -500,6 +502,7 @@ Gem::Specification.new do |s|
500
502
  "spec/lib/color_spec.rb",
501
503
  "spec/lib/parser_spec.rb",
502
504
  "spec/lib/reference_spec.rb",
505
+ "spec/lib/rgb_color_spec.rb",
503
506
  "spec/lib/stylesheet_spec.rb",
504
507
  "spec/lib/text_spec.rb",
505
508
  "spec/lib/workbook_spec.rb",
@@ -512,39 +515,29 @@ Gem::Specification.new do |s|
512
515
  ]
513
516
  s.homepage = "http://github.com/gilt/rubyXL".freeze
514
517
  s.licenses = ["MIT".freeze]
515
- s.rubygems_version = "2.7.9".freeze
518
+ s.rubygems_version = "3.1.6".freeze
516
519
  s.summary = "rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents".freeze
517
520
 
518
521
  if s.respond_to? :specification_version then
519
522
  s.specification_version = 4
523
+ end
520
524
 
521
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
522
- s.add_runtime_dependency(%q<nokogiri>.freeze, [">= 1.4.4"])
523
- s.add_runtime_dependency(%q<rubyzip>.freeze, [">= 1.1.6"])
524
- s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
525
- s.add_development_dependency(%q<rake>.freeze, [">= 0"])
526
- s.add_development_dependency(%q<jeweler>.freeze, [">= 0"])
527
- s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
528
- s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
529
- s.add_development_dependency(%q<ruby-prof>.freeze, [">= 0"])
530
- s.add_development_dependency(%q<rspec_junit_formatter>.freeze, [">= 0"])
531
- else
532
- s.add_dependency(%q<nokogiri>.freeze, [">= 1.4.4"])
533
- s.add_dependency(%q<rubyzip>.freeze, [">= 1.1.6"])
534
- s.add_dependency(%q<bundler>.freeze, [">= 0"])
535
- s.add_dependency(%q<rake>.freeze, [">= 0"])
536
- s.add_dependency(%q<jeweler>.freeze, [">= 0"])
537
- s.add_dependency(%q<rspec>.freeze, [">= 0"])
538
- s.add_dependency(%q<simplecov>.freeze, [">= 0"])
539
- s.add_dependency(%q<ruby-prof>.freeze, [">= 0"])
540
- s.add_dependency(%q<rspec_junit_formatter>.freeze, [">= 0"])
541
- end
525
+ if s.respond_to? :add_runtime_dependency then
526
+ s.add_runtime_dependency(%q<nokogiri>.freeze, [">= 1.10.8"])
527
+ s.add_runtime_dependency(%q<rubyzip>.freeze, [">= 1.3.0"])
528
+ s.add_development_dependency(%q<bundler>.freeze, [">= 0"])
529
+ s.add_development_dependency(%q<rake>.freeze, [">= 0"])
530
+ s.add_development_dependency(%q<juwelier>.freeze, [">= 0"])
531
+ s.add_development_dependency(%q<rspec>.freeze, [">= 0"])
532
+ s.add_development_dependency(%q<simplecov>.freeze, [">= 0"])
533
+ s.add_development_dependency(%q<ruby-prof>.freeze, [">= 0"])
534
+ s.add_development_dependency(%q<rspec_junit_formatter>.freeze, [">= 0"])
542
535
  else
543
- s.add_dependency(%q<nokogiri>.freeze, [">= 1.4.4"])
544
- s.add_dependency(%q<rubyzip>.freeze, [">= 1.1.6"])
536
+ s.add_dependency(%q<nokogiri>.freeze, [">= 1.10.8"])
537
+ s.add_dependency(%q<rubyzip>.freeze, [">= 1.3.0"])
545
538
  s.add_dependency(%q<bundler>.freeze, [">= 0"])
546
539
  s.add_dependency(%q<rake>.freeze, [">= 0"])
547
- s.add_dependency(%q<jeweler>.freeze, [">= 0"])
540
+ s.add_dependency(%q<juwelier>.freeze, [">= 0"])
548
541
  s.add_dependency(%q<rspec>.freeze, [">= 0"])
549
542
  s.add_dependency(%q<simplecov>.freeze, [">= 0"])
550
543
  s.add_dependency(%q<ruby-prof>.freeze, [">= 0"])
@@ -31,6 +31,42 @@ describe RubyXL::Cell do
31
31
  cell = @worksheet.add_cell(r, c, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => 'Hello')))
32
32
  expect(cell.datatype).to eq(RubyXL::DataType::INLINE_STRING)
33
33
  end
34
+
35
+ it 'should properly handle dates' do
36
+ r = 3
37
+ c = 3
38
+
39
+ dt = Date.today
40
+ cell = @worksheet.add_cell(r, c, dt)
41
+ cell.set_number_format('ddd mmm dd, yyyy')
42
+ expect(cell.value).to eq(dt)
43
+
44
+ tm = DateTime.now
45
+ cell = @worksheet.add_cell(r, c, tm)
46
+ cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
47
+
48
+ # Due to rounding errors, we allow microsecond precision on DateTime.
49
+ expect((cell.value - tm).to_f).to be_within(1.0/86400e6).of(0)
50
+
51
+ tm = Time.now
52
+ cell = @worksheet.add_cell(r, c, tm)
53
+ cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
54
+
55
+ # Due to rounding errors, we allow microsecond precision on Time.
56
+ expect(cell.value - tm.to_datetime).to be_within(1.0/86400e6).of(0)
57
+
58
+ expected_date = "2020-10-15T14:00:00Z"
59
+ expected_datetime = Time.parse(expected_date).utc
60
+ raw_value = "44119.583333333328" # Obtained from parsing a xlsx file with the expected date
61
+ cell = @worksheet.add_cell(r, c, Time.now) # Force a date cell type
62
+ cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
63
+ cell.raw_value = raw_value
64
+ expect(cell.raw_value).to eq(raw_value), "Wrong raw value"
65
+ cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
66
+
67
+ # We expect exactly the same date
68
+ expect(cell.value.to_time.utc.iso8601).to eq(expected_datetime.iso8601)
69
+ end
34
70
  end
35
71
 
36
72
  describe '.change_fill' do
@@ -340,6 +376,12 @@ describe RubyXL::Cell do
340
376
  end
341
377
  end
342
378
 
379
+ context 'with RichText' do
380
+ it 'returns the value of the RichText' do
381
+ cell = RubyXL::Cell.new(is: RubyXL::RichText.new(t: RubyXL::Text.new(value: 'test')))
382
+ expect(cell.value).to eq('test')
383
+ end
384
+ end
343
385
  end
344
386
 
345
387
  describe '.change_contents' do
@@ -374,8 +416,8 @@ describe RubyXL::Cell do
374
416
  expect(@cell.formula).to be_nil
375
417
  end
376
418
 
377
- it 'should case cell value to match an BigDecimal that is passed in' do
378
- number = BigDecimal.new('1234.5678')
419
+ it 'should cause cell value to match a BigDecimal that is passed in' do
420
+ number = BigDecimal('1234.5678')
379
421
  @cell.change_contents(number)
380
422
  expect(@cell.value).to eq(number)
381
423
  expect(@cell.datatype).to be_nil
@@ -0,0 +1,16 @@
1
+ require 'spec_helper'
2
+ require 'rubyXL/convenience_methods/color'
3
+
4
+ describe RubyXL::RgbColor do
5
+ describe '.to_s' do
6
+ it 'should properly translate the color to string' do
7
+ rgb_color = RubyXL::RgbColor.new
8
+
9
+ rgb_color.r = 1
10
+ rgb_color.g = 2
11
+ rgb_color.b = 255
12
+
13
+ expect(rgb_color.to_s).to eq("0102ff")
14
+ end
15
+ end
16
+ end
@@ -653,6 +653,107 @@ describe RubyXL::Worksheet do
653
653
  end
654
654
  }
655
655
  end
656
+
657
+ describe 'merged_cells updating' do
658
+ context 'merged cells in the row' do
659
+ # | A1 | B1 | C1 | D1 | E1 |
660
+ # | A2 | MERGED | E2 |
661
+ # | A3 | B3 | C3 | D3 | E3 |
662
+ before do
663
+ @worksheet.merge_cells(1, 1, 1, 3)
664
+ expect(@worksheet.merged_cells.size).to eq 1
665
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D2"
666
+ end
667
+ it 'should delete merged cell' do
668
+ @worksheet.delete_row(1)
669
+ expect(@worksheet.merged_cells.size).to eq 0
670
+ end
671
+ end
672
+ context 'merged vertical two cells' do
673
+ # | A1 | B1 | C1 |
674
+ # | A2 | MERGED | C2 |
675
+ # | A3 | | C3 |
676
+ # | A4 | B4 | C4 |
677
+ before do
678
+ @worksheet.merge_cells(1, 1, 2, 1)
679
+ expect(@worksheet.merged_cells.size).to eq 1
680
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:B3"
681
+ end
682
+ it 'should delete merged cell' do
683
+ @worksheet.delete_row(1)
684
+ expect(@worksheet.merged_cells.size).to eq 0
685
+ end
686
+ end
687
+
688
+ context 'merged three or more rows' do
689
+ # | A1 | B1 | C1 | D1 | E1 |
690
+ # | A2 | | E2 |
691
+ # | A3 | MERGED | E3 |
692
+ # | A4 | | E4 |
693
+ # | A5 | B5 | C5 | D5 | E5 |
694
+ before do
695
+ @worksheet.merge_cells(1, 1, 3, 3)
696
+ expect(@worksheet.merged_cells.size).to eq 1
697
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
698
+ end
699
+
700
+ # | A2 | | E2 |
701
+ # | A3 | MERGED | E3 |
702
+ # | A4 | | E4 |
703
+ # | A5 | B5 | C5 | D5 | E5 |
704
+ it 'should updates merged cell when delete above the cell' do
705
+ @worksheet.delete_row(0)
706
+ expect(@worksheet.merged_cells.size).to eq 1
707
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B1:D3"
708
+ end
709
+
710
+ # | A1 | B1 | C1 | D1 | E1 |
711
+ # | A3 | MERGED | E3 |
712
+ # | A4 | | E4 |
713
+ # | A5 | B5 | C5 | D5 | E5 |
714
+ it 'should updates merged cell when delete top of the cell' do
715
+ @worksheet.delete_row(1)
716
+ expect(@worksheet.merged_cells.size).to eq 1
717
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
718
+ end
719
+
720
+ # | A1 | B1 | C1 | D1 | E1 |
721
+ # | A2 | MERGED | E2 |
722
+ # | A4 | | E4 |
723
+ # | A5 | B5 | C5 | D5 | E5 |
724
+ it 'should updates merged cell when delete middle of the cell' do
725
+ @worksheet.delete_row(2)
726
+ expect(@worksheet.merged_cells.size).to eq 1
727
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
728
+ end
729
+
730
+ # | A1 | B1 | C1 | D1 | E1 |
731
+ # | A2 | MERGED | E2 |
732
+ # | A3 | | E3 |
733
+ # | A5 | B5 | C5 | D5 | E5 |
734
+ it 'should updates merged cell when delete bottom of the cell' do
735
+ @worksheet.delete_row(3)
736
+ expect(@worksheet.merged_cells.size).to eq 1
737
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
738
+ end
739
+
740
+ # | A1 | B1 | C1 | D1 | E1 |
741
+ # | A2 | | E2 |
742
+ # | A3 | MERGED | E3 |
743
+ # | A4 | | E4 |
744
+ it 'should not updates merged cell when ldelete below the cell' do
745
+ @worksheet.delete_row(4)
746
+ expect(@worksheet.merged_cells.size).to eq 1
747
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
748
+ end
749
+ end
750
+ end
751
+
752
+ it 'should not make empty merged_cells when a worksheet does not have a merged cell' do
753
+ # If a worksheet has empty merged_cells, the xlsx file has an XML error and has to repair.
754
+ @worksheet.delete_row(0)
755
+ expect(@worksheet.merged_cells).to be_nil
756
+ end
656
757
  end
657
758
 
658
759
  describe '.insert_row' do
@@ -713,6 +814,57 @@ describe RubyXL::Worksheet do
713
814
  end
714
815
  }
715
816
  end
817
+
818
+ describe 'merged_cells updating' do
819
+ # | A1 | B1 | C1 | D1 |
820
+ # | A2 | MERGED | D2 |
821
+ # | A3 | | D3 |
822
+ # | A4 | B4 | C4 | D4 |
823
+ before do
824
+ @worksheet.merge_cells(1, 1, 2, 2)
825
+ expect(@worksheet.merged_cells.size).to eq 1
826
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
827
+ end
828
+
829
+ # | A1 | B1 | C1 | D1 |
830
+ # | | | | |
831
+ # | A2 | MERGED | D2 |
832
+ # | A3 | | D3 |
833
+ # | A4 | B4 | C4 | D4 |
834
+ it 'should updates merged cell when insert above the cell' do
835
+ @worksheet.insert_row(1)
836
+ expect(@worksheet.merged_cells.size).to eq 1
837
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B3:C4"
838
+ end
839
+
840
+ # | A1 | B1 | C1 | D1 |
841
+ # | A2 | | D2 |
842
+ # | | MERGED | |
843
+ # | A3 | | D3 |
844
+ # | A4 | B4 | C4 | D4 |
845
+ it 'should updates merged cell when insert into the cell' do
846
+ @worksheet.insert_row(2)
847
+ expect(@worksheet.merged_cells.size).to eq 1
848
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
849
+ end
850
+
851
+ # | A1 | B1 | C1 | D1 |
852
+ # | A2 | MERGED | D2 |
853
+ # | A3 | | D3 |
854
+ # | | | | |
855
+ # | A4 | B4 | C4 | D4 |
856
+ it 'should not updates merged cell when insert below the cell' do
857
+ @worksheet.insert_row(3)
858
+ expect(@worksheet.merged_cells.size).to eq 1
859
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
860
+ end
861
+ end
862
+
863
+ it 'should not make empty merged_cells when a worksheet does not have a merged cell' do
864
+ # If a worksheet has empty merged_cells, the xlsx file has an XML error and has to repair.
865
+ @worksheet.insert_row(0)
866
+ expect(@worksheet.merged_cells).to be_nil
867
+ end
716
868
  end
717
869
 
718
870
  describe '.delete_column' do
@@ -776,6 +928,107 @@ describe RubyXL::Worksheet do
776
928
  end
777
929
  }
778
930
  end
931
+
932
+ describe 'merged_cells updating' do
933
+ context 'merged cells in the column' do
934
+ # | A1 | B1 | C1 |
935
+ # | A2 | | C2 |
936
+ # | A3 | MERGED | C3 |
937
+ # | A4 | | C4 |
938
+ # | A5 | B5 | C5 |
939
+ before do
940
+ @worksheet.merge_cells(1, 1, 3, 1)
941
+ expect(@worksheet.merged_cells.size).to eq 1
942
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:B4"
943
+ end
944
+ it 'should delete merged cell' do
945
+ @worksheet.delete_column(1)
946
+ expect(@worksheet.merged_cells.size).to eq 0
947
+ end
948
+ end
949
+ context 'merged horizontal two cells' do
950
+ # | A1 | B1 | C1 | D1 |
951
+ # | A2 | MERGED | D2 |
952
+ # | A3 | B3 | C3 | D3 |
953
+ before do
954
+ @worksheet.merge_cells(1, 1, 1, 2)
955
+ expect(@worksheet.merged_cells.size).to eq 1
956
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C2"
957
+ end
958
+ it 'should delete merged cell' do
959
+ @worksheet.delete_column(1)
960
+ expect(@worksheet.merged_cells.size).to eq 0
961
+ end
962
+ end
963
+ context 'merged three or more columns' do
964
+ # | A1 | B1 | C1 | D1 | E1 |
965
+ # | A2 | | E2 |
966
+ # | A3 | MERGED | E3 |
967
+ # | A4 | | E4 |
968
+ # | A5 | B5 | C5 | D5 | E5 |
969
+ before do
970
+ @worksheet.merge_cells(1, 1, 3, 3)
971
+ expect(@worksheet.merged_cells.size).to eq 1
972
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
973
+ end
974
+ # | B1 | C1 | D1 | E1 |
975
+ # | | E2 |
976
+ # | MERGED | E3 |
977
+ # | | E4 |
978
+ # | B5 | C5 | D5 | E5 |
979
+ it 'should updates merged cell when delete before the cell' do
980
+ @worksheet.delete_column(0)
981
+ expect(@worksheet.merged_cells.size).to eq 1
982
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "A2:C4"
983
+ end
984
+ # | A1 | C1 | D1 | E1 |
985
+ # | A2 | | E2 |
986
+ # | A3 | MERGED | E3 |
987
+ # | A4 | | E4 |
988
+ # | A5 | C5 | D5 | E5 |
989
+ it 'should updates merged cell when delete left of the cell' do
990
+ @worksheet.delete_column(1)
991
+ expect(@worksheet.merged_cells.size).to eq 1
992
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
993
+ end
994
+ # | A1 | B1 | D1 | E1 |
995
+ # | A2 | | E2 |
996
+ # | A3 | MERGED | E3 |
997
+ # | A4 | | E4 |
998
+ # | A5 | B5 | D5 | E5 |
999
+ it 'should updates merged cell when delete center of the cell' do
1000
+ @worksheet.delete_column(2)
1001
+ expect(@worksheet.merged_cells.size).to eq 1
1002
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
1003
+ end
1004
+ # | A1 | B1 | C1 | E1 |
1005
+ # | A2 | | E2 |
1006
+ # | A3 | MERGED | E3 |
1007
+ # | A4 | | E4 |
1008
+ # | A5 | B5 | C5 | E5 |
1009
+ it 'should updates merged cell when delete right of the cell' do
1010
+ @worksheet.delete_column(3)
1011
+ expect(@worksheet.merged_cells.size).to eq 1
1012
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C4"
1013
+ end
1014
+ # | A1 | B1 | C1 | D1 |
1015
+ # | A2 | |
1016
+ # | A3 | MERGED |
1017
+ # | A4 | |
1018
+ # | A5 | B5 | C5 | D5 |
1019
+ it 'should not updates merged cell when delete after the cell' do
1020
+ @worksheet.delete_column(4)
1021
+ expect(@worksheet.merged_cells.size).to eq 1
1022
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D4"
1023
+ end
1024
+ end
1025
+ end
1026
+
1027
+ it 'should not make empty merged_cells when a worksheet does not have a merged cell' do
1028
+ # If a worksheet has empty merged_cells, the xlsx file has an XML error and has to repair.
1029
+ @worksheet.delete_column(0)
1030
+ expect(@worksheet.merged_cells).to be_nil
1031
+ end
779
1032
  end
780
1033
 
781
1034
  describe '.insert_column' do
@@ -834,6 +1087,54 @@ describe RubyXL::Worksheet do
834
1087
  end
835
1088
  }
836
1089
  end
1090
+
1091
+ describe 'merged_cells updating' do
1092
+ # | A1 | B1 | C1 | D1 |
1093
+ # | A2 | MERGED | D2 |
1094
+ # | A3 | | D3 |
1095
+ # | A4 | B4 | C4 | D4 |
1096
+ before do
1097
+ @worksheet.merge_cells(1, 1, 2, 2)
1098
+ expect(@worksheet.merged_cells.size).to eq 1
1099
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
1100
+ end
1101
+
1102
+ # | A1 | | B1 | C1 | D1 |
1103
+ # | A2 | | MERGED | D2 |
1104
+ # | A3 | | | D3 |
1105
+ # | A4 | | B4 | C4 | D4 |
1106
+ it 'should updates merged cell when insert before the cell' do
1107
+ @worksheet.insert_column(1)
1108
+ expect(@worksheet.merged_cells.size).to eq 1
1109
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "C2:D3"
1110
+ end
1111
+
1112
+ # | A1 | B1 | | C1 | D1 |
1113
+ # | A2 | MERGED | D2 |
1114
+ # | A3 | | D3 |
1115
+ # | A4 | B4 | | C4 | D4 |
1116
+ it 'should updates merged cell when insert into the cell' do
1117
+ @worksheet.insert_column(2)
1118
+ expect(@worksheet.merged_cells.size).to eq 1
1119
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:D3"
1120
+ end
1121
+
1122
+ # | A1 | B1 | C1 | | D1 |
1123
+ # | A2 | MERGED | | D2 |
1124
+ # | A3 | | | D3 |
1125
+ # | A4 | B4 | C4 | | D4 |
1126
+ it 'should not updates merged cell when insert after the cell' do
1127
+ @worksheet.insert_column(3)
1128
+ expect(@worksheet.merged_cells.size).to eq 1
1129
+ expect(@worksheet.merged_cells.first.ref.to_s).to eq "B2:C3"
1130
+ end
1131
+ end
1132
+
1133
+ it 'should not make empty merged_cells when a worksheet does not have a merged cell' do
1134
+ # If a worksheet has empty merged_cells, the xlsx file has an XML error and has to repair.
1135
+ @worksheet.insert_column(0)
1136
+ expect(@worksheet.merged_cells).to be_nil
1137
+ end
837
1138
  end
838
1139
 
839
1140
  describe '.insert_cell' do