rubyXL 3.4.38 → 3.4.40

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 (443) hide show
  1. checksums.yaml +4 -4
  2. data/README.rdoc +3 -4
  3. data/Rakefile +124 -26
  4. data/VERSION +1 -1
  5. data/bin/console +10 -0
  6. data/bin/setup +3 -0
  7. data/lib/rubyXL/cell.rb +2 -2
  8. data/lib/rubyXL/convenience_methods/cell.rb +17 -7
  9. data/lib/rubyXL/convenience_methods/worksheet.rb +41 -30
  10. data/lib/rubyXL/objects/border.rb +9 -6
  11. data/lib/rubyXL/objects/cell_style.rb +2 -0
  12. data/lib/rubyXL/objects/color.rb +3 -1
  13. data/lib/rubyXL/objects/container_nodes.rb +2 -0
  14. data/lib/rubyXL/objects/fill.rb +2 -0
  15. data/lib/rubyXL/objects/font.rb +2 -0
  16. data/lib/rubyXL/objects/ooxml_object.rb +16 -16
  17. data/lib/rubyXL/objects/reference.rb +38 -33
  18. data/lib/rubyXL/objects/root.rb +8 -1
  19. data/lib/rubyXL/objects/sheet_data.rb +7 -2
  20. data/lib/rubyXL/objects/simple_types.rb +101 -98
  21. data/lib/rubyXL/objects/workbook.rb +5 -5
  22. data/lib/rubyXL/objects/worksheet.rb +23 -4
  23. data/lib/rubyXL/version.rb +3 -0
  24. data/lib/rubyXL/worksheet.rb +5 -17
  25. data/lib/rubyXL.rb +1 -0
  26. data/rubyXL.gemspec +11 -480
  27. metadata +50 -424
  28. data/.circleci/config.yml +0 -71
  29. data/.codeclimate.yml +0 -3
  30. data/.rubocop.yml +0 -124
  31. data/CHANGELOG.md +0 -12
  32. data/Gemfile +0 -20
  33. data/rdoc/README_rdoc.html +0 -871
  34. data/rdoc/RubyXL/AExtension.html +0 -703
  35. data/rdoc/RubyXL/AExtensionStorageArea.html +0 -543
  36. data/rdoc/RubyXL/ActiveX.html +0 -654
  37. data/rdoc/RubyXL/ActiveXBinary.html +0 -560
  38. data/rdoc/RubyXL/AdjustHandleList.html +0 -539
  39. data/rdoc/RubyXL/Alignment.html +0 -539
  40. data/rdoc/RubyXL/AlternateContent.html +0 -543
  41. data/rdoc/RubyXL/AlternateUrls.html +0 -539
  42. data/rdoc/RubyXL/Authors.html +0 -539
  43. data/rdoc/RubyXL/AutoFilter.html +0 -539
  44. data/rdoc/RubyXL/AutoFilterColumn.html +0 -539
  45. data/rdoc/RubyXL/BinaryImageFile.html +0 -568
  46. data/rdoc/RubyXL/BodyProperties.html +0 -539
  47. data/rdoc/RubyXL/BooleanNode.html +0 -543
  48. data/rdoc/RubyXL/BooleanValue.html +0 -543
  49. data/rdoc/RubyXL/Border.html +0 -758
  50. data/rdoc/RubyXL/BorderEdge.html +0 -656
  51. data/rdoc/RubyXL/Borders.html +0 -608
  52. data/rdoc/RubyXL/Break.html +0 -539
  53. data/rdoc/RubyXL/BreakList.html +0 -539
  54. data/rdoc/RubyXL/CT_AdjPoint2D.html +0 -539
  55. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +0 -539
  56. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +0 -539
  57. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +0 -539
  58. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +0 -539
  59. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +0 -539
  60. data/rdoc/RubyXL/CT_Backdrop.html +0 -539
  61. data/rdoc/RubyXL/CT_Bevel.html +0 -539
  62. data/rdoc/RubyXL/CT_BiLevelEffect.html +0 -539
  63. data/rdoc/RubyXL/CT_BlendEffect.html +0 -539
  64. data/rdoc/RubyXL/CT_Blip.html +0 -539
  65. data/rdoc/RubyXL/CT_BlipFillProperties.html +0 -539
  66. data/rdoc/RubyXL/CT_BlurEffect.html +0 -539
  67. data/rdoc/RubyXL/CT_Camera.html +0 -539
  68. data/rdoc/RubyXL/CT_Color.html +0 -539
  69. data/rdoc/RubyXL/CT_ColorChangeEffect.html +0 -539
  70. data/rdoc/RubyXL/CT_ColorMapping.html +0 -539
  71. data/rdoc/RubyXL/CT_ColorScheme.html +0 -539
  72. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +0 -539
  73. data/rdoc/RubyXL/CT_ConnectionSite.html +0 -539
  74. data/rdoc/RubyXL/CT_ConnectionSiteList.html +0 -539
  75. data/rdoc/RubyXL/CT_DashStop.html +0 -539
  76. data/rdoc/RubyXL/CT_DashStopList.html +0 -539
  77. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +0 -539
  78. data/rdoc/RubyXL/CT_DuotoneEffect.html +0 -539
  79. data/rdoc/RubyXL/CT_EffectContainer.html +0 -539
  80. data/rdoc/RubyXL/CT_EffectList.html +0 -539
  81. data/rdoc/RubyXL/CT_EffectReference.html +0 -539
  82. data/rdoc/RubyXL/CT_EffectStyleItem.html +0 -539
  83. data/rdoc/RubyXL/CT_EffectStyleList.html +0 -539
  84. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +0 -539
  85. data/rdoc/RubyXL/CT_FillEffect.html +0 -539
  86. data/rdoc/RubyXL/CT_FillOverlayEffect.html +0 -539
  87. data/rdoc/RubyXL/CT_FillStyleList.html +0 -539
  88. data/rdoc/RubyXL/CT_FlatText.html +0 -539
  89. data/rdoc/RubyXL/CT_FontCollection.html +0 -539
  90. data/rdoc/RubyXL/CT_FontReference.html +0 -539
  91. data/rdoc/RubyXL/CT_GeomGuideList.html +0 -539
  92. data/rdoc/RubyXL/CT_GlowEffect.html +0 -539
  93. data/rdoc/RubyXL/CT_GradientFillProperties.html +0 -539
  94. data/rdoc/RubyXL/CT_GradientStop.html +0 -539
  95. data/rdoc/RubyXL/CT_GradientStopList.html +0 -539
  96. data/rdoc/RubyXL/CT_HSLEffect.html +0 -539
  97. data/rdoc/RubyXL/CT_HslColor.html +0 -539
  98. data/rdoc/RubyXL/CT_Hyperlink.html +0 -539
  99. data/rdoc/RubyXL/CT_InnerShadowEffect.html +0 -539
  100. data/rdoc/RubyXL/CT_LightRig.html +0 -539
  101. data/rdoc/RubyXL/CT_LineEndProperties.html +0 -539
  102. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +0 -539
  103. data/rdoc/RubyXL/CT_LineProperties.html +0 -539
  104. data/rdoc/RubyXL/CT_LineStyleList.html +0 -539
  105. data/rdoc/RubyXL/CT_LinearShadeProperties.html +0 -539
  106. data/rdoc/RubyXL/CT_LuminanceEffect.html +0 -539
  107. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +0 -539
  108. data/rdoc/RubyXL/CT_OuterShadowEffect.html +0 -539
  109. data/rdoc/RubyXL/CT_Path2D.html +0 -539
  110. data/rdoc/RubyXL/CT_Path2DArcTo.html +0 -539
  111. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +0 -539
  112. data/rdoc/RubyXL/CT_Path2DList.html +0 -539
  113. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +0 -539
  114. data/rdoc/RubyXL/CT_Path2DTo.html +0 -539
  115. data/rdoc/RubyXL/CT_PathShadeProperties.html +0 -539
  116. data/rdoc/RubyXL/CT_PatternFillProperties.html +0 -539
  117. data/rdoc/RubyXL/CT_Point3D.html +0 -539
  118. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +0 -539
  119. data/rdoc/RubyXL/CT_PresetColor.html +0 -539
  120. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +0 -539
  121. data/rdoc/RubyXL/CT_PresetShadowEffect.html +0 -539
  122. data/rdoc/RubyXL/CT_PresetTextShape.html +0 -539
  123. data/rdoc/RubyXL/CT_ReflectionEffect.html +0 -539
  124. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +0 -539
  125. data/rdoc/RubyXL/CT_RelativeRect.html +0 -539
  126. data/rdoc/RubyXL/CT_SRgbColor.html +0 -539
  127. data/rdoc/RubyXL/CT_ScRgbColor.html +0 -539
  128. data/rdoc/RubyXL/CT_Scene3D.html +0 -539
  129. data/rdoc/RubyXL/CT_SchemeColor.html +0 -539
  130. data/rdoc/RubyXL/CT_Shape3D.html +0 -539
  131. data/rdoc/RubyXL/CT_ShapeStyle.html +0 -539
  132. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +0 -539
  133. data/rdoc/RubyXL/CT_SphereCoords.html +0 -539
  134. data/rdoc/RubyXL/CT_StretchInfoProperties.html +0 -539
  135. data/rdoc/RubyXL/CT_StyleMatrix.html +0 -539
  136. data/rdoc/RubyXL/CT_StyleMatrixReference.html +0 -539
  137. data/rdoc/RubyXL/CT_SupplementalFont.html +0 -539
  138. data/rdoc/RubyXL/CT_SystemColor.html +0 -539
  139. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +0 -539
  140. data/rdoc/RubyXL/CT_TextBlipBullet.html +0 -539
  141. data/rdoc/RubyXL/CT_TextCharBullet.html +0 -539
  142. data/rdoc/RubyXL/CT_TextCharacterProperties.html +0 -539
  143. data/rdoc/RubyXL/CT_TextFont.html +0 -539
  144. data/rdoc/RubyXL/CT_TextListStyle.html +0 -539
  145. data/rdoc/RubyXL/CT_TextNormalAutofit.html +0 -539
  146. data/rdoc/RubyXL/CT_TextParagraphProperties.html +0 -539
  147. data/rdoc/RubyXL/CT_TextSpacing.html +0 -539
  148. data/rdoc/RubyXL/CT_TextTabStop.html +0 -539
  149. data/rdoc/RubyXL/CT_TextTabStopList.html +0 -539
  150. data/rdoc/RubyXL/CT_TileInfoProperties.html +0 -539
  151. data/rdoc/RubyXL/CT_TintEffect.html +0 -539
  152. data/rdoc/RubyXL/CT_Transform2D.html +0 -539
  153. data/rdoc/RubyXL/CT_TransformEffect.html +0 -539
  154. data/rdoc/RubyXL/CT_Vector3D.html +0 -539
  155. data/rdoc/RubyXL/CT_XYAdjustHandle.html +0 -539
  156. data/rdoc/RubyXL/CalculationChain.html +0 -633
  157. data/rdoc/RubyXL/CalculationChainCell.html +0 -539
  158. data/rdoc/RubyXL/CalculationProperties.html +0 -539
  159. data/rdoc/RubyXL/Cell.html +0 -1315
  160. data/rdoc/RubyXL/CellConvenienceMethods.html +0 -2290
  161. data/rdoc/RubyXL/CellExt.html +0 -539
  162. data/rdoc/RubyXL/CellSmartTag.html +0 -539
  163. data/rdoc/RubyXL/CellSmartTagProperty.html +0 -539
  164. data/rdoc/RubyXL/CellSmartTags.html +0 -539
  165. data/rdoc/RubyXL/CellStyle.html +0 -539
  166. data/rdoc/RubyXL/CellStyleXFs.html +0 -608
  167. data/rdoc/RubyXL/CellStyles.html +0 -608
  168. data/rdoc/RubyXL/CellValue.html +0 -609
  169. data/rdoc/RubyXL/CellWatch.html +0 -539
  170. data/rdoc/RubyXL/CellWatches.html +0 -539
  171. data/rdoc/RubyXL/CellXFs.html +0 -609
  172. data/rdoc/RubyXL/ChartColorsFile.html +0 -568
  173. data/rdoc/RubyXL/ChartFile.html +0 -664
  174. data/rdoc/RubyXL/ChartStyleFile.html +0 -568
  175. data/rdoc/RubyXL/ChartUserShapesFile.html +0 -568
  176. data/rdoc/RubyXL/Chartsheet.html +0 -743
  177. data/rdoc/RubyXL/ChartsheetPageSetup.html +0 -539
  178. data/rdoc/RubyXL/ChartsheetProperties.html +0 -539
  179. data/rdoc/RubyXL/ChartsheetProtection.html +0 -539
  180. data/rdoc/RubyXL/ChartsheetView.html +0 -539
  181. data/rdoc/RubyXL/ChartsheetViews.html +0 -539
  182. data/rdoc/RubyXL/Color.html +0 -629
  183. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +0 -774
  184. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +0 -845
  185. data/rdoc/RubyXL/ColorConvenienceClasses.html +0 -528
  186. data/rdoc/RubyXL/ColorConvenienceMethods.html +0 -606
  187. data/rdoc/RubyXL/ColorFilter.html +0 -539
  188. data/rdoc/RubyXL/ColorScale.html +0 -539
  189. data/rdoc/RubyXL/ColorSet.html +0 -539
  190. data/rdoc/RubyXL/Colors.html +0 -539
  191. data/rdoc/RubyXL/ColumnRange.html +0 -786
  192. data/rdoc/RubyXL/ColumnRanges.html +0 -773
  193. data/rdoc/RubyXL/Comment.html +0 -539
  194. data/rdoc/RubyXL/CommentList.html +0 -539
  195. data/rdoc/RubyXL/CommentsFile.html +0 -657
  196. data/rdoc/RubyXL/ConditionalFormatValue.html +0 -539
  197. data/rdoc/RubyXL/ConditionalFormatting.html +0 -539
  198. data/rdoc/RubyXL/ConditionalFormattingRule.html +0 -539
  199. data/rdoc/RubyXL/Connection.html +0 -539
  200. data/rdoc/RubyXL/ConnectionTable.html +0 -539
  201. data/rdoc/RubyXL/ConnectionTables.html +0 -539
  202. data/rdoc/RubyXL/ConnectionTextField.html +0 -539
  203. data/rdoc/RubyXL/ConnectionTextFields.html +0 -539
  204. data/rdoc/RubyXL/Connections.html +0 -633
  205. data/rdoc/RubyXL/ContentTypeDefault.html +0 -543
  206. data/rdoc/RubyXL/ContentTypeOverride.html +0 -543
  207. data/rdoc/RubyXL/ContentTypes.html +0 -721
  208. data/rdoc/RubyXL/ControlPropertiesFile.html +0 -568
  209. data/rdoc/RubyXL/CorePropertiesFile.html +0 -1013
  210. data/rdoc/RubyXL/CustomColor.html +0 -539
  211. data/rdoc/RubyXL/CustomColorList.html +0 -539
  212. data/rdoc/RubyXL/CustomFilter.html +0 -539
  213. data/rdoc/RubyXL/CustomFilters.html +0 -539
  214. data/rdoc/RubyXL/CustomGeometry.html +0 -539
  215. data/rdoc/RubyXL/CustomProperties.html +0 -539
  216. data/rdoc/RubyXL/CustomPropertiesFile.html +0 -568
  217. data/rdoc/RubyXL/CustomProperty.html +0 -539
  218. data/rdoc/RubyXL/CustomPropertyFile.html +0 -568
  219. data/rdoc/RubyXL/CustomSheetView.html +0 -539
  220. data/rdoc/RubyXL/CustomSheetViews.html +0 -539
  221. data/rdoc/RubyXL/CustomWorkbookView.html +0 -539
  222. data/rdoc/RubyXL/CustomWorkbookViews.html +0 -539
  223. data/rdoc/RubyXL/CustomXMLFile.html +0 -560
  224. data/rdoc/RubyXL/DXF.html +0 -539
  225. data/rdoc/RubyXL/DXFs.html +0 -539
  226. data/rdoc/RubyXL/DataBar.html +0 -539
  227. data/rdoc/RubyXL/DataConsolidate.html +0 -539
  228. data/rdoc/RubyXL/DataConsolidationReference.html +0 -539
  229. data/rdoc/RubyXL/DataConsolidationReferences.html +0 -539
  230. data/rdoc/RubyXL/DataType.html +0 -589
  231. data/rdoc/RubyXL/DataValidation.html +0 -539
  232. data/rdoc/RubyXL/DataValidations.html +0 -539
  233. data/rdoc/RubyXL/DateGroupItem.html +0 -539
  234. data/rdoc/RubyXL/DefinedName.html +0 -539
  235. data/rdoc/RubyXL/DefinedNameExt.html +0 -539
  236. data/rdoc/RubyXL/DefinedNames.html +0 -616
  237. data/rdoc/RubyXL/DefinedNamesExt.html +0 -539
  238. data/rdoc/RubyXL/DocumentPropertiesFile.html +0 -725
  239. data/rdoc/RubyXL/DrawingFile.html +0 -663
  240. data/rdoc/RubyXL/DynamicFilter.html +0 -539
  241. data/rdoc/RubyXL/EmbeddedControl.html +0 -539
  242. data/rdoc/RubyXL/EmbeddedControls.html +0 -539
  243. data/rdoc/RubyXL/Extension.html +0 -539
  244. data/rdoc/RubyXL/ExtensionStorageArea.html +0 -539
  245. data/rdoc/RubyXL/Extents.html +0 -539
  246. data/rdoc/RubyXL/ExternalBook.html +0 -539
  247. data/rdoc/RubyXL/ExternalLinksFile.html +0 -659
  248. data/rdoc/RubyXL/ExternalReference.html +0 -539
  249. data/rdoc/RubyXL/ExternalReferences.html +0 -539
  250. data/rdoc/RubyXL/ExtraColorSchemeList.html +0 -539
  251. data/rdoc/RubyXL/FieldItem.html +0 -539
  252. data/rdoc/RubyXL/FileRecoveryProperties.html +0 -539
  253. data/rdoc/RubyXL/FileSharing.html +0 -539
  254. data/rdoc/RubyXL/FileVersion.html +0 -539
  255. data/rdoc/RubyXL/Fill.html +0 -608
  256. data/rdoc/RubyXL/Fills.html +0 -608
  257. data/rdoc/RubyXL/FilterContainer.html +0 -539
  258. data/rdoc/RubyXL/FloatNode.html +0 -543
  259. data/rdoc/RubyXL/FloatValue.html +0 -543
  260. data/rdoc/RubyXL/Font.html +0 -626
  261. data/rdoc/RubyXL/FontConvenienceMethods.html +0 -1169
  262. data/rdoc/RubyXL/FontScheme.html +0 -539
  263. data/rdoc/RubyXL/Fonts.html +0 -608
  264. data/rdoc/RubyXL/Formula.html +0 -539
  265. data/rdoc/RubyXL/FunctionGroup.html +0 -539
  266. data/rdoc/RubyXL/FunctionGroups.html +0 -539
  267. data/rdoc/RubyXL/GenericStorageObject.html +0 -803
  268. data/rdoc/RubyXL/GradientFill.html +0 -539
  269. data/rdoc/RubyXL/HeaderFooterSettings.html +0 -539
  270. data/rdoc/RubyXL/Hyperlink.html +0 -539
  271. data/rdoc/RubyXL/HyperlinkRelFile.html +0 -560
  272. data/rdoc/RubyXL/Hyperlinks.html +0 -539
  273. data/rdoc/RubyXL/IconFilter.html +0 -539
  274. data/rdoc/RubyXL/IconSet.html +0 -539
  275. data/rdoc/RubyXL/IgnoredError.html +0 -539
  276. data/rdoc/RubyXL/IgnoredErrors.html +0 -539
  277. data/rdoc/RubyXL/IndexedColors.html +0 -539
  278. data/rdoc/RubyXL/InputCells.html +0 -539
  279. data/rdoc/RubyXL/IntegerNode.html +0 -543
  280. data/rdoc/RubyXL/IntegerValue.html +0 -543
  281. data/rdoc/RubyXL/LegacyCell.html +0 -597
  282. data/rdoc/RubyXL/LegacyWorksheet.html +0 -894
  283. data/rdoc/RubyXL/MRUColors.html +0 -539
  284. data/rdoc/RubyXL/MacrosFile.html +0 -568
  285. data/rdoc/RubyXL/MergedCell.html +0 -539
  286. data/rdoc/RubyXL/MergedCells.html +0 -539
  287. data/rdoc/RubyXL/NumFmt.html +0 -539
  288. data/rdoc/RubyXL/NumberFormat.html +0 -609
  289. data/rdoc/RubyXL/NumberFormats.html +0 -625
  290. data/rdoc/RubyXL/OLEObject.html +0 -539
  291. data/rdoc/RubyXL/OLEObjectFile.html +0 -568
  292. data/rdoc/RubyXL/OLEObjects.html +0 -539
  293. data/rdoc/RubyXL/OLESize.html +0 -539
  294. data/rdoc/RubyXL/OOXMLContainerObject.html +0 -916
  295. data/rdoc/RubyXL/OOXMLIgnored.html +0 -681
  296. data/rdoc/RubyXL/OOXMLObject.html +0 -561
  297. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +0 -1030
  298. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +0 -1092
  299. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +0 -1174
  300. data/rdoc/RubyXL/OOXMLTopLevelObject.html +0 -891
  301. data/rdoc/RubyXL/OdbcOleDbProperties.html +0 -539
  302. data/rdoc/RubyXL/Offset.html +0 -539
  303. data/rdoc/RubyXL/OlapProperties.html +0 -539
  304. data/rdoc/RubyXL/OleItem.html +0 -539
  305. data/rdoc/RubyXL/OleItems.html +0 -539
  306. data/rdoc/RubyXL/OleLink.html +0 -539
  307. data/rdoc/RubyXL/OutlineProperties.html +0 -539
  308. data/rdoc/RubyXL/PageMargins.html +0 -539
  309. data/rdoc/RubyXL/PageSetup.html +0 -539
  310. data/rdoc/RubyXL/PageSetupProperties.html +0 -539
  311. data/rdoc/RubyXL/Pane.html +0 -539
  312. data/rdoc/RubyXL/Parser.html +0 -670
  313. data/rdoc/RubyXL/PatternFill.html +0 -539
  314. data/rdoc/RubyXL/PersonMetadata.html +0 -568
  315. data/rdoc/RubyXL/PhoneticProperties.html +0 -539
  316. data/rdoc/RubyXL/PhoneticRun.html +0 -539
  317. data/rdoc/RubyXL/PivotArea.html +0 -539
  318. data/rdoc/RubyXL/PivotCache.html +0 -539
  319. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +0 -590
  320. data/rdoc/RubyXL/PivotCacheRecordsFile.html +0 -568
  321. data/rdoc/RubyXL/PivotCaches.html +0 -539
  322. data/rdoc/RubyXL/PivotReference.html +0 -539
  323. data/rdoc/RubyXL/PivotReferences.html +0 -539
  324. data/rdoc/RubyXL/PivotTableFile.html +0 -590
  325. data/rdoc/RubyXL/PivotTableSelection.html +0 -539
  326. data/rdoc/RubyXL/PresetGeometry.html +0 -539
  327. data/rdoc/RubyXL/PrintOptions.html +0 -539
  328. data/rdoc/RubyXL/PrinterSettingsFile.html +0 -568
  329. data/rdoc/RubyXL/ProtectedRange.html +0 -539
  330. data/rdoc/RubyXL/ProtectedRanges.html +0 -539
  331. data/rdoc/RubyXL/Protection.html +0 -539
  332. data/rdoc/RubyXL/QueryParameter.html +0 -539
  333. data/rdoc/RubyXL/QueryParameters.html +0 -539
  334. data/rdoc/RubyXL/QueryTable.html +0 -655
  335. data/rdoc/RubyXL/QueryTableDeletedField.html +0 -539
  336. data/rdoc/RubyXL/QueryTableDeletedFields.html +0 -539
  337. data/rdoc/RubyXL/QueryTableField.html +0 -539
  338. data/rdoc/RubyXL/QueryTableFields.html +0 -539
  339. data/rdoc/RubyXL/QueryTableRefresh.html +0 -539
  340. data/rdoc/RubyXL/RID.html +0 -543
  341. data/rdoc/RubyXL/RawOOXML.html +0 -703
  342. data/rdoc/RubyXL/Reference.html +0 -1376
  343. data/rdoc/RubyXL/Relationship.html +0 -543
  344. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +0 -604
  345. data/rdoc/RubyXL/RelationshipSupport.html +0 -943
  346. data/rdoc/RubyXL/RevisionPointer.html +0 -539
  347. data/rdoc/RubyXL/RichText.html +0 -611
  348. data/rdoc/RubyXL/RichTextRun.html +0 -608
  349. data/rdoc/RubyXL/Row.html +0 -1003
  350. data/rdoc/RubyXL/RowExt.html +0 -539
  351. data/rdoc/RubyXL/RunProperties.html +0 -539
  352. data/rdoc/RubyXL/Scenario.html +0 -539
  353. data/rdoc/RubyXL/Scenarios.html +0 -539
  354. data/rdoc/RubyXL/Selection.html +0 -616
  355. data/rdoc/RubyXL/ShapeGuide.html +0 -539
  356. data/rdoc/RubyXL/ShapeTextRectangle.html +0 -539
  357. data/rdoc/RubyXL/SharedStringsTable.html +0 -952
  358. data/rdoc/RubyXL/Sheet.html +0 -539
  359. data/rdoc/RubyXL/SheetCalculationProperties.html +0 -539
  360. data/rdoc/RubyXL/SheetData.html +0 -652
  361. data/rdoc/RubyXL/SheetDataExt.html +0 -539
  362. data/rdoc/RubyXL/SheetDataSet.html +0 -539
  363. data/rdoc/RubyXL/SheetMetadata.html +0 -568
  364. data/rdoc/RubyXL/SheetName.html +0 -539
  365. data/rdoc/RubyXL/SheetNames.html +0 -539
  366. data/rdoc/RubyXL/Sheets.html +0 -539
  367. data/rdoc/RubyXL/SlicerCacheFile.html +0 -568
  368. data/rdoc/RubyXL/SlicerFile.html +0 -568
  369. data/rdoc/RubyXL/SmartTagProperties.html +0 -539
  370. data/rdoc/RubyXL/SmartTagType.html +0 -539
  371. data/rdoc/RubyXL/SmartTagTypes.html +0 -539
  372. data/rdoc/RubyXL/SmartTags.html +0 -539
  373. data/rdoc/RubyXL/SortCondition.html +0 -539
  374. data/rdoc/RubyXL/SortState.html +0 -539
  375. data/rdoc/RubyXL/Sqref.html +0 -681
  376. data/rdoc/RubyXL/Stop.html +0 -539
  377. data/rdoc/RubyXL/StringNode.html +0 -543
  378. data/rdoc/RubyXL/StringNodeW3C.html +0 -681
  379. data/rdoc/RubyXL/StringValue.html +0 -543
  380. data/rdoc/RubyXL/Stylesheet.html +0 -864
  381. data/rdoc/RubyXL/TableFile.html +0 -568
  382. data/rdoc/RubyXL/TableParts.html +0 -543
  383. data/rdoc/RubyXL/TableStyle.html +0 -539
  384. data/rdoc/RubyXL/TableStyles.html +0 -539
  385. data/rdoc/RubyXL/Text.html +0 -679
  386. data/rdoc/RubyXL/TextImportSettings.html +0 -539
  387. data/rdoc/RubyXL/Theme.html +0 -1077
  388. data/rdoc/RubyXL/ThemeElements.html +0 -539
  389. data/rdoc/RubyXL/ThumbnailFile.html +0 -568
  390. data/rdoc/RubyXL/Top10.html +0 -539
  391. data/rdoc/RubyXL/VMLDrawingFile.html +0 -590
  392. data/rdoc/RubyXL/Variant.html +0 -539
  393. data/rdoc/RubyXL/Vector.html +0 -612
  394. data/rdoc/RubyXL/VectorValue.html +0 -543
  395. data/rdoc/RubyXL/VisualProperties.html +0 -539
  396. data/rdoc/RubyXL/WebPublishObject.html +0 -539
  397. data/rdoc/RubyXL/WebPublishObjects.html +0 -539
  398. data/rdoc/RubyXL/WebPublishingItem.html +0 -539
  399. data/rdoc/RubyXL/WebPublishingItems.html +0 -539
  400. data/rdoc/RubyXL/WebPublishingProperties.html +0 -539
  401. data/rdoc/RubyXL/WebQueryProperties.html +0 -539
  402. data/rdoc/RubyXL/Workbook.html +0 -2085
  403. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +0 -1407
  404. data/rdoc/RubyXL/WorkbookProperties.html +0 -539
  405. data/rdoc/RubyXL/WorkbookProtection.html +0 -539
  406. data/rdoc/RubyXL/WorkbookRoot.html +0 -933
  407. data/rdoc/RubyXL/WorkbookView.html +0 -539
  408. data/rdoc/RubyXL/WorkbookViews.html +0 -539
  409. data/rdoc/RubyXL/Worksheet.html +0 -1090
  410. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +0 -4076
  411. data/rdoc/RubyXL/WorksheetDimensions.html +0 -539
  412. data/rdoc/RubyXL/WorksheetFormatProperties.html +0 -543
  413. data/rdoc/RubyXL/WorksheetProperties.html +0 -539
  414. data/rdoc/RubyXL/WorksheetProtection.html +0 -539
  415. data/rdoc/RubyXL/WorksheetView.html +0 -539
  416. data/rdoc/RubyXL/WorksheetViews.html +0 -539
  417. data/rdoc/RubyXL/XF.html +0 -539
  418. data/rdoc/RubyXL.html +0 -1373
  419. data/rdoc/created.rid +0 -45
  420. data/rdoc/css/rdoc.css +0 -1955
  421. data/rdoc/index.html +0 -455
  422. data/rdoc/js/aliki.js +0 -511
  423. data/rdoc/js/bash_highlighter.js +0 -167
  424. data/rdoc/js/c_highlighter.js +0 -299
  425. data/rdoc/js/search_controller.js +0 -129
  426. data/rdoc/js/search_data.js +0 -1
  427. data/rdoc/js/search_navigation.js +0 -105
  428. data/rdoc/js/search_ranker.js +0 -239
  429. data/rdoc/js/theme-toggle.js +0 -112
  430. data/spec/lib/cell_spec.rb +0 -654
  431. data/spec/lib/color_spec.rb +0 -21
  432. data/spec/lib/parser_spec.rb +0 -118
  433. data/spec/lib/reference_spec.rb +0 -97
  434. data/spec/lib/rgb_color_spec.rb +0 -29
  435. data/spec/lib/stylesheet_spec.rb +0 -27
  436. data/spec/lib/text_spec.rb +0 -27
  437. data/spec/lib/workbook_spec.rb +0 -197
  438. data/spec/lib/worksheet_spec.rb +0 -1769
  439. data/spec/spec_helper.rb +0 -13
  440. data/test/input/.gitkeep +0 -0
  441. data/test/output/.gitkeep +0 -0
  442. data/test/test_parse_write.rb +0 -15
  443. data/tmp/.gitignore +0 -1
@@ -1,654 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
- require 'bigdecimal'
5
- require 'rubyXL/convenience_methods/font'
6
- require 'rubyXL/convenience_methods/cell'
7
-
8
- describe RubyXL::Cell do
9
- before do
10
- @workbook = RubyXL::Workbook.new
11
- @worksheet = @workbook.add_worksheet('Test Worksheet')
12
- @workbook.worksheets << @worksheet
13
- 11.times do |i|
14
- 11.times do |j|
15
- @worksheet.add_cell(i, j, "#{i}:#{j}")
16
- end
17
- end
18
- @cell = @worksheet[0][0]
19
- end
20
-
21
- describe '.add_cell' do
22
- it 'should properly assign data types' do
23
- r = 4
24
- c = 4
25
-
26
- cell = @worksheet.add_cell(r, c, 123)
27
- expect(cell.datatype).to be_nil
28
-
29
- cell = @worksheet.add_cell(r, c, "#{r}:#{c}")
30
- expect(cell.datatype).to eq(RubyXL::DataType::RAW_STRING)
31
-
32
- cell = @worksheet.add_cell(r, c, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => 'Hello')))
33
- expect(cell.datatype).to eq(RubyXL::DataType::INLINE_STRING)
34
- end
35
-
36
- it 'should properly handle dates' do
37
- r = 3
38
- c = 3
39
-
40
- dt = Date.today
41
- cell = @worksheet.add_cell(r, c, dt)
42
- cell.set_number_format('ddd mmm dd, yyyy')
43
- expect(cell.value).to eq(dt)
44
-
45
- tm = DateTime.now
46
- cell = @worksheet.add_cell(r, c, tm)
47
- cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
48
-
49
- # Due to rounding errors, we allow microsecond precision on DateTime.
50
- expect((cell.value - tm).to_f).to be_within(1.0 / 86400e6).of(0)
51
-
52
- tm = Time.now
53
- cell = @worksheet.add_cell(r, c, tm)
54
- cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
55
-
56
- # Due to rounding errors, we allow microsecond precision on Time.
57
- expect(cell.value - tm.to_datetime).to be_within(1.0 / 86400e6).of(0)
58
-
59
- expected_date = '2020-10-15T14:00:00Z'
60
- expected_datetime = Time.parse(expected_date).utc
61
- raw_value = '44119.583333333328' # Obtained from parsing a xlsx file with the expected date
62
- cell = @worksheet.add_cell(r, c, Time.now) # Force a date cell type
63
- cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
64
- cell.raw_value = raw_value
65
- expect(cell.raw_value).to eq(raw_value), 'Wrong raw value'
66
- cell.set_number_format('ddd mmm dd, yyyy HH:MM:SS')
67
-
68
- # We expect exactly the same date
69
- expect(cell.value.to_time.utc.iso8601).to eq(expected_datetime.iso8601)
70
- end
71
-
72
- it 'should raise against too long String' do
73
- ok_data = 'A' * 32767 # The limit is 32767
74
-
75
- expect {
76
- @worksheet.add_cell(0, 1, ok_data) # 32767 -> OK
77
- }.not_to raise_error
78
- expect {
79
- # 1 longer than the limit, so an exception must be thrown.
80
- @worksheet.add_cell(0, 2, "#{ok_data}x")
81
- }.to raise_error(ArgumentError)
82
- end
83
-
84
- it 'should raise against too long RichText' do
85
- ok_data = 'A' * 32767 # The limit is 32767
86
-
87
- expect {
88
- @worksheet.add_cell(0, 1, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => ok_data))) # 32767 -> OK
89
- }.not_to raise_error
90
- expect {
91
- # 1 longer than the limit, so an exception must be thrown.
92
- @worksheet.add_cell(0, 2, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => "#{ok_data}x")))
93
- }.to raise_error(ArgumentError)
94
- end
95
- end
96
-
97
- describe '.change_fill' do
98
- it 'should cause an error if hex color code not passed' do
99
- expect {
100
- @cell.change_fill('G')
101
- }.to raise_error(RuntimeError)
102
- end
103
-
104
- it 'should make cell fill color equal to hex color code passed' do
105
- @cell.change_fill('0f0f0f')
106
- expect(@cell.fill_color).to eq('0f0f0f')
107
- end
108
-
109
- it 'should cause an error if hex color code includes # character' do
110
- expect {
111
- @cell.change_fill('#0f0f0f')
112
- }.to raise_error(RuntimeError)
113
- end
114
- end
115
-
116
- describe '.change_font_name' do
117
- it 'should make font name match font name passed' do
118
- @cell.change_font_name('Arial')
119
- expect(@cell.font_name).to eq('Arial')
120
- end
121
- end
122
-
123
- describe '.change_font_size' do
124
- it 'should make font size match number passed' do
125
- @cell.change_font_size(30)
126
- expect(@cell.font_size).to eq(30)
127
- end
128
-
129
- it 'should cause an error if a string passed' do
130
- expect {
131
- @cell.change_font_size('20')
132
- }.to raise_error(RuntimeError)
133
- end
134
- end
135
-
136
- describe '.change_font_color' do
137
- it 'should cause an error if hex color code not passed' do
138
- expect {
139
- @cell.change_font_color('G')
140
- }.to raise_error(RuntimeError)
141
- end
142
-
143
- it 'should make cell font color equal to hex color code passed' do
144
- @cell.change_font_color('0f0f0f')
145
- expect(@cell.font_color).to eq('0f0f0f')
146
- end
147
-
148
- it 'should cause an error if hex color code includes # character' do
149
- expect {
150
- @cell.change_font_color('#0f0f0f')
151
- }.to raise_error(RuntimeError)
152
- end
153
- end
154
-
155
- describe '.change_font_italics' do
156
- it 'should make cell font italicized when true is passed' do
157
- expect(@cell.is_italicized).to be_nil
158
- @cell.change_font_italics(true)
159
- expect(@cell.is_italicized).to eq(true)
160
- end
161
- end
162
-
163
- describe '.change_font_bold' do
164
- it 'should make cell font bolded when true is passed' do
165
- expect(@cell.is_bolded).to be_nil
166
- @cell.change_font_bold(true)
167
- expect(@cell.is_bolded).to eq(true)
168
- end
169
- end
170
-
171
- describe '.change_font_underline' do
172
- it 'should make cell font underlined when true is passed' do
173
- expect(@cell.is_underlined).to be_nil
174
- @cell.change_font_underline(true)
175
- expect(@cell.is_underlined).to eq(true)
176
- end
177
- end
178
-
179
- describe '.change_font_strikethrough' do
180
- it 'should make cell font struckthrough when true is passed' do
181
- expect(@cell.is_struckthrough).to be_nil
182
- @cell.change_font_strikethrough(true)
183
- expect(@cell.is_struckthrough).to eq(true)
184
- end
185
- end
186
-
187
- describe '.change_horizontal_alignment' do
188
- it 'should cause cell to horizontally align as specified by the passed in string' do
189
- expect(@cell.horizontal_alignment).to be_nil
190
- @cell.change_horizontal_alignment('center')
191
- expect(@cell.horizontal_alignment).to eq('center')
192
- end
193
- end
194
-
195
- describe '.change_vertical_alignment' do
196
- it 'should cause cell to vertically align as specified by the passed in string' do
197
- expect(@cell.vertical_alignment).to be_nil
198
- @cell.change_vertical_alignment('center')
199
- expect(@cell.vertical_alignment).to eq('center')
200
- end
201
- end
202
-
203
- describe '.change_wrap' do
204
- it 'should cause cell to wrap align as specified by the passed in value' do
205
- expect(@cell.text_wrap).to be_nil
206
- @cell.change_text_wrap(true)
207
- expect(@cell.text_wrap).to eq(true)
208
- end
209
- end
210
-
211
- describe '.change_text_indent' do
212
- it 'should cause the cell to have the corresponding text indent' do
213
- expect(@cell.text_indent).to be_nil
214
- @cell.change_text_indent(2)
215
- expect(@cell.text_indent).to eq(2)
216
- end
217
-
218
- it 'should not cause other cells with the same style to have text indent' do
219
- another_cell = @worksheet[1][0]
220
- another_cell.style_index = @cell.style_index
221
- expect(another_cell.text_indent).to be_nil
222
- @cell.change_text_indent(2)
223
- expect(another_cell.text_indent).to be_nil
224
- end
225
- end
226
-
227
- describe '.change_border_color' do
228
- it 'should cause cell to have a colored top border' do
229
- expect(@cell.get_border_color(:top)).to be_nil
230
- @cell.change_border_color(:top, 'FF0000')
231
- expect(@cell.get_border_color(:top)).to eq('FF0000')
232
- end
233
-
234
- it 'should cause cell to have a colored bottom border' do
235
- expect(@cell.get_border_color(:bottom)).to be_nil
236
- @cell.change_border_color(:bottom, 'FF0000')
237
- expect(@cell.get_border_color(:bottom)).to eq('FF0000')
238
- end
239
-
240
- it 'should cause cell to have a colored left border' do
241
- expect(@cell.get_border_color(:left)).to be_nil
242
- @cell.change_border_color(:left, 'FF0000')
243
- expect(@cell.get_border_color(:left)).to eq('FF0000')
244
- end
245
-
246
- it 'should cause cell to have a colored right border' do
247
- expect(@cell.get_border_color(:right)).to be_nil
248
- @cell.change_border_color(:right, 'FF0000')
249
- expect(@cell.get_border_color(:right)).to eq('FF0000')
250
- end
251
-
252
- it 'should cause cell to have a colored diagonal border' do
253
- expect(@cell.get_border_color(:diagonal)).to be_nil
254
- @cell.change_border_color(:diagonal, 'FF0000')
255
- expect(@cell.get_border_color(:diagonal)).to eq('FF0000')
256
- end
257
-
258
- it 'is not overridden if the border style is set afterwards' do
259
- expect(@cell.get_border_color(:top)).to be_nil
260
- expect(@cell.get_border(:top)).to be_nil
261
- @cell.change_border_color(:top, 'FF0000')
262
- @cell.change_border(:top, 'thin')
263
- expect(@cell.get_border_color(:top)).to eq('FF0000')
264
- expect(@cell.get_border(:top)).to eq('thin')
265
- end
266
-
267
- it 'should not change the border color of another cell with the same style' do
268
- another_cell = @worksheet[0][1]
269
- @cell.change_border(:right, 'medium')
270
- another_cell.change_border(:right, 'medium')
271
- @cell.change_border_color(:right, 'FF0000')
272
- another_cell.change_border_color(:right, '008000')
273
- expect(@cell.get_border_color(:right)).to eq('FF0000')
274
- expect(another_cell.get_border_color(:right)).to eq('008000')
275
- end
276
- end
277
-
278
- describe '.change_border' do
279
- it 'should cause cell to have border at top with specified weight' do
280
- expect(@cell.get_border(:top)).to be_nil
281
- @cell.change_border(:top, 'thin')
282
- expect(@cell.get_border(:top)).to eq('thin')
283
- end
284
-
285
- it 'should cause cell to have border at right with specified weight' do
286
- expect(@cell.get_border(:right)).to be_nil
287
- @cell.change_border(:right, 'thin')
288
- expect(@cell.get_border(:right)).to eq('thin')
289
- end
290
-
291
- it 'should cause cell to have border at left with specified weight' do
292
- expect(@cell.get_border(:left)).to be_nil
293
- @cell.change_border(:left, 'thin')
294
- expect(@cell.get_border(:left)).to eq('thin')
295
- end
296
-
297
- it 'should cause cell to have border at bottom with specified weight' do
298
- expect(@cell.get_border(:bottom)).to be_nil
299
- @cell.change_border(:bottom, 'thin')
300
- expect(@cell.get_border(:bottom)).to eq('thin')
301
- end
302
-
303
- it 'should cause cell to have border at diagonal with specified weight' do
304
- expect(@cell.get_border(:diagonal)).to be_nil
305
- @cell.change_border(:diagonal, 'thin')
306
- expect(@cell.get_border(:diagonal)).to eq('thin')
307
- end
308
- end
309
-
310
- describe '.value' do
311
- it 'should return the value of a date' do
312
- date = Date.parse('January 1, 2011')
313
- @cell.change_contents(date)
314
- expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
315
- expect(@cell.value).to eq(date)
316
- end
317
-
318
- it 'should properly return value of inlineStr' do
319
- cell = @worksheet.add_cell(5, 5, RubyXL::RichText.new(:t => RubyXL::Text.new(:value => 'Hello')))
320
- expect(cell.value).to eq('Hello')
321
- end
322
-
323
- it 'should properly handle numeric values' do
324
- @cell.datatype = nil
325
- @cell.raw_value = '1'
326
- expect(@cell.value).to eq(1)
327
-
328
- @cell.raw_value = '10000000'
329
- expect(@cell.value).to eq(10000000)
330
-
331
- @cell.raw_value = '-10'
332
- expect(@cell.value).to eq(-10)
333
-
334
- @cell.raw_value = '0'
335
- expect(@cell.value).to eq(0)
336
-
337
- @cell.raw_value = '0.001'
338
- expect(@cell.value).to eq(0.001)
339
-
340
- @cell.raw_value = '-0.00000000001'
341
- expect(@cell.value).to eq(-0.00000000001)
342
-
343
- @cell.raw_value = '1E5'
344
- expect(@cell.value).to eq(100000.0)
345
-
346
- @cell.raw_value = '1E0'
347
- expect(@cell.value).to eq(1.0)
348
-
349
- @cell.raw_value = '1E-5'
350
- expect(@cell.value).to eq(0.00001)
351
-
352
- @cell.raw_value = '-1E5'
353
- expect(@cell.value).to eq(-100000.0)
354
-
355
- @cell.raw_value = '-1E0'
356
- expect(@cell.value).to eq(-1.0)
357
-
358
- @cell.raw_value = '-1E-5'
359
- expect(@cell.value).to eq(-0.00001)
360
-
361
- @cell.raw_value = '1DE-5'
362
- expect(@cell.value).to eq('1DE-5')
363
- end
364
-
365
- context '1900-based dates' do
366
- before(:each) { @workbook.date1904 = false }
367
- it 'should convert date numbers correctly' do
368
- date = 41019
369
- @cell.change_contents(date)
370
- expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
371
- expect(@cell.value).to eq(Date.parse('April 20, 2012'))
372
- @cell.change_contents(35981)
373
- expect(@cell.value).to eq(Date.parse('July 5, 1998'))
374
- @cell.change_contents(0.019467592592592595)
375
- expect(@cell.value).to eq(DateTime.parse('1899-12-31T00:28:02+00:00'))
376
- @cell.change_contents(1)
377
- expect(@cell.value).to eq(Date.parse('January 1, 1900'))
378
- @cell.change_contents(59)
379
- expect(@cell.value).to eq(Date.parse('February 28, 1900'))
380
- @cell.change_contents(60)
381
- # There's no way Ruby can return the nonexistent February 29th, so it has to be March 1st:
382
- expect(@cell.value).to eq(Date.parse('March 1, 1900'))
383
- @cell.change_contents(61)
384
- expect(@cell.value).to eq(Date.parse('March 1, 1900'))
385
- end
386
- end
387
-
388
- context '1904-based dates' do
389
- before(:each) { @workbook.date1904 = true }
390
- it 'should convert date numbers correctly' do
391
- date = 39557
392
- @cell.change_contents(date)
393
- expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
394
- expect(@cell.value).to eq(Date.parse('April 20, 2012'))
395
- @cell.change_contents(34519)
396
- expect(@cell.value).to eq(Date.parse('July 5, 1998'))
397
- end
398
- end
399
-
400
- context 'date before January 1, 1900' do
401
- it 'should parse as date' do
402
- @cell.set_number_format('h:mm:ss')
403
- @cell.datatype = nil
404
-
405
- @cell.raw_value = '0.97726851851851848'
406
- expect(@cell.is_date?).to be(true)
407
- expect(@cell.value).to eq(DateTime.parse('1899-12-31 23:27:16'))
408
- @cell.raw_value = '1.9467592592592595E-2'
409
- expect(@cell.is_date?).to be(true)
410
- expect(@cell.value).to eq(DateTime.parse('1899-12-31 00:28:02'))
411
- end
412
- end
413
-
414
- context 'with RichText' do
415
- it 'returns the value of the RichText' do
416
- cell = RubyXL::Cell.new(is: RubyXL::RichText.new(t: RubyXL::Text.new(value: 'test')))
417
- expect(cell.value).to eq('test')
418
- end
419
- end
420
- end
421
-
422
- describe '.change_contents' do
423
- it 'should cause cell value to match string or number that is passed in' do
424
- @cell.change_contents('TEST')
425
- expect(@cell.value).to eq('TEST')
426
- expect(@cell.formula).to be_nil
427
- end
428
-
429
- it 'should cause cell value to match a date that is passed in' do
430
- date = Date.parse('January 1, 2011')
431
- @cell.change_contents(date)
432
- expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
433
- expect(@cell.value).to eq(date)
434
- expect(@cell.datatype).to be_nil
435
- expect(@cell.formula).to be_nil
436
- end
437
-
438
- it 'should cause cell value to match a time that is passed in' do
439
- time = Time.parse('January 1, 2011')
440
- @cell.change_contents(time)
441
- expect(@cell).to receive(:is_date?).at_least(1).and_return(true)
442
- expect(@cell.value).to eq(time.to_datetime)
443
- expect(@cell.datatype).to be_nil
444
- expect(@cell.formula).to be_nil
445
- end
446
-
447
- it 'should case cell value to match a Float that is passed in' do
448
- number = 1.25
449
- @cell.change_contents(number)
450
- expect(@cell.value).to eq(number)
451
- expect(@cell.datatype).to be_nil
452
- expect(@cell.formula).to be_nil
453
- end
454
-
455
- it 'should case cell value to match an Integer that is passed in' do
456
- number = 1234567
457
- @cell.change_contents(number)
458
- expect(@cell.value).to eq(number)
459
- expect(@cell.datatype).to be_nil
460
- expect(@cell.formula).to be_nil
461
- end
462
-
463
- it 'should cause cell value to match a BigDecimal that is passed in' do
464
- number = BigDecimal('1234.5678')
465
- @cell.change_contents(number)
466
- expect(@cell.value).to eq(number)
467
- expect(@cell.datatype).to be_nil
468
- expect(@cell.formula).to be_nil
469
- end
470
-
471
- it 'should cause cell value and formula to match what is passed in' do
472
- @cell.change_contents(nil, 'SUM(A2:A4)')
473
- expect(@cell.value).to be_nil
474
- expect(@cell.formula.expression).to eq('SUM(A2:A4)')
475
- end
476
- end
477
-
478
- describe '.is_italicized' do
479
- it 'should correctly return whether or not the cell\'s font is italicized' do
480
- @cell.change_font_italics(true)
481
- expect(@cell.is_italicized).to eq(true)
482
- end
483
- end
484
-
485
- describe '.is_bolded' do
486
- it 'should correctly return whether or not the cell\'s font is bolded' do
487
- @cell.change_font_bold(true)
488
- expect(@cell.is_bolded).to eq(true)
489
- end
490
- end
491
-
492
- describe '.is_underlined' do
493
- it 'should correctly return whether or not the cell\'s font is underlined' do
494
- @cell.change_font_underline(true)
495
- expect(@cell.is_underlined).to eq(true)
496
- end
497
- end
498
-
499
- describe '.is_struckthrough' do
500
- it 'should correctly return whether or not the cell\'s font is struckthrough' do
501
- @cell.change_font_strikethrough(true)
502
- expect(@cell.is_struckthrough).to eq(true)
503
- end
504
- end
505
-
506
- describe '.font_name' do
507
- it 'should correctly return the name of the cell\'s font' do
508
- @cell.change_font_name('Verdana')
509
- expect(@cell.font_name).to eq('Verdana')
510
- end
511
- end
512
-
513
- describe '.font_size' do
514
- it 'should correctly return the size of the cell\'s font' do
515
- @cell.change_font_size(20)
516
- expect(@cell.font_size).to eq(20)
517
- end
518
- end
519
-
520
- describe '.font_color' do
521
- it 'should correctly return the color of the cell\'s font' do
522
- @cell.change_font_color('0f0f0f')
523
- expect(@cell.font_color).to eq('0f0f0f')
524
- end
525
-
526
- it 'should return 000000 (black) if no font color has been specified for this cell' do
527
- expect(@cell.font_color).to eq('000000')
528
- end
529
- end
530
-
531
- describe '.fill_color' do
532
- it 'should correctly return the color of the cell\'s fill' do
533
- @cell.change_fill('000000')
534
- expect(@cell.fill_color).to eq('000000')
535
- end
536
-
537
- it 'should return ffffff (white) if no fill color has been specified for this cell' do
538
- expect(@cell.fill_color).to eq('ffffff')
539
- end
540
- end
541
-
542
- describe '.horizontal_alignment' do
543
- it 'should correctly return the type of horizontal alignment of this cell' do
544
- @cell.change_horizontal_alignment('center')
545
- expect(@cell.horizontal_alignment).to eq('center')
546
- end
547
-
548
- it 'should return nil if no horizontal alignment has been specified for this cell' do
549
- expect(@cell.horizontal_alignment).to be_nil
550
- end
551
-
552
- it 'should not create new XFs when changing alignment to already existing values' do
553
- @cell.change_horizontal_alignment('left')
554
- style_xf1 = @cell.style_index
555
- @cell.change_horizontal_alignment('right')
556
- expect(@cell.style_index).not_to eq(style_xf1)
557
- style_xf2 = @cell.style_index
558
- @cell.change_horizontal_alignment('left')
559
- expect(@cell.style_index).to eq(style_xf1)
560
- @cell.change_horizontal_alignment('right')
561
- expect(@cell.style_index).to eq(style_xf2)
562
- end
563
- end
564
-
565
- describe '.vertical_alignment' do
566
- it 'should correctly return the type of vertical alignment of this cell' do
567
- @cell.change_vertical_alignment('center')
568
- expect(@cell.vertical_alignment).to eq('center')
569
- end
570
-
571
- it 'should return nil if no vertical alignment has been specified for this cell' do
572
- expect(@cell.vertical_alignment).to be_nil
573
- end
574
- end
575
-
576
- describe '.border_top' do
577
- it 'should correctly return the weight of the border on top for this cell' do
578
- @cell.change_border(:top, 'thin')
579
- expect(@cell.get_border(:top)).to eq('thin')
580
- end
581
-
582
- it 'should return nil if no top border has been specified for this cell' do
583
- expect(@cell.get_border(:top)).to be_nil
584
- end
585
- end
586
-
587
- describe '.border_left' do
588
- it 'should correctly return the weight of the border on left for this cell' do
589
- @cell.change_border(:left, 'thin')
590
- expect(@cell.get_border(:left)).to eq('thin')
591
- end
592
-
593
- it 'should return nil if no left border has been specified for this cell' do
594
- expect(@cell.get_border(:left)).to be_nil
595
- end
596
- end
597
-
598
- describe '.border_right' do
599
- it 'should correctly return the weight of the border on right for this cell' do
600
- @cell.change_border(:right, 'thin')
601
- expect(@cell.get_border(:right)).to eq('thin')
602
- end
603
-
604
- it 'should return nil if no right border has been specified for this cell' do
605
- expect(@cell.get_border(:right)).to be_nil
606
- end
607
- end
608
-
609
- describe '.border_bottom' do
610
- it 'should correctly return the weight of the border on bottom for this cell' do
611
- @cell.change_border(:bottom, 'thin')
612
- expect(@cell.get_border(:bottom)).to eq('thin')
613
- end
614
-
615
- it 'should return nil if no bottom border has been specified for this cell' do
616
- expect(@cell.get_border(:bottom)).to be_nil
617
- end
618
- end
619
-
620
- describe '.border_diagonal' do
621
- it 'should correctly return the weight of the diagonal border for this cell' do
622
- @cell.change_border(:diagonal, 'thin')
623
- expect(@cell.get_border(:diagonal)).to eq('thin')
624
- end
625
-
626
- it 'should return nil if no diagonal border has been specified for this cell' do
627
- expect(@cell.get_border(:diagonal)).to be_nil
628
- end
629
- end
630
-
631
- describe '.text_rotation' do
632
- it 'should correctly return the rotation for this cell' do
633
- expect(@cell.text_rotation).to be_nil
634
- @cell.change_text_rotation(45)
635
- expect(@cell.text_rotation).to eq(45)
636
- end
637
- end
638
-
639
- describe '.add_shared_string' do
640
- let(:add_shared_string) { Article.create(title: 'test', description: 'test') }
641
-
642
- it 'should correctly add a new shared string to the list' do
643
- @cell = @worksheet.add_cell(7, 0, 1)
644
- expect(@cell.datatype).to be_nil
645
-
646
- prior_strings = @workbook.shared_strings_container.strings.dup
647
- @cell.add_shared_string('testTEST')
648
- expect(@workbook.shared_strings_container.strings.size).to eq(prior_strings.size + 1)
649
- expect(@cell.datatype).to eq(RubyXL::DataType::SHARED_STRING)
650
- expect(@cell.value).to eq('testTEST')
651
- end
652
- end
653
-
654
- end
@@ -1,21 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'spec_helper'
4
- require 'rubyXL/convenience_methods/color'
5
-
6
- describe RubyXL::Color do
7
- describe '.validate_color' do
8
- it 'should return true if a valid hex color without a # is passed' do
9
- expect(RubyXL::Color.validate_color('0fbCAd')).to eq(true)
10
- end
11
-
12
- it 'should return true if a valid hex color with alpha is passed' do
13
- expect(RubyXL::Color.validate_color('01AbCdeF')).to eq(true)
14
- end
15
-
16
- it 'should cause an error if an invalid hex color code or one with a # is passed' do
17
- expect { RubyXL::Color.validate_color('#G') }.to raise_error(RuntimeError)
18
- expect { RubyXL::Color.validate_color('1234567') }.to raise_error(RuntimeError)
19
- end
20
- end
21
- end