rubyXL 3.4.38 → 3.4.41

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 (444) 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 +10 -2
  20. data/lib/rubyXL/objects/simple_types.rb +101 -98
  21. data/lib/rubyXL/objects/text.rb +6 -1
  22. data/lib/rubyXL/objects/workbook.rb +5 -5
  23. data/lib/rubyXL/objects/worksheet.rb +23 -4
  24. data/lib/rubyXL/version.rb +3 -0
  25. data/lib/rubyXL/worksheet.rb +5 -17
  26. data/lib/rubyXL.rb +1 -0
  27. data/rubyXL.gemspec +11 -480
  28. metadata +50 -424
  29. data/.circleci/config.yml +0 -71
  30. data/.codeclimate.yml +0 -3
  31. data/.rubocop.yml +0 -124
  32. data/CHANGELOG.md +0 -12
  33. data/Gemfile +0 -20
  34. data/rdoc/README_rdoc.html +0 -871
  35. data/rdoc/RubyXL/AExtension.html +0 -703
  36. data/rdoc/RubyXL/AExtensionStorageArea.html +0 -543
  37. data/rdoc/RubyXL/ActiveX.html +0 -654
  38. data/rdoc/RubyXL/ActiveXBinary.html +0 -560
  39. data/rdoc/RubyXL/AdjustHandleList.html +0 -539
  40. data/rdoc/RubyXL/Alignment.html +0 -539
  41. data/rdoc/RubyXL/AlternateContent.html +0 -543
  42. data/rdoc/RubyXL/AlternateUrls.html +0 -539
  43. data/rdoc/RubyXL/Authors.html +0 -539
  44. data/rdoc/RubyXL/AutoFilter.html +0 -539
  45. data/rdoc/RubyXL/AutoFilterColumn.html +0 -539
  46. data/rdoc/RubyXL/BinaryImageFile.html +0 -568
  47. data/rdoc/RubyXL/BodyProperties.html +0 -539
  48. data/rdoc/RubyXL/BooleanNode.html +0 -543
  49. data/rdoc/RubyXL/BooleanValue.html +0 -543
  50. data/rdoc/RubyXL/Border.html +0 -758
  51. data/rdoc/RubyXL/BorderEdge.html +0 -656
  52. data/rdoc/RubyXL/Borders.html +0 -608
  53. data/rdoc/RubyXL/Break.html +0 -539
  54. data/rdoc/RubyXL/BreakList.html +0 -539
  55. data/rdoc/RubyXL/CT_AdjPoint2D.html +0 -539
  56. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +0 -539
  57. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +0 -539
  58. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +0 -539
  59. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +0 -539
  60. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +0 -539
  61. data/rdoc/RubyXL/CT_Backdrop.html +0 -539
  62. data/rdoc/RubyXL/CT_Bevel.html +0 -539
  63. data/rdoc/RubyXL/CT_BiLevelEffect.html +0 -539
  64. data/rdoc/RubyXL/CT_BlendEffect.html +0 -539
  65. data/rdoc/RubyXL/CT_Blip.html +0 -539
  66. data/rdoc/RubyXL/CT_BlipFillProperties.html +0 -539
  67. data/rdoc/RubyXL/CT_BlurEffect.html +0 -539
  68. data/rdoc/RubyXL/CT_Camera.html +0 -539
  69. data/rdoc/RubyXL/CT_Color.html +0 -539
  70. data/rdoc/RubyXL/CT_ColorChangeEffect.html +0 -539
  71. data/rdoc/RubyXL/CT_ColorMapping.html +0 -539
  72. data/rdoc/RubyXL/CT_ColorScheme.html +0 -539
  73. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +0 -539
  74. data/rdoc/RubyXL/CT_ConnectionSite.html +0 -539
  75. data/rdoc/RubyXL/CT_ConnectionSiteList.html +0 -539
  76. data/rdoc/RubyXL/CT_DashStop.html +0 -539
  77. data/rdoc/RubyXL/CT_DashStopList.html +0 -539
  78. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +0 -539
  79. data/rdoc/RubyXL/CT_DuotoneEffect.html +0 -539
  80. data/rdoc/RubyXL/CT_EffectContainer.html +0 -539
  81. data/rdoc/RubyXL/CT_EffectList.html +0 -539
  82. data/rdoc/RubyXL/CT_EffectReference.html +0 -539
  83. data/rdoc/RubyXL/CT_EffectStyleItem.html +0 -539
  84. data/rdoc/RubyXL/CT_EffectStyleList.html +0 -539
  85. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +0 -539
  86. data/rdoc/RubyXL/CT_FillEffect.html +0 -539
  87. data/rdoc/RubyXL/CT_FillOverlayEffect.html +0 -539
  88. data/rdoc/RubyXL/CT_FillStyleList.html +0 -539
  89. data/rdoc/RubyXL/CT_FlatText.html +0 -539
  90. data/rdoc/RubyXL/CT_FontCollection.html +0 -539
  91. data/rdoc/RubyXL/CT_FontReference.html +0 -539
  92. data/rdoc/RubyXL/CT_GeomGuideList.html +0 -539
  93. data/rdoc/RubyXL/CT_GlowEffect.html +0 -539
  94. data/rdoc/RubyXL/CT_GradientFillProperties.html +0 -539
  95. data/rdoc/RubyXL/CT_GradientStop.html +0 -539
  96. data/rdoc/RubyXL/CT_GradientStopList.html +0 -539
  97. data/rdoc/RubyXL/CT_HSLEffect.html +0 -539
  98. data/rdoc/RubyXL/CT_HslColor.html +0 -539
  99. data/rdoc/RubyXL/CT_Hyperlink.html +0 -539
  100. data/rdoc/RubyXL/CT_InnerShadowEffect.html +0 -539
  101. data/rdoc/RubyXL/CT_LightRig.html +0 -539
  102. data/rdoc/RubyXL/CT_LineEndProperties.html +0 -539
  103. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +0 -539
  104. data/rdoc/RubyXL/CT_LineProperties.html +0 -539
  105. data/rdoc/RubyXL/CT_LineStyleList.html +0 -539
  106. data/rdoc/RubyXL/CT_LinearShadeProperties.html +0 -539
  107. data/rdoc/RubyXL/CT_LuminanceEffect.html +0 -539
  108. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +0 -539
  109. data/rdoc/RubyXL/CT_OuterShadowEffect.html +0 -539
  110. data/rdoc/RubyXL/CT_Path2D.html +0 -539
  111. data/rdoc/RubyXL/CT_Path2DArcTo.html +0 -539
  112. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +0 -539
  113. data/rdoc/RubyXL/CT_Path2DList.html +0 -539
  114. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +0 -539
  115. data/rdoc/RubyXL/CT_Path2DTo.html +0 -539
  116. data/rdoc/RubyXL/CT_PathShadeProperties.html +0 -539
  117. data/rdoc/RubyXL/CT_PatternFillProperties.html +0 -539
  118. data/rdoc/RubyXL/CT_Point3D.html +0 -539
  119. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +0 -539
  120. data/rdoc/RubyXL/CT_PresetColor.html +0 -539
  121. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +0 -539
  122. data/rdoc/RubyXL/CT_PresetShadowEffect.html +0 -539
  123. data/rdoc/RubyXL/CT_PresetTextShape.html +0 -539
  124. data/rdoc/RubyXL/CT_ReflectionEffect.html +0 -539
  125. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +0 -539
  126. data/rdoc/RubyXL/CT_RelativeRect.html +0 -539
  127. data/rdoc/RubyXL/CT_SRgbColor.html +0 -539
  128. data/rdoc/RubyXL/CT_ScRgbColor.html +0 -539
  129. data/rdoc/RubyXL/CT_Scene3D.html +0 -539
  130. data/rdoc/RubyXL/CT_SchemeColor.html +0 -539
  131. data/rdoc/RubyXL/CT_Shape3D.html +0 -539
  132. data/rdoc/RubyXL/CT_ShapeStyle.html +0 -539
  133. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +0 -539
  134. data/rdoc/RubyXL/CT_SphereCoords.html +0 -539
  135. data/rdoc/RubyXL/CT_StretchInfoProperties.html +0 -539
  136. data/rdoc/RubyXL/CT_StyleMatrix.html +0 -539
  137. data/rdoc/RubyXL/CT_StyleMatrixReference.html +0 -539
  138. data/rdoc/RubyXL/CT_SupplementalFont.html +0 -539
  139. data/rdoc/RubyXL/CT_SystemColor.html +0 -539
  140. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +0 -539
  141. data/rdoc/RubyXL/CT_TextBlipBullet.html +0 -539
  142. data/rdoc/RubyXL/CT_TextCharBullet.html +0 -539
  143. data/rdoc/RubyXL/CT_TextCharacterProperties.html +0 -539
  144. data/rdoc/RubyXL/CT_TextFont.html +0 -539
  145. data/rdoc/RubyXL/CT_TextListStyle.html +0 -539
  146. data/rdoc/RubyXL/CT_TextNormalAutofit.html +0 -539
  147. data/rdoc/RubyXL/CT_TextParagraphProperties.html +0 -539
  148. data/rdoc/RubyXL/CT_TextSpacing.html +0 -539
  149. data/rdoc/RubyXL/CT_TextTabStop.html +0 -539
  150. data/rdoc/RubyXL/CT_TextTabStopList.html +0 -539
  151. data/rdoc/RubyXL/CT_TileInfoProperties.html +0 -539
  152. data/rdoc/RubyXL/CT_TintEffect.html +0 -539
  153. data/rdoc/RubyXL/CT_Transform2D.html +0 -539
  154. data/rdoc/RubyXL/CT_TransformEffect.html +0 -539
  155. data/rdoc/RubyXL/CT_Vector3D.html +0 -539
  156. data/rdoc/RubyXL/CT_XYAdjustHandle.html +0 -539
  157. data/rdoc/RubyXL/CalculationChain.html +0 -633
  158. data/rdoc/RubyXL/CalculationChainCell.html +0 -539
  159. data/rdoc/RubyXL/CalculationProperties.html +0 -539
  160. data/rdoc/RubyXL/Cell.html +0 -1315
  161. data/rdoc/RubyXL/CellConvenienceMethods.html +0 -2290
  162. data/rdoc/RubyXL/CellExt.html +0 -539
  163. data/rdoc/RubyXL/CellSmartTag.html +0 -539
  164. data/rdoc/RubyXL/CellSmartTagProperty.html +0 -539
  165. data/rdoc/RubyXL/CellSmartTags.html +0 -539
  166. data/rdoc/RubyXL/CellStyle.html +0 -539
  167. data/rdoc/RubyXL/CellStyleXFs.html +0 -608
  168. data/rdoc/RubyXL/CellStyles.html +0 -608
  169. data/rdoc/RubyXL/CellValue.html +0 -609
  170. data/rdoc/RubyXL/CellWatch.html +0 -539
  171. data/rdoc/RubyXL/CellWatches.html +0 -539
  172. data/rdoc/RubyXL/CellXFs.html +0 -609
  173. data/rdoc/RubyXL/ChartColorsFile.html +0 -568
  174. data/rdoc/RubyXL/ChartFile.html +0 -664
  175. data/rdoc/RubyXL/ChartStyleFile.html +0 -568
  176. data/rdoc/RubyXL/ChartUserShapesFile.html +0 -568
  177. data/rdoc/RubyXL/Chartsheet.html +0 -743
  178. data/rdoc/RubyXL/ChartsheetPageSetup.html +0 -539
  179. data/rdoc/RubyXL/ChartsheetProperties.html +0 -539
  180. data/rdoc/RubyXL/ChartsheetProtection.html +0 -539
  181. data/rdoc/RubyXL/ChartsheetView.html +0 -539
  182. data/rdoc/RubyXL/ChartsheetViews.html +0 -539
  183. data/rdoc/RubyXL/Color.html +0 -629
  184. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +0 -774
  185. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +0 -845
  186. data/rdoc/RubyXL/ColorConvenienceClasses.html +0 -528
  187. data/rdoc/RubyXL/ColorConvenienceMethods.html +0 -606
  188. data/rdoc/RubyXL/ColorFilter.html +0 -539
  189. data/rdoc/RubyXL/ColorScale.html +0 -539
  190. data/rdoc/RubyXL/ColorSet.html +0 -539
  191. data/rdoc/RubyXL/Colors.html +0 -539
  192. data/rdoc/RubyXL/ColumnRange.html +0 -786
  193. data/rdoc/RubyXL/ColumnRanges.html +0 -773
  194. data/rdoc/RubyXL/Comment.html +0 -539
  195. data/rdoc/RubyXL/CommentList.html +0 -539
  196. data/rdoc/RubyXL/CommentsFile.html +0 -657
  197. data/rdoc/RubyXL/ConditionalFormatValue.html +0 -539
  198. data/rdoc/RubyXL/ConditionalFormatting.html +0 -539
  199. data/rdoc/RubyXL/ConditionalFormattingRule.html +0 -539
  200. data/rdoc/RubyXL/Connection.html +0 -539
  201. data/rdoc/RubyXL/ConnectionTable.html +0 -539
  202. data/rdoc/RubyXL/ConnectionTables.html +0 -539
  203. data/rdoc/RubyXL/ConnectionTextField.html +0 -539
  204. data/rdoc/RubyXL/ConnectionTextFields.html +0 -539
  205. data/rdoc/RubyXL/Connections.html +0 -633
  206. data/rdoc/RubyXL/ContentTypeDefault.html +0 -543
  207. data/rdoc/RubyXL/ContentTypeOverride.html +0 -543
  208. data/rdoc/RubyXL/ContentTypes.html +0 -721
  209. data/rdoc/RubyXL/ControlPropertiesFile.html +0 -568
  210. data/rdoc/RubyXL/CorePropertiesFile.html +0 -1013
  211. data/rdoc/RubyXL/CustomColor.html +0 -539
  212. data/rdoc/RubyXL/CustomColorList.html +0 -539
  213. data/rdoc/RubyXL/CustomFilter.html +0 -539
  214. data/rdoc/RubyXL/CustomFilters.html +0 -539
  215. data/rdoc/RubyXL/CustomGeometry.html +0 -539
  216. data/rdoc/RubyXL/CustomProperties.html +0 -539
  217. data/rdoc/RubyXL/CustomPropertiesFile.html +0 -568
  218. data/rdoc/RubyXL/CustomProperty.html +0 -539
  219. data/rdoc/RubyXL/CustomPropertyFile.html +0 -568
  220. data/rdoc/RubyXL/CustomSheetView.html +0 -539
  221. data/rdoc/RubyXL/CustomSheetViews.html +0 -539
  222. data/rdoc/RubyXL/CustomWorkbookView.html +0 -539
  223. data/rdoc/RubyXL/CustomWorkbookViews.html +0 -539
  224. data/rdoc/RubyXL/CustomXMLFile.html +0 -560
  225. data/rdoc/RubyXL/DXF.html +0 -539
  226. data/rdoc/RubyXL/DXFs.html +0 -539
  227. data/rdoc/RubyXL/DataBar.html +0 -539
  228. data/rdoc/RubyXL/DataConsolidate.html +0 -539
  229. data/rdoc/RubyXL/DataConsolidationReference.html +0 -539
  230. data/rdoc/RubyXL/DataConsolidationReferences.html +0 -539
  231. data/rdoc/RubyXL/DataType.html +0 -589
  232. data/rdoc/RubyXL/DataValidation.html +0 -539
  233. data/rdoc/RubyXL/DataValidations.html +0 -539
  234. data/rdoc/RubyXL/DateGroupItem.html +0 -539
  235. data/rdoc/RubyXL/DefinedName.html +0 -539
  236. data/rdoc/RubyXL/DefinedNameExt.html +0 -539
  237. data/rdoc/RubyXL/DefinedNames.html +0 -616
  238. data/rdoc/RubyXL/DefinedNamesExt.html +0 -539
  239. data/rdoc/RubyXL/DocumentPropertiesFile.html +0 -725
  240. data/rdoc/RubyXL/DrawingFile.html +0 -663
  241. data/rdoc/RubyXL/DynamicFilter.html +0 -539
  242. data/rdoc/RubyXL/EmbeddedControl.html +0 -539
  243. data/rdoc/RubyXL/EmbeddedControls.html +0 -539
  244. data/rdoc/RubyXL/Extension.html +0 -539
  245. data/rdoc/RubyXL/ExtensionStorageArea.html +0 -539
  246. data/rdoc/RubyXL/Extents.html +0 -539
  247. data/rdoc/RubyXL/ExternalBook.html +0 -539
  248. data/rdoc/RubyXL/ExternalLinksFile.html +0 -659
  249. data/rdoc/RubyXL/ExternalReference.html +0 -539
  250. data/rdoc/RubyXL/ExternalReferences.html +0 -539
  251. data/rdoc/RubyXL/ExtraColorSchemeList.html +0 -539
  252. data/rdoc/RubyXL/FieldItem.html +0 -539
  253. data/rdoc/RubyXL/FileRecoveryProperties.html +0 -539
  254. data/rdoc/RubyXL/FileSharing.html +0 -539
  255. data/rdoc/RubyXL/FileVersion.html +0 -539
  256. data/rdoc/RubyXL/Fill.html +0 -608
  257. data/rdoc/RubyXL/Fills.html +0 -608
  258. data/rdoc/RubyXL/FilterContainer.html +0 -539
  259. data/rdoc/RubyXL/FloatNode.html +0 -543
  260. data/rdoc/RubyXL/FloatValue.html +0 -543
  261. data/rdoc/RubyXL/Font.html +0 -626
  262. data/rdoc/RubyXL/FontConvenienceMethods.html +0 -1169
  263. data/rdoc/RubyXL/FontScheme.html +0 -539
  264. data/rdoc/RubyXL/Fonts.html +0 -608
  265. data/rdoc/RubyXL/Formula.html +0 -539
  266. data/rdoc/RubyXL/FunctionGroup.html +0 -539
  267. data/rdoc/RubyXL/FunctionGroups.html +0 -539
  268. data/rdoc/RubyXL/GenericStorageObject.html +0 -803
  269. data/rdoc/RubyXL/GradientFill.html +0 -539
  270. data/rdoc/RubyXL/HeaderFooterSettings.html +0 -539
  271. data/rdoc/RubyXL/Hyperlink.html +0 -539
  272. data/rdoc/RubyXL/HyperlinkRelFile.html +0 -560
  273. data/rdoc/RubyXL/Hyperlinks.html +0 -539
  274. data/rdoc/RubyXL/IconFilter.html +0 -539
  275. data/rdoc/RubyXL/IconSet.html +0 -539
  276. data/rdoc/RubyXL/IgnoredError.html +0 -539
  277. data/rdoc/RubyXL/IgnoredErrors.html +0 -539
  278. data/rdoc/RubyXL/IndexedColors.html +0 -539
  279. data/rdoc/RubyXL/InputCells.html +0 -539
  280. data/rdoc/RubyXL/IntegerNode.html +0 -543
  281. data/rdoc/RubyXL/IntegerValue.html +0 -543
  282. data/rdoc/RubyXL/LegacyCell.html +0 -597
  283. data/rdoc/RubyXL/LegacyWorksheet.html +0 -894
  284. data/rdoc/RubyXL/MRUColors.html +0 -539
  285. data/rdoc/RubyXL/MacrosFile.html +0 -568
  286. data/rdoc/RubyXL/MergedCell.html +0 -539
  287. data/rdoc/RubyXL/MergedCells.html +0 -539
  288. data/rdoc/RubyXL/NumFmt.html +0 -539
  289. data/rdoc/RubyXL/NumberFormat.html +0 -609
  290. data/rdoc/RubyXL/NumberFormats.html +0 -625
  291. data/rdoc/RubyXL/OLEObject.html +0 -539
  292. data/rdoc/RubyXL/OLEObjectFile.html +0 -568
  293. data/rdoc/RubyXL/OLEObjects.html +0 -539
  294. data/rdoc/RubyXL/OLESize.html +0 -539
  295. data/rdoc/RubyXL/OOXMLContainerObject.html +0 -916
  296. data/rdoc/RubyXL/OOXMLIgnored.html +0 -681
  297. data/rdoc/RubyXL/OOXMLObject.html +0 -561
  298. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +0 -1030
  299. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +0 -1092
  300. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +0 -1174
  301. data/rdoc/RubyXL/OOXMLTopLevelObject.html +0 -891
  302. data/rdoc/RubyXL/OdbcOleDbProperties.html +0 -539
  303. data/rdoc/RubyXL/Offset.html +0 -539
  304. data/rdoc/RubyXL/OlapProperties.html +0 -539
  305. data/rdoc/RubyXL/OleItem.html +0 -539
  306. data/rdoc/RubyXL/OleItems.html +0 -539
  307. data/rdoc/RubyXL/OleLink.html +0 -539
  308. data/rdoc/RubyXL/OutlineProperties.html +0 -539
  309. data/rdoc/RubyXL/PageMargins.html +0 -539
  310. data/rdoc/RubyXL/PageSetup.html +0 -539
  311. data/rdoc/RubyXL/PageSetupProperties.html +0 -539
  312. data/rdoc/RubyXL/Pane.html +0 -539
  313. data/rdoc/RubyXL/Parser.html +0 -670
  314. data/rdoc/RubyXL/PatternFill.html +0 -539
  315. data/rdoc/RubyXL/PersonMetadata.html +0 -568
  316. data/rdoc/RubyXL/PhoneticProperties.html +0 -539
  317. data/rdoc/RubyXL/PhoneticRun.html +0 -539
  318. data/rdoc/RubyXL/PivotArea.html +0 -539
  319. data/rdoc/RubyXL/PivotCache.html +0 -539
  320. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +0 -590
  321. data/rdoc/RubyXL/PivotCacheRecordsFile.html +0 -568
  322. data/rdoc/RubyXL/PivotCaches.html +0 -539
  323. data/rdoc/RubyXL/PivotReference.html +0 -539
  324. data/rdoc/RubyXL/PivotReferences.html +0 -539
  325. data/rdoc/RubyXL/PivotTableFile.html +0 -590
  326. data/rdoc/RubyXL/PivotTableSelection.html +0 -539
  327. data/rdoc/RubyXL/PresetGeometry.html +0 -539
  328. data/rdoc/RubyXL/PrintOptions.html +0 -539
  329. data/rdoc/RubyXL/PrinterSettingsFile.html +0 -568
  330. data/rdoc/RubyXL/ProtectedRange.html +0 -539
  331. data/rdoc/RubyXL/ProtectedRanges.html +0 -539
  332. data/rdoc/RubyXL/Protection.html +0 -539
  333. data/rdoc/RubyXL/QueryParameter.html +0 -539
  334. data/rdoc/RubyXL/QueryParameters.html +0 -539
  335. data/rdoc/RubyXL/QueryTable.html +0 -655
  336. data/rdoc/RubyXL/QueryTableDeletedField.html +0 -539
  337. data/rdoc/RubyXL/QueryTableDeletedFields.html +0 -539
  338. data/rdoc/RubyXL/QueryTableField.html +0 -539
  339. data/rdoc/RubyXL/QueryTableFields.html +0 -539
  340. data/rdoc/RubyXL/QueryTableRefresh.html +0 -539
  341. data/rdoc/RubyXL/RID.html +0 -543
  342. data/rdoc/RubyXL/RawOOXML.html +0 -703
  343. data/rdoc/RubyXL/Reference.html +0 -1376
  344. data/rdoc/RubyXL/Relationship.html +0 -543
  345. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +0 -604
  346. data/rdoc/RubyXL/RelationshipSupport.html +0 -943
  347. data/rdoc/RubyXL/RevisionPointer.html +0 -539
  348. data/rdoc/RubyXL/RichText.html +0 -611
  349. data/rdoc/RubyXL/RichTextRun.html +0 -608
  350. data/rdoc/RubyXL/Row.html +0 -1003
  351. data/rdoc/RubyXL/RowExt.html +0 -539
  352. data/rdoc/RubyXL/RunProperties.html +0 -539
  353. data/rdoc/RubyXL/Scenario.html +0 -539
  354. data/rdoc/RubyXL/Scenarios.html +0 -539
  355. data/rdoc/RubyXL/Selection.html +0 -616
  356. data/rdoc/RubyXL/ShapeGuide.html +0 -539
  357. data/rdoc/RubyXL/ShapeTextRectangle.html +0 -539
  358. data/rdoc/RubyXL/SharedStringsTable.html +0 -952
  359. data/rdoc/RubyXL/Sheet.html +0 -539
  360. data/rdoc/RubyXL/SheetCalculationProperties.html +0 -539
  361. data/rdoc/RubyXL/SheetData.html +0 -652
  362. data/rdoc/RubyXL/SheetDataExt.html +0 -539
  363. data/rdoc/RubyXL/SheetDataSet.html +0 -539
  364. data/rdoc/RubyXL/SheetMetadata.html +0 -568
  365. data/rdoc/RubyXL/SheetName.html +0 -539
  366. data/rdoc/RubyXL/SheetNames.html +0 -539
  367. data/rdoc/RubyXL/Sheets.html +0 -539
  368. data/rdoc/RubyXL/SlicerCacheFile.html +0 -568
  369. data/rdoc/RubyXL/SlicerFile.html +0 -568
  370. data/rdoc/RubyXL/SmartTagProperties.html +0 -539
  371. data/rdoc/RubyXL/SmartTagType.html +0 -539
  372. data/rdoc/RubyXL/SmartTagTypes.html +0 -539
  373. data/rdoc/RubyXL/SmartTags.html +0 -539
  374. data/rdoc/RubyXL/SortCondition.html +0 -539
  375. data/rdoc/RubyXL/SortState.html +0 -539
  376. data/rdoc/RubyXL/Sqref.html +0 -681
  377. data/rdoc/RubyXL/Stop.html +0 -539
  378. data/rdoc/RubyXL/StringNode.html +0 -543
  379. data/rdoc/RubyXL/StringNodeW3C.html +0 -681
  380. data/rdoc/RubyXL/StringValue.html +0 -543
  381. data/rdoc/RubyXL/Stylesheet.html +0 -864
  382. data/rdoc/RubyXL/TableFile.html +0 -568
  383. data/rdoc/RubyXL/TableParts.html +0 -543
  384. data/rdoc/RubyXL/TableStyle.html +0 -539
  385. data/rdoc/RubyXL/TableStyles.html +0 -539
  386. data/rdoc/RubyXL/Text.html +0 -679
  387. data/rdoc/RubyXL/TextImportSettings.html +0 -539
  388. data/rdoc/RubyXL/Theme.html +0 -1077
  389. data/rdoc/RubyXL/ThemeElements.html +0 -539
  390. data/rdoc/RubyXL/ThumbnailFile.html +0 -568
  391. data/rdoc/RubyXL/Top10.html +0 -539
  392. data/rdoc/RubyXL/VMLDrawingFile.html +0 -590
  393. data/rdoc/RubyXL/Variant.html +0 -539
  394. data/rdoc/RubyXL/Vector.html +0 -612
  395. data/rdoc/RubyXL/VectorValue.html +0 -543
  396. data/rdoc/RubyXL/VisualProperties.html +0 -539
  397. data/rdoc/RubyXL/WebPublishObject.html +0 -539
  398. data/rdoc/RubyXL/WebPublishObjects.html +0 -539
  399. data/rdoc/RubyXL/WebPublishingItem.html +0 -539
  400. data/rdoc/RubyXL/WebPublishingItems.html +0 -539
  401. data/rdoc/RubyXL/WebPublishingProperties.html +0 -539
  402. data/rdoc/RubyXL/WebQueryProperties.html +0 -539
  403. data/rdoc/RubyXL/Workbook.html +0 -2085
  404. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +0 -1407
  405. data/rdoc/RubyXL/WorkbookProperties.html +0 -539
  406. data/rdoc/RubyXL/WorkbookProtection.html +0 -539
  407. data/rdoc/RubyXL/WorkbookRoot.html +0 -933
  408. data/rdoc/RubyXL/WorkbookView.html +0 -539
  409. data/rdoc/RubyXL/WorkbookViews.html +0 -539
  410. data/rdoc/RubyXL/Worksheet.html +0 -1090
  411. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +0 -4076
  412. data/rdoc/RubyXL/WorksheetDimensions.html +0 -539
  413. data/rdoc/RubyXL/WorksheetFormatProperties.html +0 -543
  414. data/rdoc/RubyXL/WorksheetProperties.html +0 -539
  415. data/rdoc/RubyXL/WorksheetProtection.html +0 -539
  416. data/rdoc/RubyXL/WorksheetView.html +0 -539
  417. data/rdoc/RubyXL/WorksheetViews.html +0 -539
  418. data/rdoc/RubyXL/XF.html +0 -539
  419. data/rdoc/RubyXL.html +0 -1373
  420. data/rdoc/created.rid +0 -45
  421. data/rdoc/css/rdoc.css +0 -1955
  422. data/rdoc/index.html +0 -455
  423. data/rdoc/js/aliki.js +0 -511
  424. data/rdoc/js/bash_highlighter.js +0 -167
  425. data/rdoc/js/c_highlighter.js +0 -299
  426. data/rdoc/js/search_controller.js +0 -129
  427. data/rdoc/js/search_data.js +0 -1
  428. data/rdoc/js/search_navigation.js +0 -105
  429. data/rdoc/js/search_ranker.js +0 -239
  430. data/rdoc/js/theme-toggle.js +0 -112
  431. data/spec/lib/cell_spec.rb +0 -654
  432. data/spec/lib/color_spec.rb +0 -21
  433. data/spec/lib/parser_spec.rb +0 -118
  434. data/spec/lib/reference_spec.rb +0 -97
  435. data/spec/lib/rgb_color_spec.rb +0 -29
  436. data/spec/lib/stylesheet_spec.rb +0 -27
  437. data/spec/lib/text_spec.rb +0 -27
  438. data/spec/lib/workbook_spec.rb +0 -197
  439. data/spec/lib/worksheet_spec.rb +0 -1769
  440. data/spec/spec_helper.rb +0 -13
  441. data/test/input/.gitkeep +0 -0
  442. data/test/output/.gitkeep +0 -0
  443. data/test/test_parse_write.rb +0 -15
  444. data/tmp/.gitignore +0 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 653d773015a0aca3439878d0e16a4e91517cf07cf3c3a0ff62d72c56ebd307b6
4
- data.tar.gz: 7c58595e70a5be7e8ae8f9ecb5ced1eea4721a78f62653bd494b82ef5957d19f
3
+ metadata.gz: b0146904be1e8e16fa0909ecdea93f96b5f65cfbc2120f97620ebc44d09cd864
4
+ data.tar.gz: 7a190aedfc7863336d1561f9c61faf69219a665c5498bf7d41f20ed00e747121
5
5
  SHA512:
6
- metadata.gz: 216a635924307eb9180227ecda2b3817786985b40987826a74f031e7b99a4dba045d9fb97e6e5fedb5ffb87544c75852d82300f2a652627ecae7ad5f224f0802
7
- data.tar.gz: f7ec19093979640748284eda348c6bf49de9543003ef63e6454fc8e04c4fdcf06ef8a52ce45c09d8dbb60f7b00435884351412f98e83de7c1538829842756fc7
6
+ metadata.gz: b50ffd09b8973fbca82850362debd6dcc4871a85036ba4e023ff872063e3b01f693582bb1b25bbe4da7b3a2620c50328814f91536e3e1fb57f826e2402c5a934
7
+ data.tar.gz: 510ca8bf6936935cab53ad61a231ff73fbe6e8cedb1ba11dda9a34119ef8d86701a2b25d0142557e83b5f07466c890bcc2c6f9b104d486171ce9f71fbc99c847
data/README.rdoc CHANGED
@@ -138,17 +138,16 @@ Please note: these methods are being phased out in favor of the OOXML object mod
138
138
  cell = worksheet.add_cell(1, 1, 'B2')
139
139
  cell.change_border(:top, 'thin') # Sets the cell to have a top, thin border
140
140
  # Note that with diagonals, you have to specify which one of the diagonals (or both) you need.
141
- cell.change_border( :diagonal, 'thick', [ :diagonal_down ]) # Sets A1 to have a thin diagonal going from top left to bottom right
141
+ cell.change_border(:diagonal, 'thick', [ :diagonal_down ]) # Sets A1 to have a thick diagonal going from top left to bottom right
142
142
  # You can turn on both diagonals, but then they both will share the same style and color:
143
- cell.change_border( :diagonal, 'thick', [ :diagonal_down, :diagonal_up ])
143
+ cell.change_border(:diagonal, 'thick', [ :diagonal_down, :diagonal_up ])
144
144
 
145
145
  ===== Border Colors
146
146
  # Make sure you set the border style first so there's something to color.
147
147
  cell.change_border_color(:top, '0ba53d') # Sets top border color to green
148
- cell.change_border_color(:diagonal, 'dd0000') # Sets diaginal border color to red
148
+ cell.change_border_color(:diagonal, 'dd0000') # Sets diagonal border color to red
149
149
 
150
150
  ===== Changing whole row or column
151
-
152
151
  worksheet.change_row_border(0, :left, 'hairline') # Sets first row to have a left, hairline border
153
152
  worksheet.change_column_border(0, :diagonal, 'medium') # Sets first column to have diagonal, medium border
154
153
  worksheet.change_row_border_color(0, :top, '0ba53d') # Sets first row to have a green top border
data/Rakefile CHANGED
@@ -9,20 +9,25 @@ rescue Bundler::BundlerError => e
9
9
  exit e.status_code
10
10
  end
11
11
 
12
- require 'juwelier'
13
- Juwelier::Tasks.new do |gem|
14
- # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
15
- gem.name = 'rubyXL'
16
- gem.homepage = 'http://github.com/gilt/rubyXL'
17
- gem.license = 'MIT'
18
- gem.summary = %q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
19
- gem.description = %q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
20
- gem.email = 'bhagwat.vivek@gmail.com'
21
- gem.authors = ['Vivek Bhagwat', 'Wesha']
22
- # gem.required_ruby_version = '>2.1'
23
- # dependencies defined in Gemfile
12
+ require 'psych'
13
+ if defined?(Psych::ClassLoader) && defined?(Psych::ClassLoader::ALLOWED_CLASSES)
14
+ Psych::ClassLoader::ALLOWED_CLASSES << 'Gem::Specification'
24
15
  end
25
- Juwelier::RubygemsDotOrgTasks.new
16
+
17
+ #require 'juwelier'
18
+ #Juwelier::Tasks.new do |gem|
19
+ # # gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
20
+ # gem.name = 'rubyXL'
21
+ # gem.homepage = 'http://github.com/gilt/rubyXL'
22
+ # gem.license = 'MIT'
23
+ # gem.summary = %q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
24
+ # gem.description = %q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
25
+ # gem.email = 'bhagwat.vivek@gmail.com'
26
+ # gem.authors = ['Vivek Bhagwat', 'Wesha']
27
+ ## gem.required_ruby_version = '>2.1'
28
+ # dependencies defined in Gemfile
29
+ #end
30
+ #Juwelier::RubygemsDotOrgTasks.new
26
31
 
27
32
  require 'rake/testtask'
28
33
  Rake::TestTask.new(:test) do |test|
@@ -46,14 +51,16 @@ Rake::RDocTask.new do |rdoc|
46
51
  rdoc.rdoc_files.include('lib/**/*.rb')
47
52
  end
48
53
 
54
+ task :preload_library do
55
+ $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
56
+ require './lib/rubyXL'
57
+ end
58
+
49
59
  desc 'Dump profiling data with stackprof'
50
- task :stackprof do
60
+ task :stackprof => :preload_library do
51
61
  require 'benchmark'
52
62
  require 'stackprof'
53
63
 
54
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
55
- require './lib/rubyXL'
56
-
57
64
  spreadsheets = Dir.glob(File.join('test', 'input', '*.xls?')).sort!
58
65
 
59
66
  spreadsheets.each { |input|
@@ -74,30 +81,121 @@ task :stackprof do
74
81
  end
75
82
 
76
83
  desc 'Dump profiling data with ruby-prof'
77
- task :rubyprof do
78
- require 'benchmark'
84
+ task :rubyprof => :preload_library do
79
85
  require 'ruby-prof'
80
86
 
81
- $LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
82
- require './lib/rubyXL'
83
-
84
87
  spreadsheets = Dir.glob(File.join('test', 'input', '*.xls?')).sort!
85
88
 
86
89
  spreadsheets.each { |input|
87
90
  puts "<<<--- Profiling parsing of #{input}..."
88
91
  doc = nil
89
- result = RubyProf.profile {
92
+ result = RubyProf::Profile.profile {
90
93
  doc = RubyXL::Parser.parse(input)
91
94
  }
92
95
  printer = RubyProf::CallStackPrinter.new(result)
93
- File.open("tmp/ruby-prof-parse-#{File.basename(input)}.html", 'w') { |f| printer.print(f, {}) }
96
+ File.open("tmp/ruby-prof-parse-#{File.basename(input)}.html", 'w') { |f| printer.print(f) }
94
97
 
95
98
  output = File.join('test', 'output', File.basename(input))
96
99
  puts "--->>> Profiling writing of #{output}..."
97
- result = RubyProf.profile {
100
+ result = RubyProf::Profile.profile {
98
101
  doc.write(output)
99
102
  }
100
103
  printer = RubyProf::CallStackPrinter.new(result)
101
- File.open("tmp/ruby-prof-write-#{File.basename(input)}.html", 'w') { |f| printer.print(f, {}) }
104
+ File.open("tmp/ruby-prof-write-#{File.basename(input)}.html", 'w') { |f| printer.print(f) }
102
105
  }
103
106
  end
107
+
108
+ desc 'Start IRB with all runtime dependencies loaded'
109
+ task :console => :preload_library do
110
+ require "irb"
111
+ ::ARGV.pop # Do not allow IRB to grab Rake's parameter
112
+ IRB.start
113
+ end
114
+
115
+ desc 'Build gem into pkg'
116
+ task :build do
117
+ `gem build`
118
+ end
119
+
120
+ desc 'Displays the current version'
121
+ task :version => :preload_library do
122
+ puts RubyXL::VERSION
123
+ end
124
+
125
+
126
+ desc 'Releases the current version'
127
+ task :release => :preload_library do
128
+ `gem release`
129
+ end
130
+
131
+ namespace :version do
132
+ namespace :bump do
133
+ desc 'Bump the major version by 1'
134
+ task :major do
135
+ `gem bump major`
136
+ end
137
+ end
138
+ end
139
+
140
+ namespace :version do
141
+ namespace :bump do
142
+ desc 'Bump the minor version by 1'
143
+ task :minor do
144
+ `gem bump minor`
145
+ end
146
+ end
147
+ end
148
+
149
+ namespace :version do
150
+ namespace :bump do
151
+ desc 'Bump the patch version by 1'
152
+ task :patch do
153
+ `gem bump patch`
154
+ end
155
+ end
156
+ end
157
+
158
+ namespace :gemspec do
159
+ desc 'Generate gemspec'
160
+ task :generate do
161
+ Gem::Specification.new do |s|
162
+ s.name = "rubyXL"
163
+
164
+ require_relative 'lib/rubyXL/version'
165
+ s.version = RubyXL::VERSION
166
+ File.open('VERSION', 'w') { |f| f << s.version }
167
+
168
+ s.required_rubygems_version = Gem::Requirement.new(">= 0".freeze) if s.respond_to? :required_rubygems_version=
169
+ s.require_paths = ["lib".freeze]
170
+ s.authors = ["Vivek Bhagwat".freeze, "Wesha".freeze]
171
+ s.date = Date.today.to_s
172
+ s.description = "rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents".freeze
173
+ s.email = "bhagwat.vivek@gmail.com".freeze
174
+ s.homepage = "http://github.com/gilt/rubyXL".freeze
175
+ s.licenses = ["MIT".freeze]
176
+ s.rubygems_version = `gem -v`.strip
177
+ s.summary = "rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents".freeze
178
+
179
+ s.files = Dir.chdir(__dir__) do
180
+ Dir.glob('{lib,bin}/**/*').select { |f| File.file?(f) }
181
+ end + ['Rakefile', 'rubyXL.gemspec', 'VERSION']
182
+
183
+ s.extra_rdoc_files = [
184
+ "LICENSE.txt",
185
+ "README.rdoc"
186
+ ]
187
+
188
+ Bundler::Dsl.evaluate(File.expand_path("Gemfile", __dir__), nil, {}).dependencies.each do |dep|
189
+ reqs = dep.requirement.requirements.collect{ |op, ver| "#{op} #{ver.to_s}" }
190
+ if dep.groups.include?(:default) then
191
+ s.add_runtime_dependency(dep.name, reqs)
192
+ elsif !(dep.groups & [:development, :test]).empty? then
193
+ s.add_development_dependency(dep.name, reqs)
194
+ end
195
+ end
196
+
197
+ File.write("#{s.name}.gemspec", s.to_ruby)
198
+ end
199
+
200
+ end
201
+ end
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.38
1
+ 3.4.41
data/bin/console ADDED
@@ -0,0 +1,10 @@
1
+ #!/usr/bin/env ruby
2
+ # frozen_string_literal: true
3
+
4
+ $LOAD_PATH.unshift(File.expand_path("../lib", __dir__))
5
+
6
+ require "bundler/setup"
7
+ require "rubyXL"
8
+ require "irb"
9
+
10
+ IRB.start(__FILE__)
data/bin/setup ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env bash
2
+ set -e -u -v -x -o pipefail
3
+ bundle install
data/lib/rubyXL/cell.rb CHANGED
@@ -16,12 +16,12 @@ module RubyXL
16
16
  end
17
17
  }
18
18
  end
19
- raise "This cell #{self} is not in workbook #{workbook}"
19
+ raise RuntimeError, "Cell #{self} is not in workbook #{workbook}"
20
20
  end
21
21
 
22
22
  def validate_worksheet
23
23
  return if @worksheet && @worksheet[row] && @worksheet[row][column].equal?(self)
24
- raise "Cell #{self} is not in worksheet #{worksheet}"
24
+ raise RuntimeError, "Cell #{self} is not in worksheet #{worksheet}"
25
25
  end
26
26
  end
27
27
  end
@@ -1,5 +1,8 @@
1
1
  module RubyXL
2
2
  module CellConvenienceMethods
3
+ # Excel has a hard limit of 65'530 hyperlinks per Worksheet
4
+ MAX_HYPERLINKS_PER_WORKSHEET = 65530
5
+
3
6
  def change_contents(data, formula_expression = nil)
4
7
  validate_worksheet
5
8
 
@@ -21,10 +24,10 @@ module RubyXL
21
24
  def remove_formula
22
25
  self.formula = nil
23
26
 
24
- calculation_chain = workbook && workbook.calculation_chain
25
- calculation_cells = calculation_chain && calculation_chain.cells
26
- calculation_cells && calculation_cells.reject! { |c|
27
- c.ref.col_range.c == self.column && c.ref.row_range.begin == self.row
27
+ calculation_chain = workbook&.calculation_chain
28
+ calculation_cells = calculation_chain&.cells
29
+ calculation_cells&.reject! { |c|
30
+ (c.ref.first_col == self.column) && (c.ref.first_row == self.row)
28
31
  }
29
32
  end
30
33
 
@@ -180,7 +183,7 @@ module RubyXL
180
183
  # Changes font size of cell
181
184
  def change_font_size(font_size = 10)
182
185
  validate_worksheet
183
- raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)
186
+ raise(ArgumentError, 'Argument must be a number') unless font_size.is_a?(Integer) || font_size.is_a?(Float)
184
187
 
185
188
  font = get_cell_font.dup
186
189
  font.set_size(font_size)
@@ -249,11 +252,19 @@ module RubyXL
249
252
  when Worksheet::BOLD then change_font_bold(arg)
250
253
  when Worksheet::UNDERLINE then change_font_underline(arg)
251
254
  when Worksheet::STRIKETHROUGH then change_font_strikethrough(arg)
252
- else raise 'Invalid change_type'
255
+ else raise ArgumentError, "Invalid change_type: #{change_type}"
253
256
  end
254
257
  end
255
258
 
256
259
  def add_hyperlink(url, tooltip = nil)
260
+ if worksheet.hyperlinks then
261
+ if worksheet.hyperlinks.size >= MAX_HYPERLINKS_PER_WORKSHEET then
262
+ raise RuntimeError, "Maximum number of hyperlinks per worksheet (#{MAX_HYPERLINKS_PER_WORKSHEET}) reached"
263
+ end
264
+ else
265
+ worksheet.hyperlinks = RubyXL::Hyperlinks.new
266
+ end
267
+
257
268
  worksheet.relationship_container ||= RubyXL::OOXMLRelationshipsFile.new
258
269
  relationships = worksheet.relationship_container.relationships
259
270
  r_id = "rId#{relationships.size + 1}"
@@ -262,7 +273,6 @@ module RubyXL
262
273
 
263
274
  hyperlink = RubyXL::Hyperlink.new(:ref => self.r, :r_id => r_id)
264
275
  hyperlink.tooltip = tooltip if tooltip
265
- worksheet.hyperlinks ||= RubyXL::Hyperlinks.new
266
276
  worksheet.hyperlinks << hyperlink
267
277
  end
268
278
 
@@ -28,7 +28,7 @@ module RubyXL
28
28
  end
29
29
  }
30
30
  else
31
- raise 'invalid shift option'
31
+ raise ArgumentError, "Invalid shift option: #{shift}"
32
32
  end
33
33
 
34
34
  return add_cell(row, col, data, formula)
@@ -62,7 +62,7 @@ module RubyXL
62
62
  end
63
63
  }
64
64
  else
65
- raise 'invalid shift option'
65
+ raise ArgumentError, "Invalid shift option: #{shift}"
66
66
  end
67
67
 
68
68
  return old_cell
@@ -108,14 +108,14 @@ module RubyXL
108
108
  # Update merged cells for all rows below
109
109
  if self.merged_cells then
110
110
  merged_cells.each { |mc|
111
- next if mc.ref.row_range.last < row_index
111
+ next if mc.ref.last_row < row_index
112
112
 
113
- in_merged_cell = mc.ref.row_range.first < row_index
113
+ in_merged_cell = mc.ref.first_row < row_index
114
114
  mc.ref = RubyXL::Reference.new(
115
- mc.ref.row_range.first + (in_merged_cell ? 0 : 1),
116
- mc.ref.row_range.last + 1,
117
- mc.ref.col_range.first,
118
- mc.ref.col_range.last,
115
+ mc.ref.first_row + (in_merged_cell ? 0 : 1),
116
+ mc.ref.last_row + 1,
117
+ mc.ref.first_col,
118
+ mc.ref.last_col,
119
119
  )
120
120
  }
121
121
  end
@@ -137,18 +137,24 @@ module RubyXL
137
137
 
138
138
  # Update row number of merged cells
139
139
  if self.merged_cells then
140
- merged_cells.delete_if { |mc| mc.ref.row_range == (row_index..row_index) }
140
+ merged_cells.delete_if { |mc|
141
+ reference = mc.ref
142
+ (reference.first_row == row_index) && (reference.last_row == row_index)
143
+ }
144
+
141
145
  merged_cells.each { |mc|
142
- next if mc.ref.row_range.last < row_index
146
+ reference = mc.ref
147
+ next if reference.last_row < row_index
143
148
 
144
- in_merged_cell = mc.ref.row_range.first <= row_index
149
+ in_merged_cell = reference.first_row <= row_index
145
150
  mc.ref = RubyXL::Reference.new(
146
- mc.ref.row_range.first - (in_merged_cell ? 0 : 1),
147
- mc.ref.row_range.last - 1,
148
- mc.ref.col_range.first,
149
- mc.ref.col_range.last,
151
+ reference.first_row - (in_merged_cell ? 0 : 1),
152
+ reference.last_row - 1,
153
+ reference.first_col,
154
+ reference.last_col,
150
155
  )
151
156
  }
157
+
152
158
  merged_cells.delete_if { |mc| mc.ref.single_cell? }
153
159
  end
154
160
 
@@ -186,14 +192,14 @@ module RubyXL
186
192
  # Update merged cells for all rows below
187
193
  if self.merged_cells then
188
194
  merged_cells.each { |mc|
189
- next if mc.ref.col_range.last < column_index
195
+ next if mc.ref.last_col < column_index
190
196
 
191
- in_merged_cell = mc.ref.row_range.first < column_index
197
+ in_merged_cell = mc.ref.first_col < column_index
192
198
  mc.ref = RubyXL::Reference.new(
193
- mc.ref.row_range.first,
194
- mc.ref.row_range.last,
195
- mc.ref.col_range.first + (in_merged_cell ? 0 : 1),
196
- mc.ref.col_range.last + 1,
199
+ mc.ref.first_row,
200
+ mc.ref.last_row,
201
+ mc.ref.first_col + (in_merged_cell ? 0 : 1),
202
+ mc.ref.last_col + 1,
197
203
  )
198
204
  }
199
205
  end
@@ -221,16 +227,21 @@ module RubyXL
221
227
  # Update row number of merged cells
222
228
  return unless self.merged_cells
223
229
 
224
- merged_cells.delete_if { |mc| mc.ref.col_range == (column_index..column_index) }
230
+ merged_cells.delete_if { |mc|
231
+ reference = mc.ref
232
+ (reference.first_col == column_index) && (reference.last_col == column_index)
233
+ }
234
+
225
235
  merged_cells.each { |mc|
226
- next if mc.ref.col_range.last < column_index
236
+ reference = mc.ref
237
+ next if reference.last_col < column_index
227
238
 
228
- in_merged_cell = mc.ref.col_range.first <= column_index
239
+ in_merged_cell = reference.first_col <= column_index
229
240
  mc.ref = RubyXL::Reference.new(
230
- mc.ref.row_range.first,
231
- mc.ref.row_range.last,
232
- mc.ref.col_range.first - (in_merged_cell ? 0 : 1),
233
- mc.ref.col_range.last - 1,
241
+ reference.first_row,
242
+ reference.last_row,
243
+ reference.first_col - (in_merged_cell ? 0 : 1),
244
+ reference.last_col - 1,
234
245
  )
235
246
  }
236
247
 
@@ -704,11 +715,11 @@ module RubyXL
704
715
  row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
705
716
  when String then
706
717
  from, to = params[0].split(':')
707
- raise ArgumentError.new("reference for merging cells must be a range") if to.nil?
718
+ raise(ArgumentError, "Reference for merging cells must be a range") if to.nil?
708
719
  row_from, col_from = RubyXL::Reference.ref2ind(from)
709
720
  row_to, col_to = RubyXL::Reference.ref2ind(to)
710
721
  else
711
- raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
722
+ raise(ArgumentError, "Invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
712
723
  end
713
724
  end
714
725
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/simple_types'
3
5
 
@@ -6,8 +8,8 @@ module RubyXL
6
8
  define_attribute(:style, RubyXL::ST_BorderStyle, :default => 'none')
7
9
  define_child_node(RubyXL::Color)
8
10
 
9
- def set_rgb_color(font_color)
10
- self.color = RubyXL::Color.new(:rgb => font_color.to_s)
11
+ def set_rgb_color(edge_color)
12
+ self.color = RubyXL::Color.new(:rgb => edge_color.to_s)
11
13
  end
12
14
 
13
15
  def get_rgb_color
@@ -43,8 +45,8 @@ module RubyXL
43
45
  end
44
46
 
45
47
  if diagonals then
46
- self.diagonal_up = true if diagonals.index(:diagonal_up)
47
- self.diagonal_down = true if diagonals.index(:diagonal_down)
48
+ self.diagonal_up = true if diagonals.include?(:diagonal_up)
49
+ self.diagonal_down = true if diagonals.include?(:diagonal_down)
48
50
  end
49
51
  end
50
52
 
@@ -58,8 +60,9 @@ module RubyXL
58
60
  if edge
59
61
  edge.set_rgb_color(color)
60
62
  else
61
- self.send("#{direction}=", RubyXL::BorderEdge.new)
62
- self.send(direction).set_rgb_color(color)
63
+ edge = RubyXL::BorderEdge.new
64
+ edge.set_rgb_color(color)
65
+ self.send("#{direction}=", edge)
63
66
  end
64
67
  end
65
68
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/simple_types'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/simple_types'
3
5
 
@@ -18,7 +20,7 @@ module RubyXL
18
20
  if color =~ COLOR_REGEXP
19
21
  return true
20
22
  else
21
- raise 'invalid color'
23
+ raise ArgumentError, "Invalid color value: #{color}"
22
24
  end
23
25
  end
24
26
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/simple_types'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/simple_types'
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rubyXL/objects/ooxml_object'
2
4
  require 'rubyXL/objects/container_nodes'
3
5
  require 'rubyXL/objects/color'
@@ -34,7 +34,7 @@ module RubyXL
34
34
  # * +:bool+ - <tt>Boolean</tt> ("1" and "true" convert to +true+, others to +false+)
35
35
  # * one of +simple_types+ - <tt>String</tt>, plus the list of acceptable values is saved for future validation (not used yet).
36
36
  # * +extra_parameters+ - Hash of optional parameters as follows:
37
- # * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to classidied +attribute_name+.
37
+ # * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to snakecased +attribute_name+.
38
38
  # * +:default+ - Value this attribute defaults to if not explicitly provided.
39
39
  # * +:required+ - Whether this attribute is required when writing XML. If the value of the attrinute is not explicitly provided, +:default+ is written instead.
40
40
  # * +:computed+ - Do not store this attribute on +parse+, but do call the object-provided read accessor on +write_xml+.
@@ -52,6 +52,8 @@ module RubyXL
52
52
  attr_hash = { :attr_type => attr_type }
53
53
  attr_hash.merge!(extra_params) if extra_params
54
54
  attr_hash[:accessor] ||= accessorize(attr_name)
55
+ attr_hash[:instance_var] ||= "@#{attr_hash[:accessor]}".to_sym
56
+ attr_hash[:setter] ||= "#{attr_hash[:accessor]}=".to_sym
55
57
  attrs[attr_name.to_s] = attr_hash
56
58
  self.send(:attr_accessor, attr_hash[:accessor]) unless attr_hash[:computed]
57
59
  end
@@ -89,7 +91,9 @@ module RubyXL
89
91
  child_nodes[child_node_name] = {
90
92
  :class => klass,
91
93
  :is_array => extra_params[:collection],
92
- :accessor => accessor
94
+ :accessor => accessor,
95
+ :setter => "#{accessor}=".to_sym,
96
+ :instance_var => "@#{accessor}".to_sym
93
97
  }
94
98
 
95
99
  define_count_attribute if extra_params[:collection] == :with_count
@@ -164,7 +168,7 @@ module RubyXL
164
168
  end
165
169
 
166
170
  child_node_params = known_child_nodes[child_node_name]
167
- raise "Unknown child node [#{child_node_name}] for element [#{node.name}]" if child_node_params.nil?
171
+ raise(RuntimeError, "Unknown child node [#{child_node_name}] for element [#{node.name}]") if child_node_params.nil?
168
172
  parsed_object = child_node_params[:class].parse(child_node, known_namespaces)
169
173
  if child_node_params[:is_array] then
170
174
  index = parsed_object.index_in_collection
@@ -179,7 +183,7 @@ module RubyXL
179
183
  collection[index] = parsed_object
180
184
  end
181
185
  else
182
- obj.send("#{child_node_params[:accessor]}=", parsed_object)
186
+ obj.send(child_node_params[:setter], parsed_object)
183
187
  end
184
188
  }
185
189
  end
@@ -208,10 +212,10 @@ module RubyXL
208
212
  when :int then Integer(raw_value)
209
213
  when :uint then
210
214
  v = Integer(raw_value)
211
- raise ArgumentError.new("invalid value for unsigned Integer(): \"#{raw_value}\"") if v < 0
215
+ raise(ArgumentError, "Invalid value for unsigned Integer(): \"#{raw_value}\"") if v < 0
212
216
  v
213
217
  end
214
- obj.send("#{params[:accessor]}=", val)
218
+ obj.send(params[:setter], val)
215
219
  end
216
220
  end
217
221
 
@@ -230,10 +234,9 @@ module RubyXL
230
234
 
231
235
  def initialize(params = nil)
232
236
  @local_namespaces = nil
233
- params ||= {}
234
237
 
235
238
  obtain_class_variable(:@@ooxml_attributes).each_value { |v|
236
- instance_variable_set("@#{v[:accessor]}", params[v[:accessor]]) unless v[:computed]
239
+ instance_variable_set(v[:instance_var], params&.[](v[:accessor])) unless v[:computed]
237
240
  }
238
241
 
239
242
  init_child_nodes(params)
@@ -242,15 +245,14 @@ module RubyXL
242
245
  def init_child_nodes(params)
243
246
  obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
244
247
  initial_value =
245
- if params.has_key?(v[:accessor]) then params[v[:accessor]]
248
+ if params&.has_key?(v[:accessor]) then params[v[:accessor]]
246
249
  elsif v[:is_array] then []
247
250
  else nil
248
251
  end
249
252
 
250
- instance_variable_set("@#{v[:accessor]}", initial_value)
253
+ instance_variable_set(v[:instance_var], initial_value)
251
254
  }
252
255
  end
253
- private :init_child_nodes
254
256
 
255
257
  def preserve_whitespace
256
258
  self.xml_space = (value.is_a?(String) && ((value =~ /\A\s/) || (value =~ /\s\Z/) || value.include?("\n"))) ? 'preserve' : nil
@@ -395,7 +397,7 @@ module RubyXL
395
397
  def init_child_nodes(params)
396
398
  obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
397
399
  next if v[:is_array] # Only one collection node allowed per OOXMLContainerObject, and it is contained in itself.
398
- instance_variable_set("@#{v[:accessor]}", params[v[:accessor]])
400
+ instance_variable_set(v[:instance_var], params[v[:accessor]])
399
401
  }
400
402
  end
401
403
  protected :init_child_nodes
@@ -405,9 +407,7 @@ module RubyXL
405
407
  end
406
408
 
407
409
  def inspect
408
- vars = [ super ]
409
- vars = self.instance_variables.each { |v| vars << "#{v}=#{instance_variable_get(v).inspect}" }
410
- "<#{self.class}: #{super} #{vars.join(", ")}>"
410
+ "<#{self.class}: #{super} #{self.instance_variables.collect{ |v| "#{v}=#{instance_variable_get(v).inspect}" }.join(', ')}>"
411
411
  end
412
412
 
413
413
  class << self
@@ -430,7 +430,7 @@ module RubyXL
430
430
  # Prototype method. For top-level OOXML object, returns the path at which the current object's XML file
431
431
  # is located within the <tt>.xlsx</tt> zip container.
432
432
  def xlsx_path
433
- raise 'Subclass responsebility'
433
+ raise RuntimeError, 'Subclass responsebility'
434
434
  end
435
435
 
436
436
  # Sets the list of namespaces on this object to be added when writing out XML. Valid only on top-level objects.