rubyXL 3.4.27 → 3.4.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (425) hide show
  1. checksums.yaml +4 -4
  2. data/.rubocop.yml +28 -0
  3. data/README.rdoc +3 -1
  4. data/VERSION +1 -1
  5. data/lib/rubyXL/convenience_methods/cell.rb +1 -1
  6. data/lib/rubyXL/convenience_methods/color.rb +6 -6
  7. data/lib/rubyXL/convenience_methods/workbook.rb +1 -5
  8. data/lib/rubyXL/convenience_methods/worksheet.rb +26 -6
  9. data/lib/rubyXL/objects/color.rb +1 -1
  10. data/lib/rubyXL/objects/column_range.rb +16 -12
  11. data/lib/rubyXL/objects/document_properties.rb +1 -0
  12. data/lib/rubyXL/objects/ooxml_object.rb +16 -14
  13. data/lib/rubyXL/objects/query_table.rb +4 -2
  14. data/lib/rubyXL/objects/reference.rb +10 -6
  15. data/lib/rubyXL/objects/relationships.rb +1 -1
  16. data/lib/rubyXL/objects/shared_strings.rb +1 -1
  17. data/lib/rubyXL/objects/sheet_data.rb +6 -6
  18. data/lib/rubyXL/objects/storage.rb +1 -1
  19. data/lib/rubyXL/objects/stylesheet.rb +2 -3
  20. data/lib/rubyXL/objects/text.rb +3 -3
  21. data/lib/rubyXL/objects/theme.rb +15 -17
  22. data/lib/rubyXL/objects/workbook.rb +9 -9
  23. data/lib/rubyXL/objects/worksheet.rb +2 -2
  24. data/lib/rubyXL/worksheet.rb +5 -5
  25. data/rdoc/README_rdoc.html +4 -3
  26. data/rdoc/RubyXL/AExtension.html +3 -3
  27. data/rdoc/RubyXL/AExtensionStorageArea.html +1 -1
  28. data/rdoc/RubyXL/ActiveX.html +1 -1
  29. data/rdoc/RubyXL/ActiveXBinary.html +1 -1
  30. data/rdoc/RubyXL/AdjustHandleList.html +1 -1
  31. data/rdoc/RubyXL/Alignment.html +1 -1
  32. data/rdoc/RubyXL/AlternateContent.html +1 -1
  33. data/rdoc/RubyXL/AlternateUrls.html +1 -1
  34. data/rdoc/RubyXL/Authors.html +1 -1
  35. data/rdoc/RubyXL/AutoFilter.html +1 -1
  36. data/rdoc/RubyXL/AutoFilterColumn.html +1 -1
  37. data/rdoc/RubyXL/BinaryImageFile.html +1 -1
  38. data/rdoc/RubyXL/BodyProperties.html +1 -1
  39. data/rdoc/RubyXL/BooleanNode.html +1 -1
  40. data/rdoc/RubyXL/BooleanValue.html +1 -1
  41. data/rdoc/RubyXL/Border.html +1 -1
  42. data/rdoc/RubyXL/BorderEdge.html +1 -1
  43. data/rdoc/RubyXL/Borders.html +1 -1
  44. data/rdoc/RubyXL/Break.html +1 -1
  45. data/rdoc/RubyXL/BreakList.html +1 -1
  46. data/rdoc/RubyXL/CT_AdjPoint2D.html +1 -1
  47. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +1 -1
  48. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +1 -1
  49. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +1 -1
  50. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +1 -1
  51. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +1 -1
  52. data/rdoc/RubyXL/CT_Backdrop.html +1 -1
  53. data/rdoc/RubyXL/CT_Bevel.html +1 -1
  54. data/rdoc/RubyXL/CT_BiLevelEffect.html +1 -1
  55. data/rdoc/RubyXL/CT_BlendEffect.html +1 -1
  56. data/rdoc/RubyXL/CT_Blip.html +1 -1
  57. data/rdoc/RubyXL/CT_BlipFillProperties.html +1 -1
  58. data/rdoc/RubyXL/CT_BlurEffect.html +1 -1
  59. data/rdoc/RubyXL/CT_Camera.html +1 -1
  60. data/rdoc/RubyXL/CT_Color.html +1 -1
  61. data/rdoc/RubyXL/CT_ColorChangeEffect.html +1 -1
  62. data/rdoc/RubyXL/CT_ColorMapping.html +1 -1
  63. data/rdoc/RubyXL/CT_ColorScheme.html +1 -1
  64. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +1 -1
  65. data/rdoc/RubyXL/CT_ConnectionSite.html +1 -1
  66. data/rdoc/RubyXL/CT_ConnectionSiteList.html +1 -1
  67. data/rdoc/RubyXL/CT_DashStop.html +1 -1
  68. data/rdoc/RubyXL/CT_DashStopList.html +1 -1
  69. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +1 -1
  70. data/rdoc/RubyXL/CT_DuotoneEffect.html +1 -1
  71. data/rdoc/RubyXL/CT_EffectContainer.html +1 -1
  72. data/rdoc/RubyXL/CT_EffectList.html +1 -1
  73. data/rdoc/RubyXL/CT_EffectReference.html +1 -1
  74. data/rdoc/RubyXL/CT_EffectStyleItem.html +1 -1
  75. data/rdoc/RubyXL/CT_EffectStyleList.html +1 -1
  76. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +1 -1
  77. data/rdoc/RubyXL/CT_FillEffect.html +1 -1
  78. data/rdoc/RubyXL/CT_FillOverlayEffect.html +1 -1
  79. data/rdoc/RubyXL/CT_FillStyleList.html +1 -1
  80. data/rdoc/RubyXL/CT_FlatText.html +1 -1
  81. data/rdoc/RubyXL/CT_FontCollection.html +1 -1
  82. data/rdoc/RubyXL/CT_FontReference.html +1 -1
  83. data/rdoc/RubyXL/CT_GeomGuideList.html +1 -1
  84. data/rdoc/RubyXL/CT_GlowEffect.html +1 -1
  85. data/rdoc/RubyXL/CT_GradientFillProperties.html +1 -1
  86. data/rdoc/RubyXL/CT_GradientStop.html +1 -1
  87. data/rdoc/RubyXL/CT_GradientStopList.html +1 -1
  88. data/rdoc/RubyXL/CT_HSLEffect.html +1 -1
  89. data/rdoc/RubyXL/CT_HslColor.html +1 -1
  90. data/rdoc/RubyXL/CT_Hyperlink.html +1 -1
  91. data/rdoc/RubyXL/CT_InnerShadowEffect.html +1 -1
  92. data/rdoc/RubyXL/CT_LightRig.html +1 -1
  93. data/rdoc/RubyXL/CT_LineEndProperties.html +1 -1
  94. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +1 -1
  95. data/rdoc/RubyXL/CT_LineProperties.html +1 -1
  96. data/rdoc/RubyXL/CT_LineStyleList.html +1 -1
  97. data/rdoc/RubyXL/CT_LinearShadeProperties.html +1 -1
  98. data/rdoc/RubyXL/CT_LuminanceEffect.html +1 -1
  99. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +1 -1
  100. data/rdoc/RubyXL/CT_OuterShadowEffect.html +1 -1
  101. data/rdoc/RubyXL/CT_Path2D.html +1 -1
  102. data/rdoc/RubyXL/CT_Path2DArcTo.html +1 -1
  103. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +1 -1
  104. data/rdoc/RubyXL/CT_Path2DList.html +1 -1
  105. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +1 -1
  106. data/rdoc/RubyXL/CT_Path2DTo.html +1 -1
  107. data/rdoc/RubyXL/CT_PathShadeProperties.html +1 -1
  108. data/rdoc/RubyXL/CT_PatternFillProperties.html +1 -1
  109. data/rdoc/RubyXL/CT_Point3D.html +1 -1
  110. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +1 -1
  111. data/rdoc/RubyXL/CT_PresetColor.html +1 -1
  112. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +1 -1
  113. data/rdoc/RubyXL/CT_PresetShadowEffect.html +1 -1
  114. data/rdoc/RubyXL/CT_PresetTextShape.html +1 -1
  115. data/rdoc/RubyXL/CT_ReflectionEffect.html +1 -1
  116. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +1 -1
  117. data/rdoc/RubyXL/CT_RelativeRect.html +1 -1
  118. data/rdoc/RubyXL/CT_SRgbColor.html +1 -1
  119. data/rdoc/RubyXL/CT_ScRgbColor.html +1 -1
  120. data/rdoc/RubyXL/CT_Scene3D.html +1 -1
  121. data/rdoc/RubyXL/CT_SchemeColor.html +1 -1
  122. data/rdoc/RubyXL/CT_Shape3D.html +1 -1
  123. data/rdoc/RubyXL/CT_ShapeStyle.html +1 -1
  124. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +1 -1
  125. data/rdoc/RubyXL/CT_SphereCoords.html +1 -1
  126. data/rdoc/RubyXL/CT_StretchInfoProperties.html +1 -1
  127. data/rdoc/RubyXL/CT_StyleMatrix.html +1 -1
  128. data/rdoc/RubyXL/CT_StyleMatrixReference.html +1 -1
  129. data/rdoc/RubyXL/CT_SupplementalFont.html +1 -1
  130. data/rdoc/RubyXL/CT_SystemColor.html +1 -1
  131. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +1 -1
  132. data/rdoc/RubyXL/CT_TextBlipBullet.html +1 -1
  133. data/rdoc/RubyXL/CT_TextCharBullet.html +1 -1
  134. data/rdoc/RubyXL/CT_TextCharacterProperties.html +1 -1
  135. data/rdoc/RubyXL/CT_TextFont.html +1 -1
  136. data/rdoc/RubyXL/CT_TextListStyle.html +1 -1
  137. data/rdoc/RubyXL/CT_TextNormalAutofit.html +1 -1
  138. data/rdoc/RubyXL/CT_TextParagraphProperties.html +1 -1
  139. data/rdoc/RubyXL/CT_TextSpacing.html +1 -1
  140. data/rdoc/RubyXL/CT_TextTabStop.html +1 -1
  141. data/rdoc/RubyXL/CT_TextTabStopList.html +1 -1
  142. data/rdoc/RubyXL/CT_TileInfoProperties.html +1 -1
  143. data/rdoc/RubyXL/CT_TintEffect.html +1 -1
  144. data/rdoc/RubyXL/CT_Transform2D.html +1 -1
  145. data/rdoc/RubyXL/CT_TransformEffect.html +1 -1
  146. data/rdoc/RubyXL/CT_Vector3D.html +1 -1
  147. data/rdoc/RubyXL/CT_XYAdjustHandle.html +1 -1
  148. data/rdoc/RubyXL/CalculationChain.html +1 -1
  149. data/rdoc/RubyXL/CalculationChainCell.html +1 -1
  150. data/rdoc/RubyXL/CalculationProperties.html +1 -1
  151. data/rdoc/RubyXL/Cell.html +7 -7
  152. data/rdoc/RubyXL/CellConvenienceMethods.html +2 -2
  153. data/rdoc/RubyXL/CellExt.html +1 -1
  154. data/rdoc/RubyXL/CellSmartTag.html +1 -1
  155. data/rdoc/RubyXL/CellSmartTagProperty.html +1 -1
  156. data/rdoc/RubyXL/CellSmartTags.html +1 -1
  157. data/rdoc/RubyXL/CellStyle.html +1 -1
  158. data/rdoc/RubyXL/CellStyleXFs.html +1 -1
  159. data/rdoc/RubyXL/CellStyles.html +2 -2
  160. data/rdoc/RubyXL/CellValue.html +1 -1
  161. data/rdoc/RubyXL/CellWatch.html +1 -1
  162. data/rdoc/RubyXL/CellWatches.html +1 -1
  163. data/rdoc/RubyXL/CellXFs.html +3 -4
  164. data/rdoc/RubyXL/ChartColorsFile.html +1 -1
  165. data/rdoc/RubyXL/ChartFile.html +1 -1
  166. data/rdoc/RubyXL/ChartStyleFile.html +1 -1
  167. data/rdoc/RubyXL/ChartUserShapesFile.html +1 -1
  168. data/rdoc/RubyXL/Chartsheet.html +1 -1
  169. data/rdoc/RubyXL/ChartsheetPageSetup.html +1 -1
  170. data/rdoc/RubyXL/ChartsheetProperties.html +1 -1
  171. data/rdoc/RubyXL/ChartsheetProtection.html +1 -1
  172. data/rdoc/RubyXL/ChartsheetView.html +1 -1
  173. data/rdoc/RubyXL/ChartsheetViews.html +1 -1
  174. data/rdoc/RubyXL/Color.html +1 -1
  175. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +3 -3
  176. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +3 -3
  177. data/rdoc/RubyXL/ColorConvenienceClasses.html +1 -1
  178. data/rdoc/RubyXL/ColorConvenienceMethods.html +1 -1
  179. data/rdoc/RubyXL/ColorFilter.html +1 -1
  180. data/rdoc/RubyXL/ColorScale.html +1 -1
  181. data/rdoc/RubyXL/ColorSet.html +1 -1
  182. data/rdoc/RubyXL/Colors.html +1 -1
  183. data/rdoc/RubyXL/ColumnRange.html +37 -6
  184. data/rdoc/RubyXL/ColumnRanges.html +11 -11
  185. data/rdoc/RubyXL/Comment.html +1 -1
  186. data/rdoc/RubyXL/CommentList.html +1 -1
  187. data/rdoc/RubyXL/CommentsFile.html +1 -1
  188. data/rdoc/RubyXL/ConditionalFormatValue.html +1 -1
  189. data/rdoc/RubyXL/ConditionalFormatting.html +1 -1
  190. data/rdoc/RubyXL/ConditionalFormattingRule.html +1 -1
  191. data/rdoc/RubyXL/Connection.html +1 -1
  192. data/rdoc/RubyXL/ConnectionTable.html +1 -1
  193. data/rdoc/RubyXL/ConnectionTables.html +1 -1
  194. data/rdoc/RubyXL/ConnectionTextField.html +1 -1
  195. data/rdoc/RubyXL/ConnectionTextFields.html +1 -1
  196. data/rdoc/RubyXL/Connections.html +1 -1
  197. data/rdoc/RubyXL/ContentTypeDefault.html +1 -1
  198. data/rdoc/RubyXL/ContentTypeOverride.html +1 -1
  199. data/rdoc/RubyXL/ContentTypes.html +1 -1
  200. data/rdoc/RubyXL/ControlPropertiesFile.html +1 -1
  201. data/rdoc/RubyXL/CorePropertiesFile.html +10 -10
  202. data/rdoc/RubyXL/CustomColor.html +1 -1
  203. data/rdoc/RubyXL/CustomColorList.html +1 -1
  204. data/rdoc/RubyXL/CustomFilter.html +1 -1
  205. data/rdoc/RubyXL/CustomFilters.html +1 -1
  206. data/rdoc/RubyXL/CustomGeometry.html +1 -1
  207. data/rdoc/RubyXL/CustomProperties.html +1 -1
  208. data/rdoc/RubyXL/CustomPropertiesFile.html +1 -1
  209. data/rdoc/RubyXL/CustomProperty.html +1 -1
  210. data/rdoc/RubyXL/CustomPropertyFile.html +1 -1
  211. data/rdoc/RubyXL/CustomSheetView.html +1 -1
  212. data/rdoc/RubyXL/CustomSheetViews.html +1 -1
  213. data/rdoc/RubyXL/CustomWorkbookView.html +1 -1
  214. data/rdoc/RubyXL/CustomWorkbookViews.html +1 -1
  215. data/rdoc/RubyXL/CustomXMLFile.html +1 -1
  216. data/rdoc/RubyXL/DXF.html +1 -1
  217. data/rdoc/RubyXL/DXFs.html +1 -1
  218. data/rdoc/RubyXL/DataBar.html +1 -1
  219. data/rdoc/RubyXL/DataConsolidate.html +1 -1
  220. data/rdoc/RubyXL/DataConsolidationReference.html +1 -1
  221. data/rdoc/RubyXL/DataConsolidationReferences.html +1 -1
  222. data/rdoc/RubyXL/DataType.html +1 -1
  223. data/rdoc/RubyXL/DataValidation.html +1 -1
  224. data/rdoc/RubyXL/DataValidations.html +1 -1
  225. data/rdoc/RubyXL/DateGroupItem.html +1 -1
  226. data/rdoc/RubyXL/DefinedName.html +1 -1
  227. data/rdoc/RubyXL/DefinedNameExt.html +1 -1
  228. data/rdoc/RubyXL/DefinedNames.html +1 -1
  229. data/rdoc/RubyXL/DefinedNamesExt.html +1 -1
  230. data/rdoc/RubyXL/DocumentPropertiesFile.html +3 -2
  231. data/rdoc/RubyXL/DrawingFile.html +1 -1
  232. data/rdoc/RubyXL/DynamicFilter.html +1 -1
  233. data/rdoc/RubyXL/EmbeddedControl.html +1 -1
  234. data/rdoc/RubyXL/EmbeddedControls.html +1 -1
  235. data/rdoc/RubyXL/Extension.html +1 -1
  236. data/rdoc/RubyXL/ExtensionStorageArea.html +1 -1
  237. data/rdoc/RubyXL/Extents.html +1 -1
  238. data/rdoc/RubyXL/ExternalBook.html +1 -1
  239. data/rdoc/RubyXL/ExternalLinksFile.html +1 -1
  240. data/rdoc/RubyXL/ExternalReference.html +1 -1
  241. data/rdoc/RubyXL/ExternalReferences.html +1 -1
  242. data/rdoc/RubyXL/ExtraColorSchemeList.html +1 -1
  243. data/rdoc/RubyXL/FieldItem.html +1 -1
  244. data/rdoc/RubyXL/FileRecoveryProperties.html +1 -1
  245. data/rdoc/RubyXL/FileSharing.html +1 -1
  246. data/rdoc/RubyXL/FileVersion.html +1 -1
  247. data/rdoc/RubyXL/Fill.html +1 -1
  248. data/rdoc/RubyXL/Fills.html +1 -1
  249. data/rdoc/RubyXL/FilterContainer.html +1 -1
  250. data/rdoc/RubyXL/FloatNode.html +1 -1
  251. data/rdoc/RubyXL/FloatValue.html +1 -1
  252. data/rdoc/RubyXL/Font.html +1 -1
  253. data/rdoc/RubyXL/FontConvenienceMethods.html +1 -1
  254. data/rdoc/RubyXL/FontScheme.html +1 -1
  255. data/rdoc/RubyXL/Fonts.html +1 -1
  256. data/rdoc/RubyXL/Formula.html +1 -1
  257. data/rdoc/RubyXL/FunctionGroup.html +1 -1
  258. data/rdoc/RubyXL/FunctionGroups.html +1 -1
  259. data/rdoc/RubyXL/GenericStorageObject.html +2 -2
  260. data/rdoc/RubyXL/GradientFill.html +1 -1
  261. data/rdoc/RubyXL/HeaderFooterSettings.html +1 -1
  262. data/rdoc/RubyXL/Hyperlink.html +1 -1
  263. data/rdoc/RubyXL/HyperlinkRelFile.html +1 -1
  264. data/rdoc/RubyXL/Hyperlinks.html +1 -1
  265. data/rdoc/RubyXL/IconFilter.html +1 -1
  266. data/rdoc/RubyXL/IconSet.html +1 -1
  267. data/rdoc/RubyXL/IgnoredError.html +1 -1
  268. data/rdoc/RubyXL/IgnoredErrors.html +1 -1
  269. data/rdoc/RubyXL/IndexedColors.html +1 -1
  270. data/rdoc/RubyXL/InputCells.html +1 -1
  271. data/rdoc/RubyXL/IntegerNode.html +1 -1
  272. data/rdoc/RubyXL/IntegerValue.html +1 -1
  273. data/rdoc/RubyXL/LegacyCell.html +1 -1
  274. data/rdoc/RubyXL/LegacyWorksheet.html +5 -5
  275. data/rdoc/RubyXL/MRUColors.html +1 -1
  276. data/rdoc/RubyXL/MacrosFile.html +1 -1
  277. data/rdoc/RubyXL/MergedCell.html +1 -1
  278. data/rdoc/RubyXL/MergedCells.html +1 -1
  279. data/rdoc/RubyXL/NumFmt.html +1 -1
  280. data/rdoc/RubyXL/NumberFormat.html +1 -1
  281. data/rdoc/RubyXL/NumberFormats.html +1 -1
  282. data/rdoc/RubyXL/OLEObject.html +1 -1
  283. data/rdoc/RubyXL/OLEObjectFile.html +1 -1
  284. data/rdoc/RubyXL/OLEObjects.html +1 -1
  285. data/rdoc/RubyXL/OLESize.html +1 -1
  286. data/rdoc/RubyXL/OOXMLContainerObject.html +8 -8
  287. data/rdoc/RubyXL/OOXMLIgnored.html +1 -1
  288. data/rdoc/RubyXL/OOXMLObject.html +1 -1
  289. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +8 -5
  290. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +17 -18
  291. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +2 -2
  292. data/rdoc/RubyXL/OOXMLTopLevelObject.html +6 -6
  293. data/rdoc/RubyXL/OdbcOleDbProperties.html +1 -1
  294. data/rdoc/RubyXL/Offset.html +1 -1
  295. data/rdoc/RubyXL/OlapProperties.html +1 -1
  296. data/rdoc/RubyXL/OleItem.html +1 -1
  297. data/rdoc/RubyXL/OleItems.html +1 -1
  298. data/rdoc/RubyXL/OleLink.html +1 -1
  299. data/rdoc/RubyXL/OutlineProperties.html +1 -1
  300. data/rdoc/RubyXL/PageMargins.html +1 -1
  301. data/rdoc/RubyXL/PageSetup.html +1 -1
  302. data/rdoc/RubyXL/PageSetupProperties.html +1 -1
  303. data/rdoc/RubyXL/Pane.html +1 -1
  304. data/rdoc/RubyXL/Parser.html +1 -1
  305. data/rdoc/RubyXL/PatternFill.html +1 -1
  306. data/rdoc/RubyXL/PersonMetadata.html +1 -1
  307. data/rdoc/RubyXL/PhoneticProperties.html +1 -1
  308. data/rdoc/RubyXL/PhoneticRun.html +1 -1
  309. data/rdoc/RubyXL/PivotArea.html +1 -1
  310. data/rdoc/RubyXL/PivotCache.html +1 -1
  311. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +1 -1
  312. data/rdoc/RubyXL/PivotCacheRecordsFile.html +1 -1
  313. data/rdoc/RubyXL/PivotCaches.html +1 -1
  314. data/rdoc/RubyXL/PivotReference.html +1 -1
  315. data/rdoc/RubyXL/PivotReferences.html +1 -1
  316. data/rdoc/RubyXL/PivotTableFile.html +1 -1
  317. data/rdoc/RubyXL/PivotTableSelection.html +1 -1
  318. data/rdoc/RubyXL/PresetGeometry.html +1 -1
  319. data/rdoc/RubyXL/PrintOptions.html +1 -1
  320. data/rdoc/RubyXL/PrinterSettingsFile.html +1 -1
  321. data/rdoc/RubyXL/ProtectedRange.html +1 -1
  322. data/rdoc/RubyXL/ProtectedRanges.html +1 -1
  323. data/rdoc/RubyXL/Protection.html +1 -1
  324. data/rdoc/RubyXL/QueryParameter.html +1 -1
  325. data/rdoc/RubyXL/QueryParameters.html +1 -1
  326. data/rdoc/RubyXL/QueryTable.html +2 -2
  327. data/rdoc/RubyXL/QueryTableDeletedField.html +1 -1
  328. data/rdoc/RubyXL/QueryTableDeletedFields.html +1 -1
  329. data/rdoc/RubyXL/QueryTableField.html +1 -1
  330. data/rdoc/RubyXL/QueryTableFields.html +1 -1
  331. data/rdoc/RubyXL/QueryTableRefresh.html +1 -1
  332. data/rdoc/RubyXL/RID.html +1 -1
  333. data/rdoc/RubyXL/RawOOXML.html +1 -1
  334. data/rdoc/RubyXL/Reference.html +13 -9
  335. data/rdoc/RubyXL/Relationship.html +1 -1
  336. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +1 -1
  337. data/rdoc/RubyXL/RelationshipSupport.html +1 -1
  338. data/rdoc/RubyXL/RevisionPointer.html +1 -1
  339. data/rdoc/RubyXL/RichText.html +3 -3
  340. data/rdoc/RubyXL/RichTextRun.html +1 -1
  341. data/rdoc/RubyXL/Row.html +1 -1
  342. data/rdoc/RubyXL/RowExt.html +1 -1
  343. data/rdoc/RubyXL/RunProperties.html +1 -1
  344. data/rdoc/RubyXL/Scenario.html +1 -1
  345. data/rdoc/RubyXL/Scenarios.html +1 -1
  346. data/rdoc/RubyXL/Selection.html +1 -1
  347. data/rdoc/RubyXL/ShapeGuide.html +1 -1
  348. data/rdoc/RubyXL/ShapeTextRectangle.html +1 -1
  349. data/rdoc/RubyXL/SharedStringsTable.html +2 -2
  350. data/rdoc/RubyXL/Sheet.html +1 -1
  351. data/rdoc/RubyXL/SheetCalculationProperties.html +1 -1
  352. data/rdoc/RubyXL/SheetData.html +1 -1
  353. data/rdoc/RubyXL/SheetDataExt.html +1 -1
  354. data/rdoc/RubyXL/SheetDataSet.html +1 -1
  355. data/rdoc/RubyXL/SheetMetadata.html +1 -1
  356. data/rdoc/RubyXL/SheetName.html +1 -1
  357. data/rdoc/RubyXL/SheetNames.html +1 -1
  358. data/rdoc/RubyXL/Sheets.html +1 -1
  359. data/rdoc/RubyXL/SlicerCacheFile.html +1 -1
  360. data/rdoc/RubyXL/SlicerFile.html +1 -1
  361. data/rdoc/RubyXL/SmartTagProperties.html +1 -1
  362. data/rdoc/RubyXL/SmartTagType.html +1 -1
  363. data/rdoc/RubyXL/SmartTagTypes.html +1 -1
  364. data/rdoc/RubyXL/SmartTags.html +1 -1
  365. data/rdoc/RubyXL/SortCondition.html +1 -1
  366. data/rdoc/RubyXL/SortState.html +1 -1
  367. data/rdoc/RubyXL/Sqref.html +4 -4
  368. data/rdoc/RubyXL/Stop.html +1 -1
  369. data/rdoc/RubyXL/StringNode.html +1 -1
  370. data/rdoc/RubyXL/StringNodeW3C.html +1 -1
  371. data/rdoc/RubyXL/StringValue.html +1 -1
  372. data/rdoc/RubyXL/Stylesheet.html +6 -6
  373. data/rdoc/RubyXL/TableFile.html +1 -1
  374. data/rdoc/RubyXL/TableParts.html +1 -1
  375. data/rdoc/RubyXL/TableStyle.html +1 -1
  376. data/rdoc/RubyXL/TableStyles.html +1 -1
  377. data/rdoc/RubyXL/Text.html +2 -2
  378. data/rdoc/RubyXL/TextImportSettings.html +1 -1
  379. data/rdoc/RubyXL/Theme.html +19 -19
  380. data/rdoc/RubyXL/ThemeElements.html +1 -1
  381. data/rdoc/RubyXL/ThumbnailFile.html +1 -1
  382. data/rdoc/RubyXL/Top10.html +1 -1
  383. data/rdoc/RubyXL/VMLDrawingFile.html +1 -1
  384. data/rdoc/RubyXL/Variant.html +1 -1
  385. data/rdoc/RubyXL/Vector.html +1 -1
  386. data/rdoc/RubyXL/VectorValue.html +1 -1
  387. data/rdoc/RubyXL/VisualProperties.html +1 -1
  388. data/rdoc/RubyXL/WebPublishObject.html +1 -1
  389. data/rdoc/RubyXL/WebPublishObjects.html +1 -1
  390. data/rdoc/RubyXL/WebPublishingItem.html +1 -1
  391. data/rdoc/RubyXL/WebPublishingItems.html +1 -1
  392. data/rdoc/RubyXL/WebPublishingProperties.html +1 -1
  393. data/rdoc/RubyXL/WebQueryProperties.html +1 -1
  394. data/rdoc/RubyXL/Workbook.html +8 -8
  395. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +14 -18
  396. data/rdoc/RubyXL/WorkbookProperties.html +1 -1
  397. data/rdoc/RubyXL/WorkbookProtection.html +1 -1
  398. data/rdoc/RubyXL/WorkbookRoot.html +1 -1
  399. data/rdoc/RubyXL/WorkbookView.html +1 -1
  400. data/rdoc/RubyXL/WorkbookViews.html +1 -1
  401. data/rdoc/RubyXL/Worksheet.html +1 -1
  402. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +28 -11
  403. data/rdoc/RubyXL/WorksheetDimensions.html +1 -1
  404. data/rdoc/RubyXL/WorksheetFormatProperties.html +1 -1
  405. data/rdoc/RubyXL/WorksheetProperties.html +1 -1
  406. data/rdoc/RubyXL/WorksheetProtection.html +1 -1
  407. data/rdoc/RubyXL/WorksheetView.html +1 -1
  408. data/rdoc/RubyXL/WorksheetViews.html +1 -1
  409. data/rdoc/RubyXL/XF.html +1 -1
  410. data/rdoc/RubyXL.html +1 -1
  411. data/rdoc/created.rid +33 -33
  412. data/rdoc/index.html +2 -2
  413. data/rdoc/js/search_index.js +1 -1
  414. data/rdoc/js/search_index.js.gz +0 -0
  415. data/rdoc/table_of_contents.html +7 -2
  416. data/rubyXL.gemspec +3 -3
  417. data/spec/lib/cell_spec.rb +10 -8
  418. data/spec/lib/color_spec.rb +7 -0
  419. data/spec/lib/parser_spec.rb +8 -5
  420. data/spec/lib/reference_spec.rb +4 -3
  421. data/spec/lib/rgb_color_spec.rb +2 -0
  422. data/spec/lib/text_spec.rb +3 -1
  423. data/spec/lib/workbook_spec.rb +4 -2
  424. data/spec/lib/worksheet_spec.rb +27 -15
  425. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ededaa2494386b21ce1c01a251a85cca7415c0c6114895debfb0b28007bc9c13
4
- data.tar.gz: 818e9f45a8f68a1821d16a489c516b6ba84e3add5ccc734025c785010f489f27
3
+ metadata.gz: 14119a8af99822bbe1fd209a060d5374e92fe921750766cc83fa2cebdf586963
4
+ data.tar.gz: a3870a59650bd9b32c82bd6ad950aa720cb9f50370b96956eecb522d1c8e8fce
5
5
  SHA512:
6
- metadata.gz: 93a29b20843980d6549d52c560ec70bf1cb9bc322b20d201857f268aaef3ddeb2f8b3e4afca2584bcb53bdf2b471bea0b127d3bcf17ee769d95bfa1e5d3ea650
7
- data.tar.gz: 5276b2c4614066cb60ffeaaeb058109c025668a4cf4df40161fc28aa8ab097de3a8e3bdfd95757d01c8357ec43781efaf4a27f66ca2ff6246b5a74401e8148a5
6
+ metadata.gz: 27f8bf50de4801721703c78a73b156626998d37a7fa1ce76a05e2848d9bf233a29ed91044567b2b02a8cd29487872f2a5ed2eeeb65c45ae6b3fed8b4bfccea25
7
+ data.tar.gz: 7ba264f255d544ba9efb9bb5aaa272a2ba84442930bf41eb72c6a63571b0ed21a69255975c843b796725ce17ca29c81950b1784a0c027a54dc35e4801ea0870e
data/.rubocop.yml CHANGED
@@ -16,6 +16,34 @@ AllCops:
16
16
  - Gemfile
17
17
  - rubyXL.gemspec
18
18
 
19
+ # "Excessive" parentheses are your friend. You will understand it in time, Luke.
20
+ Style/TernaryParentheses:
21
+ Enabled: false
22
+
23
+ # Implicity is evil. Unwilingness to type a couple extra characters is laziness.
24
+ Style/RedundantConstantBase:
25
+ Enabled: false
26
+
27
+ # I don't see a good reason in this. Unless you are paid per line.
28
+ Style/CommentedKeyword:
29
+ Enabled: false
30
+
31
+ # Yes, some things are "redundant" but they are there exactly to drive home some point...
32
+ Style/RedundantSelf:
33
+ Enabled: false
34
+
35
+ Naming/AccessorMethodName:
36
+ Enabled: false
37
+
38
+ Layout/FirstArrayElementIndentation:
39
+ Enabled: false
40
+
41
+ Style/Documentation:
42
+ Enabled: false
43
+
44
+ Layout/LeadingCommentSpace:
45
+ Enabled: false
46
+
19
47
  Style/BlockDelimiters:
20
48
  Enabled: false
21
49
 
data/README.rdoc CHANGED
@@ -168,7 +168,9 @@ Please note: these methods are being phased out in favor of the OOXML object mod
168
168
  worksheet.change_column_width(0, 30) # Sets first column width to 30
169
169
 
170
170
  ==== Merging Cells
171
- worksheet.merge_cells(0, 0, 1, 1) # Merges A1:B2
171
+ worksheet.merge_cells(0, 1, 2, 3) # Merges B1:D3
172
+ worksheet.merge_cells('A2:C4') # Merges A2:C4
173
+ worksheet.merge_cells(row_from: 0, row_to: 1, col_from 2:, col_to: 3) # Merges C1:D2
172
174
 
173
175
  ==== Insert Row
174
176
  This method will insert a row at specified index, pushing all rows below it down. It also copies styles from row above.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.4.27
1
+ 3.4.33
@@ -116,7 +116,7 @@ module RubyXL
116
116
 
117
117
  def fill_color
118
118
  validate_worksheet
119
- return workbook.get_fill_color(get_cell_xf)
119
+ workbook.get_fill_color(get_cell_xf)
120
120
  end
121
121
 
122
122
  def horizontal_alignment
@@ -48,8 +48,8 @@ module RubyXL
48
48
  end
49
49
 
50
50
  hls_color.h = (g - b) / delta if (r == max)
51
- hls_color.h = 2.0 + (b - r) / delta if (g == max)
52
- hls_color.h = 4.0 + (r - g) / delta if (b == max)
51
+ hls_color.h = 2.0 + ((b - r) / delta) if (g == max)
52
+ hls_color.h = 4.0 + ((r - g) / delta) if (b == max)
53
53
 
54
54
  hls_color.h *= 60;
55
55
  hls_color.h += 360 if hls_color.h < 0
@@ -95,7 +95,7 @@ module RubyXL
95
95
  t1 = l + s - (l * s)
96
96
  end
97
97
 
98
- t2 = 2.0 * l - t1;
98
+ t2 = (2.0 * l) - t1;
99
99
  h = self.h / 360.0
100
100
 
101
101
  t_r = h + (1.0 / 3.0)
@@ -124,11 +124,11 @@ module RubyXL
124
124
  t3 -= 1.0 if (t3 > 1)
125
125
 
126
126
  if (6.0 * t3 < 1) then
127
- color = t2 + (t1 - t2) * 6.0 * t3;
127
+ color = t2 + ((t1 - t2) * 6.0 * t3);
128
128
  elsif (2.0 * t3 < 1) then
129
129
  color = t1;
130
130
  elsif (3.0 * t3 < 2) then
131
- color = t2 + (t1 - t2) * ((2.0 / 3.0) - t3) * 6.0;
131
+ color = t2 + ((t1 - t2) * ((2.0 / 3.0) - t3) * 6.0);
132
132
  else
133
133
  color = t2;
134
134
  end
@@ -143,7 +143,7 @@ module RubyXL
143
143
  if tint < 0 then
144
144
  self.l = l * (1.0 + tint);
145
145
  else
146
- self.l = l * (1.0 - tint) + tint;
146
+ self.l = (l * (1.0 - tint)) + tint;
147
147
  end
148
148
 
149
149
  self
@@ -21,11 +21,7 @@ module RubyXL
21
21
  end
22
22
 
23
23
  def get_fill_color(xf)
24
- fill = fills[xf.fill_id]
25
- pattern = fill && fill.pattern_fill
26
- color = pattern && pattern.fg_color
27
- color = color && color.get_rgb(self)
28
- color && color.to_s || 'ffffff'
24
+ fills[xf.fill_id]&.pattern_fill&.fg_color&.get_rgb(self)&.to_s || 'ffffff'
29
25
  end
30
26
 
31
27
  def register_new_fill(new_fill, old_xf)
@@ -206,10 +206,10 @@ module RubyXL
206
206
  validate_nonnegative(column_index)
207
207
 
208
208
  # Delete column
209
- sheet_data.rows.each { |row| row && row.cells.delete_at(column_index) }
209
+ sheet_data.rows.each { |row| row&.cells&.delete_at(column_index) }
210
210
 
211
211
  # Update column numbers for cells to the right of the deleted column
212
- sheet_data.rows.each_with_index { |row, row_index|
212
+ sheet_data.rows.each { |row|
213
213
  next if row.nil?
214
214
  row.cells.each_with_index { |c, ci|
215
215
  c.column = ci if c.is_a?(Cell)
@@ -280,7 +280,7 @@ module RubyXL
280
280
  validate_workbook
281
281
  validate_nonnegative(row)
282
282
  row = sheet_data.rows[row]
283
- row && row.ht || RubyXL::Row::DEFAULT_HEIGHT
283
+ (row && row.ht) || RubyXL::Row::DEFAULT_HEIGHT
284
284
  end
285
285
 
286
286
  def get_row_border(row, border_direction)
@@ -382,7 +382,7 @@ module RubyXL
382
382
  # Get column width measured in number of digits, as per
383
383
  # http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx
384
384
  def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)
385
- change_column_width_raw(column_index, ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0)
385
+ change_column_width_raw(column_index, RubyXL::ColumnRange::chars2raw(width_in_chars))
386
386
  end
387
387
 
388
388
  # Helper method to get the style index for a column
@@ -689,12 +689,32 @@ module RubyXL
689
689
  end
690
690
 
691
691
  # Merges cells within a rectangular area
692
- def merge_cells(start_row, start_col, end_row, end_col)
692
+ # #merge_cells(row_from, col_from, row_to, col_to)
693
+ # #merge_cells(reference_string)
694
+ # #merge_cells(row_from:, row_to:, col_from:, col_to:)
695
+ def merge_cells(*params)
693
696
  validate_workbook
694
697
 
698
+ row_from = col_from = row_to = col_to = nil
699
+ case params.size
700
+ when 4 then row_from, col_from, row_to, col_to = params
701
+ when 1 then
702
+ case params.first
703
+ when Hash then
704
+ row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
705
+ when String then
706
+ from, to = params[0].split(':')
707
+ raise ArgumentError.new("reference for merging cells must be a range") if to.nil?
708
+ row_from, col_from = RubyXL::Reference.ref2ind(from)
709
+ row_to, col_to = RubyXL::Reference.ref2ind(to)
710
+ else
711
+ raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
712
+ end
713
+ end
714
+
695
715
  self.merged_cells ||= RubyXL::MergedCells.new
696
716
  # TODO: add validation to make sure ranges are not intersecting with existing ones
697
- merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(start_row, end_row, start_col, end_col))
717
+ merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(row_from, row_to, col_from, col_to))
698
718
  end
699
719
 
700
720
  def add_validation_list(ref, list_arr)
@@ -4,7 +4,7 @@ require 'rubyXL/objects/simple_types'
4
4
  module RubyXL
5
5
  # http://www.datypic.com/sc/ooxml/e-ssml_color-4.html
6
6
  class Color < OOXMLObject
7
- COLOR_REGEXP = /\A([a-f]|[A-F]|[0-9]){6}\Z/
7
+ COLOR_REGEXP = /\A(?:[a-f0-9]{6}|[a-f0-9]{8})\Z/i
8
8
 
9
9
  define_attribute(:auto, :bool)
10
10
  define_attribute(:indexed, :uint)
@@ -17,21 +17,25 @@ module RubyXL
17
17
 
18
18
  def delete_column(col_index)
19
19
  col = col_index + 1
20
- self.min -=1 if min >= col
21
- self.max -=1 if max >= col
20
+ self.min -= 1 if min >= col
21
+ self.max -= 1 if max >= col
22
22
  end
23
23
 
24
24
  def insert_column(col_index)
25
25
  col = col_index + 1
26
- self.min +=1 if min >= col
27
- self.max +=1 if max >= col - 1
26
+ self.min += 1 if min >= col
27
+ self.max += 1 if max >= col - 1
28
28
  end
29
29
 
30
30
  def include?(col_index)
31
- ((min-1)..(max-1)).include?(col_index)
31
+ ((min - 1)..(max - 1)).include?(col_index)
32
32
  end
33
33
 
34
- DEFAULT_WIDTH = 9
34
+ def self.chars2raw(width_in_chars)
35
+ ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0
36
+ end
37
+
38
+ DEFAULT_WIDTH = 8
35
39
  end
36
40
 
37
41
  class ColumnRanges < OOXMLContainerObject
@@ -47,7 +51,7 @@ module RubyXL
47
51
  old_range = self.locate_range(col_index)
48
52
 
49
53
  if old_range.nil? then
50
- new_range = RubyXL::ColumnRange.new
54
+ new_range = RubyXL::ColumnRange.new(width: RubyXL::ColumnRange.chars2raw(RubyXL::ColumnRange::DEFAULT_WIDTH))
51
55
  else
52
56
  if old_range.min == col_num && old_range.max == col_num then
53
57
  return old_range # Single column range, OK to change in place
@@ -58,9 +62,9 @@ module RubyXL
58
62
  new_range = old_range.dup
59
63
  old_range.max -= 1
60
64
  else
61
- range_before = old_range.dup
62
- range_before.max = col_index # col_num - 1
63
- self << range_before
65
+ prior_range = old_range.dup
66
+ prior_range.max = col_index # col_num - 1
67
+ self << prior_range
64
68
 
65
69
  old_range.min = col_num + 1
66
70
 
@@ -82,8 +86,8 @@ module RubyXL
82
86
  end
83
87
 
84
88
  def before_write_xml
85
- self.sort_by!{ |r| r.min }
86
- !(self.empty?)
89
+ self.sort_by!(&:min)
90
+ !self.empty?
87
91
  end
88
92
  end
89
93
  end
@@ -69,6 +69,7 @@ module RubyXL
69
69
  when RubyXL::Chartsheet then chartsheets += 1
70
70
  end
71
71
  }
72
+
72
73
  add_parts_count('Worksheets', worksheets) if worksheets > 0
73
74
  add_parts_count('Charts', chartsheets) if chartsheets > 0
74
75
 
@@ -21,7 +21,7 @@ module RubyXL
21
21
  # Defines an attribute of OOXML object.
22
22
  # === Parameters
23
23
  # * +attribute_name+ - Name of the element attribute as seen in the source XML. Can be either <tt>"String"</tt> or <tt>:Symbol</tt>
24
- # * Special attibute name <tt>'_'</tt> (underscore) denotes the value of the element rather than attribute.
24
+ # * Special attribute name <tt>'_'</tt> (underscore) denotes the value of the element rather than attribute.
25
25
  # * +attribute_type+ - Specifies the conversion type for the attribute when parsing. Available options are:
26
26
  # * +:int+ - <tt>Integer</tt>
27
27
  # * +:uint+ - Unsigned <tt>Integer</tt>
@@ -123,7 +123,9 @@ module RubyXL
123
123
  end
124
124
 
125
125
  obj = self.new
126
- obj.local_namespaces = node.namespace_definitions
126
+ hsh = {}
127
+ node.namespace_definitions.each { |ns| hsh[ns.href] = ns.prefix }
128
+ obj.local_namespaces = hsh
127
129
 
128
130
  known_attributes = obtain_class_variable(:@@ooxml_attributes)
129
131
 
@@ -149,8 +151,9 @@ module RubyXL
149
151
 
150
152
  node.element_children.each { |child_node|
151
153
  ns = child_node.namespace
152
- prefix = if known_namespaces.has_key?(ns.href) then known_namespaces[ns.href]
153
- else ns.prefix
154
+
155
+ prefix = if known_namespaces.has_key?(ns&.href) then known_namespaces[ns&.href]
156
+ else ns&.prefix
154
157
  end
155
158
 
156
159
  child_node_name = case prefix
@@ -254,8 +257,8 @@ module RubyXL
254
257
 
255
258
  def ==(other)
256
259
  other.is_a?(self.class) &&
257
- obtain_class_variable(:@@ooxml_attributes).all? { |k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } &&
258
- obtain_class_variable(:@@ooxml_child_nodes).all? { |k, v| self.send(v[:accessor]) == other.send(v[:accessor]) }
260
+ obtain_class_variable(:@@ooxml_attributes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } &&
261
+ obtain_class_variable(:@@ooxml_child_nodes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) }
259
262
  end
260
263
 
261
264
  # Recursively write the OOXML object and all its children out as Nokogiri::XML. Immediately before the actual
@@ -312,12 +315,11 @@ module RubyXL
312
315
  element_text = attrs.delete('_')
313
316
  elem = xml.create_element(node_name_override || obtain_class_variable(:@@ooxml_tag_name), attrs, element_text)
314
317
 
315
- if @local_namespaces.nil? || @local_namespaces.empty? then # If no local namespaces provided in the original document,
316
- # use the defaults
317
- obtain_class_variable(:@@ooxml_namespaces).each_pair { |k, v| elem.add_namespace_definition(v, k) }
318
- else # otherwise preserve the original ones
319
- @local_namespaces.each { |ns| elem.add_namespace_definition(ns.prefix, ns.href) }
320
- end
318
+ # First, populate namespaces from the original document
319
+ @local_namespaces&.each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
320
+
321
+ # Then, add defaults. Note that if some namespace prefix was already set, Nokogiri will NOT change that namespace.
322
+ obtain_class_variable(:@@ooxml_namespaces).each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
321
323
 
322
324
  child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
323
325
  child_nodes.each_pair { |child_node_name, child_node_params|
@@ -355,7 +357,7 @@ module RubyXL
355
357
  def before_write_xml
356
358
  #TODO# This will go away once containers are fully implemented.
357
359
  child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
358
- child_nodes.each_pair { |child_node_name, child_node_params|
360
+ child_nodes.each_pair { |_child_node_name, child_node_params|
359
361
  self.count = self.send(child_node_params[:accessor]).size if child_node_params[:is_array] == :with_count
360
362
  }
361
363
  true
@@ -369,7 +371,7 @@ module RubyXL
369
371
  include OOXMLObjectInstanceMethods
370
372
  end
371
373
 
372
- # Parent class for OOXML conainer objects (for example,
374
+ # Parent class for OOXML container objects (for example,
373
375
  # <tt>&lt;fonts&gt;&lt;font&gt;...&lt;/font&gt;&lt;font&gt;...&lt;/font&gt;&lt;/fonts&gt;</tt>
374
376
  # that obscures the top-level container, allowing direct access to the contents as +Array+.
375
377
  class OOXMLContainerObject < Array
@@ -25,7 +25,8 @@ module RubyXL
25
25
 
26
26
  # http://www.datypic.com/sc/ooxml/e-ssml_queryTableFields-1.html
27
27
  class QueryTableFields < OOXMLObject
28
- define_child_node(RubyXL::QueryTableField, :collection => :with_count, :accessor => :fields, :node_name => :queryTableField)
28
+ define_child_node(RubyXL::QueryTableField, :collection => :with_count,
29
+ :accessor => :fields, :node_name => :queryTableField)
29
30
  define_element_name 'queryTableFields'
30
31
  end
31
32
 
@@ -38,7 +39,8 @@ module RubyXL
38
39
 
39
40
  # http://www.datypic.com/sc/ooxml/e-ssml_queryTableDeletedFields-1.html
40
41
  class QueryTableDeletedFields < OOXMLObject
41
- define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count, :accessor => :deleted_fields, :node_name => :deletedField)
42
+ define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count,
43
+ :accessor => :deleted_fields, :node_name => :deletedField)
42
44
  define_element_name 'queryTableDeletedFields'
43
45
  end
44
46
 
@@ -1,6 +1,6 @@
1
1
  module RubyXL
2
2
  class Reference
3
- ROW_MAX = 1024*1024
3
+ ROW_MAX = 1024 * 1024
4
4
  COL_MAX = 16393
5
5
 
6
6
  attr_reader :row_range, :col_range
@@ -61,15 +61,18 @@ module RubyXL
61
61
  end
62
62
 
63
63
  def cover?(other)
64
- !other.nil? && (@row_range.cover?(other.row_range.begin) && @row_range.cover?(other.row_range.end) &&
65
- @col_range.cover?(other.col_range.begin) && @col_range.cover?(other.col_range.end))
64
+ !other.nil? && (@row_range.cover?(other.row_range.begin) &&
65
+ @row_range.cover?(other.row_range.end) &&
66
+ @col_range.cover?(other.col_range.begin) &&
67
+ @col_range.cover?(other.col_range.end))
66
68
  end
67
69
 
68
70
  def to_s
69
71
  if single_cell? then
70
72
  self.class.ind2ref(@row_range.begin, @col_range.begin)
71
73
  else
72
- self.class.ind2ref(@row_range.begin, @col_range.begin) + ':' + self.class.ind2ref(@row_range.end, @col_range.end)
74
+ self.class.ind2ref(@row_range.begin, @col_range.begin) + ':' +
75
+ self.class.ind2ref(@row_range.end, @col_range.end)
73
76
  end
74
77
  end
75
78
 
@@ -99,7 +102,8 @@ module RubyXL
99
102
  # Converts Excel-style cell reference to +row+ and +col+ zero-based indices.
100
103
  def self.ref2ind(str)
101
104
  return [ -1, -1 ] unless str =~ /\A([A-Z]+)(\d+)\Z/
102
- [ Regexp.last_match(2).to_i - 1, Regexp.last_match(1).each_byte.inject(0) { |col, chr| col * 26 + (chr - 64) } - 1 ]
105
+ [ Regexp.last_match(2).to_i - 1,
106
+ Regexp.last_match(1).each_byte.inject(0) { |col, chr| (col * 26) + (chr - 64) } - 1 ]
103
107
  end
104
108
  end
105
109
 
@@ -109,7 +113,7 @@ module RubyXL
109
113
  end
110
114
 
111
115
  def to_s
112
- self.collect{ |ref| ref.to_s }.join(' ')
116
+ self.collect(&:to_s).join(' ')
113
117
  end
114
118
  end
115
119
  end
@@ -95,7 +95,7 @@ module RubyXL
95
95
  self.related_files[rel.id] = obj
96
96
  }
97
97
 
98
- @@debug_indent -=2 if @@debug_indent
98
+ @@debug_indent -= 2 if @@debug_indent
99
99
 
100
100
  related_files
101
101
  end
@@ -20,7 +20,7 @@ module RubyXL
20
20
  super
21
21
  # So far, going by the structure that the original creator had in mind. However,
22
22
  # since the actual implementation is now extracted into a separate class,
23
- # we will be able to transparrently change it later if needs be.
23
+ # we will be able to transparently change it later if needs be.
24
24
  @index_by_content = {}
25
25
  end
26
26
 
@@ -50,7 +50,7 @@ module RubyXL
50
50
  end
51
51
 
52
52
  def row
53
- r && r.first_row
53
+ r&.first_row
54
54
  end
55
55
 
56
56
  def row=(v)
@@ -58,7 +58,7 @@ module RubyXL
58
58
  end
59
59
 
60
60
  def column
61
- r && r.first_col
61
+ r&.first_col
62
62
  end
63
63
 
64
64
  def column=(v)
@@ -66,7 +66,7 @@ module RubyXL
66
66
  end
67
67
 
68
68
  def raw_value
69
- value_container && value_container.value
69
+ value_container&.value
70
70
  end
71
71
 
72
72
  def raw_value=(v)
@@ -98,8 +98,7 @@ module RubyXL
98
98
  else false
99
99
  end
100
100
 
101
- num_fmt = self.number_format
102
- num_fmt && num_fmt.is_date_format?
101
+ self.number_format&.is_date_format?
103
102
  end
104
103
 
105
104
  # Gets massaged value of the cell, converting datatypes to those known to Ruby (that includes
@@ -111,6 +110,7 @@ module RubyXL
111
110
  when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
112
111
  when RubyXL::DataType::INLINE_STRING then is.to_s
113
112
  when RubyXL::DataType::RAW_STRING then raw_value
113
+ when RubyXL::DataType::DATE then raw_value && DateTime.parse(raw_value)
114
114
  else
115
115
  if is then is.to_s
116
116
  elsif is_date? then workbook.num_to_date(r.to_f)
@@ -133,7 +133,7 @@ module RubyXL
133
133
  include LegacyCell
134
134
  end
135
135
 
136
- #TODO#<row r="1" spans="1:1" x14ac:dyDescent="0.25">
136
+ #TODO# <row r="1" spans="1:1" x14ac:dyDescent="0.25">
137
137
 
138
138
  # http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
139
139
  class Row < OOXMLObject
@@ -11,7 +11,7 @@ module RubyXL
11
11
  end
12
12
 
13
13
  def self.parse_file(zip_file, file_path)
14
- (entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream { |f| f.read })
14
+ (entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream(&:read))
15
15
  end
16
16
 
17
17
  def add_to_zip(zip_stream)
@@ -79,9 +79,8 @@ module RubyXL
79
79
  define_element_name 'cellXfs'
80
80
 
81
81
  def self.default
82
- self.new(:_ => [
83
- RubyXL::XF.new(:num_fmt_id => 0, :font_id => 0, :fill_id => 0, :border_id => 0, :xfId => 0)
84
- ])
82
+ self.new(:_ => [ RubyXL::XF.new(:num_fmt_id => 0, :font_id => 0, :fill_id => 0,
83
+ :border_id => 0, :xfId => 0) ])
85
84
  end
86
85
  end
87
86
 
@@ -18,7 +18,7 @@ module RubyXL
18
18
 
19
19
  def before_write_xml
20
20
  preserve_whitespace
21
- self.value.gsub!(INVALID_XML10_CHARS) { |c| '_x%04x_' % c.ord }
21
+ self.value.gsub(INVALID_XML10_CHARS) { |bad_char| format('_x%04x_', bad_char.ord) }
22
22
  true
23
23
  end
24
24
 
@@ -84,8 +84,8 @@ module RubyXL
84
84
 
85
85
  def to_s
86
86
  # `dup` here unfreezes the string since it's not a constant but initial value
87
- str = if t.nil? then ''.dup else t.to_s end
88
- r && r.each { |rtr| str << rtr.to_s if rtr }
87
+ str = t.nil? ? ''.dup : t.to_s
88
+ r&.each { |rtr| str << rtr.to_s if rtr }
89
89
  str
90
90
  end
91
91
  end
@@ -1,5 +1,3 @@
1
- # encoding: UTF-8 <-- magic comment, need this because of sime fancy fonts in the default scheme below. See http://stackoverflow.com/questions/6444826/ruby-utf-8-file-encoding
2
-
3
1
  require 'rubyXL/objects/ooxml_object'
4
2
  require 'rubyXL/objects/extensions'
5
3
 
@@ -1391,21 +1389,21 @@ module RubyXL
1391
1389
  end
1392
1390
 
1393
1391
  def get_theme_color(idx)
1394
- color_scheme = a_theme_elements && a_theme_elements.a_clr_scheme
1395
-
1396
- if color_scheme then
1397
- case idx
1398
- when 0 then color_scheme.a_lt1
1399
- when 1 then color_scheme.a_dk1
1400
- when 2 then color_scheme.a_lt2
1401
- when 3 then color_scheme.a_dk2
1402
- when 4 then color_scheme.a_accent1
1403
- when 5 then color_scheme.a_accent2
1404
- when 6 then color_scheme.a_accent3
1405
- when 7 then color_scheme.a_accent4
1406
- when 8 then color_scheme.a_accent5
1407
- when 9 then color_scheme.a_accent6
1408
- end
1392
+ color_scheme = a_theme_elements&.a_clr_scheme
1393
+
1394
+ return unless color_scheme
1395
+
1396
+ case idx
1397
+ when 0 then color_scheme.a_lt1
1398
+ when 1 then color_scheme.a_dk1
1399
+ when 2 then color_scheme.a_lt2
1400
+ when 3 then color_scheme.a_dk2
1401
+ when 4 then color_scheme.a_accent1
1402
+ when 5 then color_scheme.a_accent2
1403
+ when 6 then color_scheme.a_accent3
1404
+ when 7 then color_scheme.a_accent4
1405
+ when 8 then color_scheme.a_accent5
1406
+ when 9 then color_scheme.a_accent6
1409
1407
  end
1410
1408
  end
1411
1409
 
@@ -303,7 +303,7 @@ module RubyXL
303
303
  REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument'.freeze
304
304
 
305
305
  # http://www.accountingweb.com/technology/excel/seven-characters-you-cant-use-in-worksheet-names
306
- SHEET_NAME_FORBIDDEN_CHARS = /[\/\\*\[\]:?]/
306
+ SHEET_NAME_FORBIDDEN_CHARS = %r{[/\\*\[\]:?]}
307
307
 
308
308
  # https://answers.microsoft.com/en-us/msoffice/forum/all/excel-history-is-a-reserved-name-help/f8a398a4-b72c-48e3-82da-4f132c305e91
309
309
  SHEET_NAME_FORBIDDEN_NAMES = [ 'History' ]
@@ -411,12 +411,12 @@ module RubyXL
411
411
  alias_method :write, :save
412
412
 
413
413
  DATE1904 = DateTime.new(1904, 1, 1)
414
- # Subtracting one day to accomodate for erroneous 1900 leap year compatibility only for 1900 based dates
414
+ # Subtracting one day to accommodate for erroneous 1900 leap year compatibility only for 1900 based dates
415
415
  DATE1899 = DateTime.new(1899, 12, 31) - 1
416
416
  MARCH_1_1900 = 61
417
417
 
418
418
  def base_date
419
- (workbook_properties && workbook_properties.date1904) ? DATE1904 : DATE1899
419
+ workbook_properties&.date1904 ? DATE1904 : DATE1899
420
420
  end
421
421
  private :base_date
422
422
 
@@ -432,11 +432,11 @@ module RubyXL
432
432
 
433
433
  # Bug-for-bug Excel compatibility (https://support.microsoft.com/kb/214058/)
434
434
  if num < MARCH_1_1900 then
435
- num += 1 unless workbook_properties && workbook_properties.date1904
435
+ num += 1 unless workbook_properties&.date1904
436
436
  end
437
437
 
438
438
  dateparts = num.divmod(1)
439
- base_date + (dateparts[0] + (dateparts[1] * 86400).round(6) / 86400)
439
+ base_date + (dateparts[0] + ((dateparts[1] * 86400).round(6) / 86400))
440
440
  end
441
441
 
442
442
  include Enumerable
@@ -518,7 +518,7 @@ module RubyXL
518
518
  end
519
519
 
520
520
  def company
521
- root.document_properties.company && root.document_properties.company.value
521
+ root.document_properties.company&.value
522
522
  end
523
523
 
524
524
  def company=(v)
@@ -527,7 +527,7 @@ module RubyXL
527
527
  end
528
528
 
529
529
  def application
530
- root.document_properties.application && root.document_properties.application.value
530
+ root.document_properties.application&.value
531
531
  end
532
532
 
533
533
  def application=(v)
@@ -536,7 +536,7 @@ module RubyXL
536
536
  end
537
537
 
538
538
  def appversion
539
- root.document_properties.app_version && root.document_properties.app_version.value
539
+ root.document_properties.app_version&.value
540
540
  end
541
541
 
542
542
  def appversion=(v)
@@ -561,7 +561,7 @@ module RubyXL
561
561
  end
562
562
 
563
563
  def date1904
564
- workbook_properties && workbook_properties.date1904
564
+ workbook_properties&.date1904
565
565
  end
566
566
 
567
567
  def date1904=(v)