rubyXL 3.4.14 → 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 (462) hide show
  1. checksums.yaml +4 -4
  2. data/.circleci/config.yml +2 -1
  3. data/.rubocop.yml +124 -0
  4. data/CHANGELOG.md +12 -0
  5. data/Gemfile +10 -8
  6. data/README.rdoc +32 -13
  7. data/Rakefile +26 -27
  8. data/VERSION +1 -1
  9. data/lib/rubyXL/cell.rb +2 -4
  10. data/lib/rubyXL/convenience_methods/cell.rb +36 -32
  11. data/lib/rubyXL/convenience_methods/color.rb +9 -13
  12. data/lib/rubyXL/convenience_methods/workbook.rb +10 -9
  13. data/lib/rubyXL/convenience_methods/worksheet.rb +103 -7
  14. data/lib/rubyXL/objects/border.rb +0 -3
  15. data/lib/rubyXL/objects/calculation_chain.rb +2 -2
  16. data/lib/rubyXL/objects/cell_style.rb +1 -3
  17. data/lib/rubyXL/objects/chartsheet.rb +6 -10
  18. data/lib/rubyXL/objects/color.rb +2 -4
  19. data/lib/rubyXL/objects/column_range.rb +16 -15
  20. data/lib/rubyXL/objects/comments.rb +1 -4
  21. data/lib/rubyXL/objects/connection.rb +11 -11
  22. data/lib/rubyXL/objects/container_nodes.rb +1 -5
  23. data/lib/rubyXL/objects/content_types.rb +3 -6
  24. data/lib/rubyXL/objects/data_validation.rb +2 -2
  25. data/lib/rubyXL/objects/document_properties.rb +10 -13
  26. data/lib/rubyXL/objects/extensions.rb +0 -2
  27. data/lib/rubyXL/objects/external_links.rb +37 -7
  28. data/lib/rubyXL/objects/fill.rb +2 -5
  29. data/lib/rubyXL/objects/filters.rb +5 -7
  30. data/lib/rubyXL/objects/font.rb +2 -4
  31. data/lib/rubyXL/objects/formula.rb +3 -5
  32. data/lib/rubyXL/objects/ooxml_object.rb +34 -32
  33. data/lib/rubyXL/objects/query_table.rb +7 -5
  34. data/lib/rubyXL/objects/reference.rb +26 -17
  35. data/lib/rubyXL/objects/relationships.rb +7 -12
  36. data/lib/rubyXL/objects/root.rb +0 -2
  37. data/lib/rubyXL/objects/shared_strings.rb +4 -7
  38. data/lib/rubyXL/objects/sheet_common.rb +1 -3
  39. data/lib/rubyXL/objects/sheet_data.rb +12 -14
  40. data/lib/rubyXL/objects/simple_types.rb +3 -1
  41. data/lib/rubyXL/objects/storage.rb +57 -51
  42. data/lib/rubyXL/objects/stylesheet.rb +9 -17
  43. data/lib/rubyXL/objects/text.rb +6 -8
  44. data/lib/rubyXL/objects/theme.rb +19 -24
  45. data/lib/rubyXL/objects/workbook.rb +43 -38
  46. data/lib/rubyXL/objects/worksheet.rb +35 -31
  47. data/lib/rubyXL/parser.rb +1 -3
  48. data/lib/rubyXL/worksheet.rb +86 -79
  49. data/lib/rubyXL.rb +0 -1
  50. data/rdoc/README_rdoc.html +139 -73
  51. data/rdoc/RubyXL/AExtension.html +24 -60
  52. data/rdoc/RubyXL/AExtensionStorageArea.html +6 -13
  53. data/rdoc/RubyXL/ActiveX.html +19 -46
  54. data/rdoc/RubyXL/ActiveXBinary.html +6 -18
  55. data/rdoc/RubyXL/AdjustHandleList.html +6 -13
  56. data/rdoc/RubyXL/Alignment.html +6 -13
  57. data/rdoc/RubyXL/AlternateContent.html +6 -13
  58. data/rdoc/RubyXL/AlternateUrls.html +99 -0
  59. data/rdoc/RubyXL/Authors.html +6 -13
  60. data/rdoc/RubyXL/AutoFilter.html +6 -13
  61. data/rdoc/RubyXL/AutoFilterColumn.html +6 -13
  62. data/rdoc/RubyXL/BinaryImageFile.html +6 -21
  63. data/rdoc/RubyXL/BodyProperties.html +6 -13
  64. data/rdoc/RubyXL/BooleanNode.html +6 -13
  65. data/rdoc/RubyXL/BooleanValue.html +6 -13
  66. data/rdoc/RubyXL/Border.html +37 -89
  67. data/rdoc/RubyXL/BorderEdge.html +23 -53
  68. data/rdoc/RubyXL/Borders.html +16 -35
  69. data/rdoc/RubyXL/Break.html +6 -13
  70. data/rdoc/RubyXL/BreakList.html +6 -13
  71. data/rdoc/RubyXL/CT_AdjPoint2D.html +6 -13
  72. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +6 -13
  73. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +6 -13
  74. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +6 -13
  75. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +6 -13
  76. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +6 -13
  77. data/rdoc/RubyXL/CT_Backdrop.html +6 -13
  78. data/rdoc/RubyXL/CT_Bevel.html +6 -13
  79. data/rdoc/RubyXL/CT_BiLevelEffect.html +6 -13
  80. data/rdoc/RubyXL/CT_BlendEffect.html +6 -13
  81. data/rdoc/RubyXL/CT_Blip.html +6 -13
  82. data/rdoc/RubyXL/CT_BlipFillProperties.html +6 -13
  83. data/rdoc/RubyXL/CT_BlurEffect.html +6 -13
  84. data/rdoc/RubyXL/CT_Camera.html +6 -13
  85. data/rdoc/RubyXL/CT_Color.html +6 -13
  86. data/rdoc/RubyXL/CT_ColorChangeEffect.html +6 -13
  87. data/rdoc/RubyXL/CT_ColorMapping.html +6 -13
  88. data/rdoc/RubyXL/CT_ColorScheme.html +6 -13
  89. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +6 -13
  90. data/rdoc/RubyXL/CT_ConnectionSite.html +6 -13
  91. data/rdoc/RubyXL/CT_ConnectionSiteList.html +6 -13
  92. data/rdoc/RubyXL/CT_DashStop.html +6 -13
  93. data/rdoc/RubyXL/CT_DashStopList.html +6 -13
  94. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +6 -13
  95. data/rdoc/RubyXL/CT_DuotoneEffect.html +6 -13
  96. data/rdoc/RubyXL/CT_EffectContainer.html +6 -13
  97. data/rdoc/RubyXL/CT_EffectList.html +6 -13
  98. data/rdoc/RubyXL/CT_EffectReference.html +6 -13
  99. data/rdoc/RubyXL/CT_EffectStyleItem.html +6 -13
  100. data/rdoc/RubyXL/CT_EffectStyleList.html +6 -13
  101. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +6 -13
  102. data/rdoc/RubyXL/CT_FillEffect.html +6 -13
  103. data/rdoc/RubyXL/CT_FillOverlayEffect.html +6 -13
  104. data/rdoc/RubyXL/CT_FillStyleList.html +6 -13
  105. data/rdoc/RubyXL/CT_FlatText.html +6 -13
  106. data/rdoc/RubyXL/CT_FontCollection.html +6 -13
  107. data/rdoc/RubyXL/CT_FontReference.html +6 -13
  108. data/rdoc/RubyXL/CT_GeomGuideList.html +6 -13
  109. data/rdoc/RubyXL/CT_GlowEffect.html +6 -13
  110. data/rdoc/RubyXL/CT_GradientFillProperties.html +6 -13
  111. data/rdoc/RubyXL/CT_GradientStop.html +6 -13
  112. data/rdoc/RubyXL/CT_GradientStopList.html +6 -13
  113. data/rdoc/RubyXL/CT_HSLEffect.html +6 -13
  114. data/rdoc/RubyXL/CT_HslColor.html +6 -13
  115. data/rdoc/RubyXL/CT_Hyperlink.html +6 -13
  116. data/rdoc/RubyXL/CT_InnerShadowEffect.html +6 -13
  117. data/rdoc/RubyXL/CT_LightRig.html +6 -13
  118. data/rdoc/RubyXL/CT_LineEndProperties.html +6 -13
  119. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +6 -13
  120. data/rdoc/RubyXL/CT_LineProperties.html +6 -13
  121. data/rdoc/RubyXL/CT_LineStyleList.html +6 -13
  122. data/rdoc/RubyXL/CT_LinearShadeProperties.html +6 -13
  123. data/rdoc/RubyXL/CT_LuminanceEffect.html +6 -13
  124. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +6 -13
  125. data/rdoc/RubyXL/CT_OuterShadowEffect.html +6 -13
  126. data/rdoc/RubyXL/CT_Path2D.html +6 -13
  127. data/rdoc/RubyXL/CT_Path2DArcTo.html +6 -13
  128. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +6 -13
  129. data/rdoc/RubyXL/CT_Path2DList.html +6 -13
  130. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +6 -13
  131. data/rdoc/RubyXL/CT_Path2DTo.html +6 -13
  132. data/rdoc/RubyXL/CT_PathShadeProperties.html +6 -13
  133. data/rdoc/RubyXL/CT_PatternFillProperties.html +6 -13
  134. data/rdoc/RubyXL/CT_Point3D.html +6 -13
  135. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +6 -13
  136. data/rdoc/RubyXL/CT_PresetColor.html +6 -13
  137. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +6 -13
  138. data/rdoc/RubyXL/CT_PresetShadowEffect.html +6 -13
  139. data/rdoc/RubyXL/CT_PresetTextShape.html +6 -13
  140. data/rdoc/RubyXL/CT_ReflectionEffect.html +6 -13
  141. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +6 -13
  142. data/rdoc/RubyXL/CT_RelativeRect.html +6 -13
  143. data/rdoc/RubyXL/CT_SRgbColor.html +6 -13
  144. data/rdoc/RubyXL/CT_ScRgbColor.html +6 -13
  145. data/rdoc/RubyXL/CT_Scene3D.html +6 -13
  146. data/rdoc/RubyXL/CT_SchemeColor.html +6 -13
  147. data/rdoc/RubyXL/CT_Shape3D.html +6 -13
  148. data/rdoc/RubyXL/CT_ShapeStyle.html +6 -13
  149. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +6 -13
  150. data/rdoc/RubyXL/CT_SphereCoords.html +6 -13
  151. data/rdoc/RubyXL/CT_StretchInfoProperties.html +6 -13
  152. data/rdoc/RubyXL/CT_StyleMatrix.html +6 -13
  153. data/rdoc/RubyXL/CT_StyleMatrixReference.html +6 -13
  154. data/rdoc/RubyXL/CT_SupplementalFont.html +6 -13
  155. data/rdoc/RubyXL/CT_SystemColor.html +6 -13
  156. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +6 -13
  157. data/rdoc/RubyXL/CT_TextBlipBullet.html +6 -13
  158. data/rdoc/RubyXL/CT_TextCharBullet.html +6 -13
  159. data/rdoc/RubyXL/CT_TextCharacterProperties.html +6 -13
  160. data/rdoc/RubyXL/CT_TextFont.html +6 -13
  161. data/rdoc/RubyXL/CT_TextListStyle.html +6 -13
  162. data/rdoc/RubyXL/CT_TextNormalAutofit.html +6 -13
  163. data/rdoc/RubyXL/CT_TextParagraphProperties.html +6 -13
  164. data/rdoc/RubyXL/CT_TextSpacing.html +6 -13
  165. data/rdoc/RubyXL/CT_TextTabStop.html +6 -13
  166. data/rdoc/RubyXL/CT_TextTabStopList.html +6 -13
  167. data/rdoc/RubyXL/CT_TileInfoProperties.html +6 -13
  168. data/rdoc/RubyXL/CT_TintEffect.html +6 -13
  169. data/rdoc/RubyXL/CT_Transform2D.html +6 -13
  170. data/rdoc/RubyXL/CT_TransformEffect.html +6 -13
  171. data/rdoc/RubyXL/CT_Vector3D.html +6 -13
  172. data/rdoc/RubyXL/CT_XYAdjustHandle.html +6 -13
  173. data/rdoc/RubyXL/CalculationChain.html +15 -42
  174. data/rdoc/RubyXL/CalculationChainCell.html +6 -13
  175. data/rdoc/RubyXL/CalculationProperties.html +6 -13
  176. data/rdoc/RubyXL/Cell.html +116 -290
  177. data/rdoc/RubyXL/CellConvenienceMethods.html +318 -641
  178. data/rdoc/RubyXL/CellExt.html +6 -13
  179. data/rdoc/RubyXL/CellSmartTag.html +6 -13
  180. data/rdoc/RubyXL/CellSmartTagProperty.html +6 -13
  181. data/rdoc/RubyXL/CellSmartTags.html +6 -13
  182. data/rdoc/RubyXL/CellStyle.html +6 -13
  183. data/rdoc/RubyXL/CellStyleXFs.html +16 -35
  184. data/rdoc/RubyXL/CellStyles.html +16 -35
  185. data/rdoc/RubyXL/CellValue.html +16 -35
  186. data/rdoc/RubyXL/CellWatch.html +6 -13
  187. data/rdoc/RubyXL/CellWatches.html +6 -13
  188. data/rdoc/RubyXL/CellXFs.html +18 -40
  189. data/rdoc/RubyXL/ChartColorsFile.html +6 -21
  190. data/rdoc/RubyXL/ChartFile.html +18 -48
  191. data/rdoc/RubyXL/ChartStyleFile.html +6 -21
  192. data/rdoc/RubyXL/ChartUserShapesFile.html +6 -21
  193. data/rdoc/RubyXL/Chartsheet.html +18 -65
  194. data/rdoc/RubyXL/ChartsheetPageSetup.html +6 -13
  195. data/rdoc/RubyXL/ChartsheetProperties.html +6 -13
  196. data/rdoc/RubyXL/ChartsheetProtection.html +6 -13
  197. data/rdoc/RubyXL/ChartsheetView.html +6 -13
  198. data/rdoc/RubyXL/ChartsheetViews.html +6 -13
  199. data/rdoc/RubyXL/Color.html +17 -41
  200. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +25 -69
  201. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +36 -92
  202. data/rdoc/RubyXL/ColorConvenienceClasses.html +4 -10
  203. data/rdoc/RubyXL/ColorConvenienceMethods.html +14 -32
  204. data/rdoc/RubyXL/ColorFilter.html +6 -13
  205. data/rdoc/RubyXL/ColorScale.html +6 -13
  206. data/rdoc/RubyXL/ColorSet.html +6 -13
  207. data/rdoc/RubyXL/Colors.html +6 -13
  208. data/rdoc/RubyXL/ColumnRange.html +66 -81
  209. data/rdoc/RubyXL/ColumnRanges.html +43 -95
  210. data/rdoc/RubyXL/Comment.html +6 -13
  211. data/rdoc/RubyXL/CommentList.html +6 -13
  212. data/rdoc/RubyXL/CommentsFile.html +16 -48
  213. data/rdoc/RubyXL/ConditionalFormatValue.html +6 -13
  214. data/rdoc/RubyXL/ConditionalFormatting.html +6 -13
  215. data/rdoc/RubyXL/ConditionalFormattingRule.html +6 -13
  216. data/rdoc/RubyXL/Connection.html +6 -13
  217. data/rdoc/RubyXL/ConnectionTable.html +6 -13
  218. data/rdoc/RubyXL/ConnectionTables.html +6 -13
  219. data/rdoc/RubyXL/ConnectionTextField.html +6 -13
  220. data/rdoc/RubyXL/ConnectionTextFields.html +6 -13
  221. data/rdoc/RubyXL/Connections.html +15 -42
  222. data/rdoc/RubyXL/ContentTypeDefault.html +6 -13
  223. data/rdoc/RubyXL/ContentTypeOverride.html +6 -13
  224. data/rdoc/RubyXL/ContentTypes.html +25 -63
  225. data/rdoc/RubyXL/ControlPropertiesFile.html +8 -18
  226. data/rdoc/RubyXL/CorePropertiesFile.html +72 -192
  227. data/rdoc/RubyXL/CustomColor.html +6 -13
  228. data/rdoc/RubyXL/CustomColorList.html +6 -13
  229. data/rdoc/RubyXL/CustomFilter.html +6 -13
  230. data/rdoc/RubyXL/CustomFilters.html +6 -13
  231. data/rdoc/RubyXL/CustomGeometry.html +6 -13
  232. data/rdoc/RubyXL/CustomProperties.html +6 -13
  233. data/rdoc/RubyXL/CustomPropertiesFile.html +6 -21
  234. data/rdoc/RubyXL/CustomProperty.html +6 -13
  235. data/rdoc/RubyXL/CustomPropertyFile.html +6 -21
  236. data/rdoc/RubyXL/CustomSheetView.html +6 -13
  237. data/rdoc/RubyXL/CustomSheetViews.html +6 -13
  238. data/rdoc/RubyXL/CustomWorkbookView.html +6 -13
  239. data/rdoc/RubyXL/CustomWorkbookViews.html +6 -13
  240. data/rdoc/RubyXL/CustomXMLFile.html +6 -18
  241. data/rdoc/RubyXL/DXF.html +6 -13
  242. data/rdoc/RubyXL/DXFs.html +6 -13
  243. data/rdoc/RubyXL/DataBar.html +6 -13
  244. data/rdoc/RubyXL/DataConsolidate.html +6 -13
  245. data/rdoc/RubyXL/DataConsolidationReference.html +6 -13
  246. data/rdoc/RubyXL/DataConsolidationReferences.html +6 -13
  247. data/rdoc/RubyXL/DataType.html +4 -33
  248. data/rdoc/RubyXL/DataValidation.html +6 -13
  249. data/rdoc/RubyXL/DataValidations.html +6 -13
  250. data/rdoc/RubyXL/DateGroupItem.html +6 -13
  251. data/rdoc/RubyXL/DefinedName.html +6 -13
  252. data/rdoc/RubyXL/DefinedNameExt.html +6 -13
  253. data/rdoc/RubyXL/DefinedNames.html +6 -13
  254. data/rdoc/RubyXL/DefinedNamesExt.html +6 -13
  255. data/rdoc/RubyXL/DocumentPropertiesFile.html +23 -65
  256. data/rdoc/RubyXL/DrawingFile.html +18 -48
  257. data/rdoc/RubyXL/DynamicFilter.html +6 -13
  258. data/rdoc/RubyXL/EmbeddedControl.html +6 -13
  259. data/rdoc/RubyXL/EmbeddedControls.html +6 -13
  260. data/rdoc/RubyXL/Extension.html +6 -13
  261. data/rdoc/RubyXL/ExtensionStorageArea.html +6 -13
  262. data/rdoc/RubyXL/Extents.html +6 -13
  263. data/rdoc/RubyXL/ExternalBook.html +6 -13
  264. data/rdoc/RubyXL/ExternalLinksFile.html +18 -48
  265. data/rdoc/RubyXL/ExternalReference.html +6 -13
  266. data/rdoc/RubyXL/ExternalReferences.html +6 -13
  267. data/rdoc/RubyXL/ExtraColorSchemeList.html +6 -13
  268. data/rdoc/RubyXL/FieldItem.html +6 -13
  269. data/rdoc/RubyXL/FileRecoveryProperties.html +6 -13
  270. data/rdoc/RubyXL/FileSharing.html +6 -13
  271. data/rdoc/RubyXL/FileVersion.html +6 -13
  272. data/rdoc/RubyXL/Fill.html +16 -35
  273. data/rdoc/RubyXL/Fills.html +16 -35
  274. data/rdoc/RubyXL/FilterContainer.html +6 -13
  275. data/rdoc/RubyXL/FloatNode.html +6 -13
  276. data/rdoc/RubyXL/FloatValue.html +6 -13
  277. data/rdoc/RubyXL/Font.html +18 -42
  278. data/rdoc/RubyXL/FontConvenienceMethods.html +92 -253
  279. data/rdoc/RubyXL/FontScheme.html +6 -13
  280. data/rdoc/RubyXL/Fonts.html +16 -35
  281. data/rdoc/RubyXL/Formula.html +6 -13
  282. data/rdoc/RubyXL/FunctionGroup.html +6 -13
  283. data/rdoc/RubyXL/FunctionGroups.html +6 -13
  284. data/rdoc/RubyXL/GenericStorageObject.html +32 -90
  285. data/rdoc/RubyXL/GradientFill.html +6 -13
  286. data/rdoc/RubyXL/HeaderFooterSettings.html +6 -13
  287. data/rdoc/RubyXL/Hyperlink.html +6 -13
  288. data/rdoc/RubyXL/HyperlinkRelFile.html +6 -18
  289. data/rdoc/RubyXL/Hyperlinks.html +6 -13
  290. data/rdoc/RubyXL/IconFilter.html +6 -13
  291. data/rdoc/RubyXL/IconSet.html +6 -13
  292. data/rdoc/RubyXL/IgnoredError.html +6 -13
  293. data/rdoc/RubyXL/IgnoredErrors.html +6 -13
  294. data/rdoc/RubyXL/IndexedColors.html +6 -13
  295. data/rdoc/RubyXL/InputCells.html +6 -13
  296. data/rdoc/RubyXL/IntegerNode.html +6 -13
  297. data/rdoc/RubyXL/IntegerValue.html +6 -13
  298. data/rdoc/RubyXL/LegacyCell.html +14 -32
  299. data/rdoc/RubyXL/LegacyWorksheet.html +64 -116
  300. data/rdoc/RubyXL/MRUColors.html +6 -13
  301. data/rdoc/RubyXL/MacrosFile.html +6 -21
  302. data/rdoc/RubyXL/MergedCell.html +6 -13
  303. data/rdoc/RubyXL/MergedCells.html +6 -13
  304. data/rdoc/RubyXL/NumFmt.html +6 -13
  305. data/rdoc/RubyXL/NumberFormat.html +17 -36
  306. data/rdoc/RubyXL/NumberFormats.html +16 -40
  307. data/rdoc/RubyXL/OLEObject.html +6 -13
  308. data/rdoc/RubyXL/OLEObjectFile.html +6 -21
  309. data/rdoc/RubyXL/OLEObjects.html +6 -13
  310. data/rdoc/RubyXL/OLESize.html +6 -13
  311. data/rdoc/RubyXL/OOXMLContainerObject.html +57 -140
  312. data/rdoc/RubyXL/OOXMLIgnored.html +24 -55
  313. data/rdoc/RubyXL/OOXMLObject.html +9 -19
  314. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +80 -115
  315. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +79 -185
  316. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +86 -223
  317. data/rdoc/RubyXL/OOXMLTopLevelObject.html +46 -123
  318. data/rdoc/RubyXL/OdbcOleDbProperties.html +6 -13
  319. data/rdoc/RubyXL/Offset.html +6 -13
  320. data/rdoc/RubyXL/OlapProperties.html +6 -13
  321. data/rdoc/RubyXL/OleItem.html +99 -0
  322. data/rdoc/RubyXL/OleItems.html +99 -0
  323. data/rdoc/RubyXL/OleLink.html +99 -0
  324. data/rdoc/RubyXL/OutlineProperties.html +6 -13
  325. data/rdoc/RubyXL/PageMargins.html +6 -13
  326. data/rdoc/RubyXL/PageSetup.html +6 -13
  327. data/rdoc/RubyXL/PageSetupProperties.html +6 -13
  328. data/rdoc/RubyXL/Pane.html +6 -13
  329. data/rdoc/RubyXL/Parser.html +24 -54
  330. data/rdoc/RubyXL/PatternFill.html +6 -13
  331. data/rdoc/RubyXL/PersonMetadata.html +108 -0
  332. data/rdoc/RubyXL/PhoneticProperties.html +6 -13
  333. data/rdoc/RubyXL/PhoneticRun.html +6 -13
  334. data/rdoc/RubyXL/PivotArea.html +6 -13
  335. data/rdoc/RubyXL/PivotCache.html +6 -13
  336. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +8 -26
  337. data/rdoc/RubyXL/PivotCacheRecordsFile.html +6 -21
  338. data/rdoc/RubyXL/PivotCaches.html +6 -13
  339. data/rdoc/RubyXL/PivotReference.html +6 -13
  340. data/rdoc/RubyXL/PivotReferences.html +6 -13
  341. data/rdoc/RubyXL/PivotTableFile.html +8 -26
  342. data/rdoc/RubyXL/PivotTableSelection.html +6 -13
  343. data/rdoc/RubyXL/PresetGeometry.html +6 -13
  344. data/rdoc/RubyXL/PrintOptions.html +6 -13
  345. data/rdoc/RubyXL/PrinterSettingsFile.html +6 -21
  346. data/rdoc/RubyXL/ProtectedRange.html +6 -13
  347. data/rdoc/RubyXL/ProtectedRanges.html +6 -13
  348. data/rdoc/RubyXL/Protection.html +6 -13
  349. data/rdoc/RubyXL/QueryParameter.html +6 -13
  350. data/rdoc/RubyXL/QueryParameters.html +6 -13
  351. data/rdoc/RubyXL/QueryTable.html +18 -48
  352. data/rdoc/RubyXL/QueryTableDeletedField.html +6 -13
  353. data/rdoc/RubyXL/QueryTableDeletedFields.html +6 -13
  354. data/rdoc/RubyXL/QueryTableField.html +6 -13
  355. data/rdoc/RubyXL/QueryTableFields.html +6 -13
  356. data/rdoc/RubyXL/QueryTableRefresh.html +6 -13
  357. data/rdoc/RubyXL/RID.html +6 -13
  358. data/rdoc/RubyXL/RawOOXML.html +24 -60
  359. data/rdoc/RubyXL/Reference.html +137 -263
  360. data/rdoc/RubyXL/Relationship.html +6 -13
  361. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +14 -32
  362. data/rdoc/RubyXL/RelationshipSupport.html +52 -137
  363. data/rdoc/RubyXL/RevisionPointer.html +6 -13
  364. data/rdoc/RubyXL/RichText.html +19 -37
  365. data/rdoc/RubyXL/RichTextRun.html +16 -35
  366. data/rdoc/RubyXL/Row.html +63 -180
  367. data/rdoc/RubyXL/RowExt.html +6 -13
  368. data/rdoc/RubyXL/RunProperties.html +6 -13
  369. data/rdoc/RubyXL/Scenario.html +6 -13
  370. data/rdoc/RubyXL/Scenarios.html +6 -13
  371. data/rdoc/RubyXL/Selection.html +16 -35
  372. data/rdoc/RubyXL/ShapeGuide.html +6 -13
  373. data/rdoc/RubyXL/ShapeTextRectangle.html +6 -13
  374. data/rdoc/RubyXL/SharedStringsTable.html +60 -156
  375. data/rdoc/RubyXL/Sheet.html +6 -13
  376. data/rdoc/RubyXL/SheetCalculationProperties.html +6 -13
  377. data/rdoc/RubyXL/SheetData.html +21 -51
  378. data/rdoc/RubyXL/SheetDataExt.html +6 -13
  379. data/rdoc/RubyXL/SheetDataSet.html +6 -13
  380. data/rdoc/RubyXL/SheetMetadata.html +108 -0
  381. data/rdoc/RubyXL/SheetName.html +6 -13
  382. data/rdoc/RubyXL/SheetNames.html +6 -13
  383. data/rdoc/RubyXL/Sheets.html +6 -13
  384. data/rdoc/RubyXL/SlicerCacheFile.html +6 -21
  385. data/rdoc/RubyXL/SlicerFile.html +6 -21
  386. data/rdoc/RubyXL/SmartTagProperties.html +6 -13
  387. data/rdoc/RubyXL/SmartTagType.html +6 -13
  388. data/rdoc/RubyXL/SmartTagTypes.html +6 -13
  389. data/rdoc/RubyXL/SmartTags.html +6 -13
  390. data/rdoc/RubyXL/SortCondition.html +6 -13
  391. data/rdoc/RubyXL/SortState.html +6 -13
  392. data/rdoc/RubyXL/Sqref.html +25 -56
  393. data/rdoc/RubyXL/Stop.html +6 -13
  394. data/rdoc/RubyXL/StringNode.html +6 -13
  395. data/rdoc/RubyXL/StringNodeW3C.html +24 -55
  396. data/rdoc/RubyXL/StringValue.html +6 -13
  397. data/rdoc/RubyXL/Stylesheet.html +45 -118
  398. data/rdoc/RubyXL/TableFile.html +6 -21
  399. data/rdoc/RubyXL/TableParts.html +6 -13
  400. data/rdoc/RubyXL/TableStyle.html +6 -13
  401. data/rdoc/RubyXL/TableStyles.html +6 -13
  402. data/rdoc/RubyXL/Text.html +25 -63
  403. data/rdoc/RubyXL/TextImportSettings.html +6 -13
  404. data/rdoc/RubyXL/Theme.html +46 -96
  405. data/rdoc/RubyXL/ThemeElements.html +6 -13
  406. data/rdoc/RubyXL/ThumbnailFile.html +6 -21
  407. data/rdoc/RubyXL/Top10.html +6 -13
  408. data/rdoc/RubyXL/VMLDrawingFile.html +9 -27
  409. data/rdoc/RubyXL/Variant.html +6 -13
  410. data/rdoc/RubyXL/Vector.html +16 -35
  411. data/rdoc/RubyXL/VectorValue.html +6 -13
  412. data/rdoc/RubyXL/VisualProperties.html +6 -13
  413. data/rdoc/RubyXL/WebPublishObject.html +6 -13
  414. data/rdoc/RubyXL/WebPublishObjects.html +6 -13
  415. data/rdoc/RubyXL/WebPublishingItem.html +6 -13
  416. data/rdoc/RubyXL/WebPublishingItems.html +6 -13
  417. data/rdoc/RubyXL/WebPublishingProperties.html +6 -13
  418. data/rdoc/RubyXL/WebQueryProperties.html +6 -13
  419. data/rdoc/RubyXL/Workbook.html +222 -583
  420. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +170 -309
  421. data/rdoc/RubyXL/WorkbookProperties.html +6 -13
  422. data/rdoc/RubyXL/WorkbookProtection.html +6 -13
  423. data/rdoc/RubyXL/WorkbookRoot.html +47 -125
  424. data/rdoc/RubyXL/WorkbookView.html +6 -13
  425. data/rdoc/RubyXL/WorkbookViews.html +6 -13
  426. data/rdoc/RubyXL/Worksheet.html +79 -160
  427. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +605 -1269
  428. data/rdoc/RubyXL/WorksheetDimensions.html +6 -13
  429. data/rdoc/RubyXL/WorksheetFormatProperties.html +6 -13
  430. data/rdoc/RubyXL/WorksheetProperties.html +6 -13
  431. data/rdoc/RubyXL/WorksheetProtection.html +6 -13
  432. data/rdoc/RubyXL/WorksheetView.html +6 -13
  433. data/rdoc/RubyXL/WorksheetViews.html +6 -13
  434. data/rdoc/RubyXL/XF.html +6 -13
  435. data/rdoc/RubyXL.html +15 -324
  436. data/rdoc/created.rid +44 -44
  437. data/rdoc/css/rdoc.css +76 -8
  438. data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
  439. data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
  440. data/rdoc/index.html +397 -769
  441. data/rdoc/js/darkfish.js +14 -1
  442. data/rdoc/js/navigation.js +8 -8
  443. data/rdoc/js/navigation.js.gz +0 -0
  444. data/rdoc/js/search.js +4 -4
  445. data/rdoc/js/search_index.js +1 -1
  446. data/rdoc/js/search_index.js.gz +0 -0
  447. data/rdoc/js/searcher.js.gz +0 -0
  448. data/rdoc/table_of_contents.html +68 -5
  449. data/rubyXL.gemspec +28 -29
  450. data/spec/lib/cell_spec.rb +67 -9
  451. data/spec/lib/color_spec.rb +8 -1
  452. data/spec/lib/parser_spec.rb +28 -28
  453. data/spec/lib/reference_spec.rb +41 -5
  454. data/spec/lib/rgb_color_spec.rb +16 -3
  455. data/spec/lib/stylesheet_spec.rb +10 -11
  456. data/spec/lib/text_spec.rb +4 -6
  457. data/spec/lib/workbook_spec.rb +20 -8
  458. data/spec/lib/worksheet_spec.rb +815 -460
  459. data/spec/spec_helper.rb +2 -0
  460. data/test/test_parse_write.rb +3 -3
  461. metadata +26 -6
  462. data/Gemfile.lock +0 -92
@@ -1,7 +1,6 @@
1
1
  require 'rubyXL/objects/ooxml_object'
2
2
 
3
3
  module RubyXL
4
-
5
4
  class ContentTypeDefault < OOXMLObject
6
5
  define_attribute(:Extension, :string)
7
6
  define_attribute(:ContentType, :string)
@@ -9,7 +8,7 @@ module RubyXL
9
8
  end
10
9
 
11
10
  class ContentTypeOverride < OOXMLObject
12
- define_attribute(:PartName, :string)
11
+ define_attribute(:PartName, :string)
13
12
  define_attribute(:ContentType, :string)
14
13
  define_element_name 'Override'
15
14
  end
@@ -48,7 +47,7 @@ module RubyXL
48
47
  content_types_by_ext.each_pair { |ext, content_types_arr|
49
48
  next if ext.nil? || defaults.any? { |d| d.extension == ext }
50
49
  most_frequent_ct = content_types_arr.group_by { |ct| ct }.values.max_by(&:size).first
51
- defaults << RubyXL::ContentTypeDefault.new(:extension => ext, :content_type => most_frequent_ct )
50
+ defaults << RubyXL::ContentTypeDefault.new(:extension => ext, :content_type => most_frequent_ct)
52
51
  }
53
52
 
54
53
  self.overrides = []
@@ -64,14 +63,12 @@ module RubyXL
64
63
 
65
64
  ext = obj.xlsx_path.extname[1..-1]
66
65
  next if defaults.any? { |d| (d.extension == ext) && (d.content_type == obj_content_type) }
67
- overrides << RubyXL::ContentTypeOverride.new(:part_name => obj.xlsx_path,
66
+ overrides << RubyXL::ContentTypeOverride.new(:part_name => obj.xlsx_path,
68
67
  :content_type => obj_content_type)
69
68
  }
70
69
  }
71
70
 
72
71
  true
73
72
  end
74
-
75
73
  end
76
-
77
74
  end
@@ -3,7 +3,6 @@ require 'rubyXL/objects/simple_types'
3
3
  require 'rubyXL/objects/formula'
4
4
 
5
5
  module RubyXL
6
-
7
6
  # http://www.datypic.com/sc/ooxml/e-ssml_dataValidation-1.html
8
7
  class DataValidation < OOXMLObject
9
8
  define_attribute(:type, RubyXL::ST_DataValidationType, :default => 'none')
@@ -11,6 +10,8 @@ module RubyXL
11
10
  define_attribute(:imeMode, RubyXL::ST_DataValidationImeMode, :default => 'noControl')
12
11
  define_attribute(:operator, RubyXL::ST_DataValidationOperator, :default => 'between')
13
12
  define_attribute(:allowBlank, :bool, :default => false)
13
+ # Documentation lies. This property should have been called "HIDE dropdown",
14
+ # since that's what happens when it is set to true.
14
15
  define_attribute(:showDropDown, :bool, :default => false)
15
16
  define_attribute(:showInputMessage, :bool, :default => false)
16
17
  define_attribute(:showErrorMessage, :bool, :default => false)
@@ -33,5 +34,4 @@ module RubyXL
33
34
  define_child_node(RubyXL::DataValidation, :collection => :with_count)
34
35
  define_element_name 'dataValidations'
35
36
  end
36
-
37
37
  end
@@ -3,11 +3,10 @@ require 'rubyXL/objects/container_nodes'
3
3
  require 'time'
4
4
 
5
5
  module RubyXL
6
-
7
6
  # http://www.datypic.com/sc/ooxml/e-extended-properties_Properties.html
8
7
  class DocumentPropertiesFile < OOXMLTopLevelObject
9
- CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.extended-properties+xml'
10
- REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties'
8
+ CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.extended-properties+xml'.freeze
9
+ REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/extended-properties'.freeze
11
10
 
12
11
  attr_accessor :workbook
13
12
 
@@ -39,7 +38,7 @@ module RubyXL
39
38
  define_child_node(RubyXL::StringNode, :node_name => :AppVersion)
40
39
  define_child_node(RubyXL::IntegerNode, :node_name => :DocSecurity)
41
40
  set_namespaces('http://schemas.openxmlformats.org/officeDocument/2006/extended-properties' => nil,
42
- 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes' => 'vt')
41
+ 'http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes' => 'vt')
43
42
  define_element_name 'Properties'
44
43
 
45
44
  def add_parts_count(name, count)
@@ -70,6 +69,7 @@ module RubyXL
70
69
  when RubyXL::Chartsheet then chartsheets += 1
71
70
  end
72
71
  }
72
+
73
73
  add_parts_count('Worksheets', worksheets) if worksheets > 0
74
74
  add_parts_count('Charts', chartsheets) if chartsheets > 0
75
75
 
@@ -84,13 +84,12 @@ module RubyXL
84
84
  def xlsx_path
85
85
  ROOT.join('docProps', 'app.xml')
86
86
  end
87
-
88
87
  end
89
88
 
90
89
 
91
90
  class CorePropertiesFile < OOXMLTopLevelObject
92
- CONTENT_TYPE = 'application/vnd.openxmlformats-package.core-properties+xml'
93
- REL_TYPE = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties'
91
+ CONTENT_TYPE = 'application/vnd.openxmlformats-package.core-properties+xml'.freeze
92
+ REL_TYPE = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties'.freeze
94
93
 
95
94
  attr_accessor :workbook
96
95
 
@@ -112,10 +111,10 @@ module RubyXL
112
111
  define_child_node(RubyXL::StringNode, :node_name => 'cp:version')
113
112
 
114
113
  set_namespaces('http://schemas.openxmlformats.org/package/2006/metadata/core-properties' => 'cp',
115
- 'http://purl.org/dc/elements/1.1/' => 'dc',
116
- 'http://purl.org/dc/terms/' => 'dcterms',
117
- 'http://purl.org/dc/dcmitype/' => 'dcmitype',
118
- 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi')
114
+ 'http://purl.org/dc/elements/1.1/' => 'dc',
115
+ 'http://purl.org/dc/terms/' => 'dcterms',
116
+ 'http://purl.org/dc/dcmitype/' => 'dcmitype',
117
+ 'http://www.w3.org/2001/XMLSchema-instance' => 'xsi')
119
118
  define_element_name 'cp:coreProperties'
120
119
 
121
120
  def xlsx_path
@@ -153,7 +152,5 @@ module RubyXL
153
152
  def modified_at=(v)
154
153
  self.dcterms_modified = RubyXL::StringNodeW3C.default(v)
155
154
  end
156
-
157
155
  end
158
-
159
156
  end
@@ -1,7 +1,6 @@
1
1
  require 'rubyXL/objects/ooxml_object'
2
2
 
3
3
  module RubyXL
4
-
5
4
  # http://www.datypic.com/sc/ooxml/e-ssml_ext-1.html
6
5
  class RawOOXML < OOXMLObject
7
6
  attr_accessor :raw_xml
@@ -49,5 +48,4 @@ module RubyXL
49
48
  class RevisionPointer < OOXMLIgnored
50
49
  define_element_name 'xr:revisionPtr'
51
50
  end
52
-
53
51
  end
@@ -1,5 +1,4 @@
1
1
  module RubyXL
2
-
3
2
  # http://www.datypic.com/sc/ooxml/e-ssml_sheetName-1.html
4
3
  class SheetName < OOXMLObject
5
4
  define_attribute(:val, :string)
@@ -56,30 +55,61 @@ module RubyXL
56
55
  define_element_name 'sheetDataSet'
57
56
  end
58
57
 
58
+ # https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/452524b4-b22f-45a9-aac1-81fdd1f1db6c
59
+ class AlternateUrls < OOXMLObject
60
+ define_attribute(:absoluteUrl, :string, :required => false)
61
+ define_attribute(:relativeUrl, :string, :required => false)
62
+ define_element_name 'xxl21:alternateUrls'
63
+ end
64
+
59
65
  # http://www.datypic.com/sc/ooxml/e-ssml_externalBook-1.html
60
66
  class ExternalBook < OOXMLObject
61
67
  define_child_node(RubyXL::SheetNames)
62
68
  define_child_node(RubyXL::DefinedNamesExt)
63
69
  define_child_node(RubyXL::SheetDataSet)
64
- define_attribute(:'r:id', :string, :required => true)
70
+ define_child_node(RubyXL::AlternateUrls)
71
+ define_relationship(:required => true)
65
72
  define_element_name 'externalBook'
66
73
  end
67
74
 
75
+ # http://www.datypic.com/sc/ooxml/e-ssml_oleItem-1.html
76
+ class OleItem < OOXMLObject
77
+ define_attribute(:name, :string, :required => true)
78
+ define_attribute(:icon, :bool)
79
+ define_attribute(:advise, :bool)
80
+ define_attribute(:preferPic, :bool)
81
+ define_element_name 'oleItem'
82
+ end
83
+
84
+ # http://www.datypic.com/sc/ooxml/e-ssml_oleItems-1.html
85
+ class OleItems < OOXMLContainerObject
86
+ define_child_node(RubyXL::OleItem)
87
+ define_element_name 'oleItems'
88
+ end
89
+
90
+ # http://www.datypic.com/sc/ooxml/t-ssml_CT_OleLink.html
91
+ class OleLink < OOXMLObject
92
+ define_child_node(RubyXL::OleItems, :collection => true)
93
+ define_relationship(:required => true)
94
+ define_attribute(:progId, :string, :required => true)
95
+ define_element_name 'oleLink'
96
+ end
97
+
68
98
  class ExternalLinksFile < OOXMLTopLevelObject
69
- CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml'
70
- REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink'
99
+ CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.externalLink+xml'.freeze
100
+ REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/externalLink'.freeze
71
101
 
72
102
  include RubyXL::RelationshipSupport
73
103
  define_child_node(RubyXL::ExternalBook)
104
+ define_child_node(RubyXL::OleLink)
74
105
 
75
106
  define_element_name 'externalLink'
76
- set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
77
- 'http://schemas.openxmlformats.org/markup-compatibility/2006' => 'mc',
107
+ set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
108
+ 'http://schemas.openxmlformats.org/markup-compatibility/2006' => 'mc',
78
109
  'http://schemas.openxmlformats.org/officeDocument/2006/relationships' => 'r')
79
110
 
80
111
  def xlsx_path
81
112
  ROOT.join('xl', 'externalLinks', "externalLink#{file_index}.xml")
82
113
  end
83
114
  end
84
-
85
115
  end
@@ -2,7 +2,6 @@ require 'rubyXL/objects/ooxml_object'
2
2
  require 'rubyXL/objects/simple_types'
3
3
 
4
4
  module RubyXL
5
-
6
5
  # http://www.datypic.com/sc/ooxml/e-ssml_stop-1.html
7
6
  class Stop < OOXMLObject
8
7
  define_attribute(:position, :double, :required => true)
@@ -13,8 +12,8 @@ module RubyXL
13
12
  # http://www.datypic.com/sc/ooxml/e-ssml_patternFill-1.html
14
13
  class PatternFill < OOXMLObject
15
14
  define_attribute(:patternType, RubyXL::ST_PatternType)
16
- define_child_node(RubyXL::Color, :node_name => :fgColor )
17
- define_child_node(RubyXL::Color, :node_name => :bgColor )
15
+ define_child_node(RubyXL::Color, :node_name => :fgColor)
16
+ define_child_node(RubyXL::Color, :node_name => :bgColor)
18
17
  define_element_name 'patternFill'
19
18
  end
20
19
 
@@ -39,7 +38,6 @@ module RubyXL
39
38
  def self.default(pattern_type)
40
39
  self.new(:pattern_fill => RubyXL::PatternFill.new(:pattern_type => pattern_type))
41
40
  end
42
-
43
41
  end
44
42
 
45
43
  # http://www.datypic.com/sc/ooxml/e-ssml_fills-1.html
@@ -51,5 +49,4 @@ module RubyXL
51
49
  self.new(:_ => [ RubyXL::Fill.default('none'), RubyXL::Fill.default('gray125') ])
52
50
  end
53
51
  end
54
-
55
52
  end
@@ -3,7 +3,6 @@ require 'rubyXL/objects/simple_types'
3
3
  require 'rubyXL/objects/extensions'
4
4
 
5
5
  module RubyXL
6
-
7
6
  # http://www.datypic.com/sc/ooxml/e-ssml_dateGroupItem-1.html
8
7
  class DateGroupItem < OOXMLObject
9
8
  define_attribute(:year, :int, :required => true)
@@ -18,7 +17,7 @@ module RubyXL
18
17
 
19
18
  # http://www.datypic.com/sc/ooxml/e-ssml_filters-1.html
20
19
  class FilterContainer < OOXMLObject
21
- define_attribute(:blank, :bool, :default => false)
20
+ define_attribute(:blank, :bool, :default => false)
22
21
  define_attribute(:calendarType, RubyXL::ST_CalendarType, :default => 'none')
23
22
  define_child_node(RubyXL::StringValue, :collection => true, :accessor => :filters, :node_name => :filter)
24
23
  define_child_node(RubyXL::DateGroupItem, :collection => true, :accessor => :date_group_items)
@@ -43,7 +42,7 @@ module RubyXL
43
42
 
44
43
  # http://www.datypic.com/sc/ooxml/e-ssml_customFilters-1.html
45
44
  class CustomFilters < OOXMLContainerObject
46
- define_attribute(:and, :bool, :default => false)
45
+ define_attribute(:and, :bool, :default => false)
47
46
  define_child_node(RubyXL::CustomFilter, :collection => true)
48
47
  define_element_name 'customFilters'
49
48
  end
@@ -87,9 +86,9 @@ module RubyXL
87
86
 
88
87
  # http://www.datypic.com/sc/ooxml/e-ssml_sortCondition-1.html
89
88
  class SortCondition < OOXMLObject
90
- define_attribute(:descending, :bool, :default => false)
89
+ define_attribute(:descending, :bool, :default => false)
91
90
  define_attribute(:sortBy, RubyXL::ST_SortBy, :default => 'value')
92
- define_attribute(:ref, :ref, :required => true)
91
+ define_attribute(:ref, :ref, :required => true)
93
92
  define_attribute(:customList, :string)
94
93
  define_attribute(:dxfId, :int)
95
94
  define_attribute(:iconSet, RubyXL::ST_IconSetType, :required => true, :default => '3Arrows')
@@ -116,5 +115,4 @@ module RubyXL
116
115
  define_child_node(RubyXL::ExtensionStorageArea)
117
116
  define_element_name 'autoFilter'
118
117
  end
119
-
120
- end
118
+ end
@@ -3,7 +3,6 @@ require 'rubyXL/objects/container_nodes'
3
3
  require 'rubyXL/objects/color'
4
4
 
5
5
  module RubyXL
6
-
7
6
  # http://www.datypic.com/sc/ooxml/e-ssml_font-1.html
8
7
  class Font < OOXMLObject
9
8
  # Since we have no capability to load the actual fonts, we'll have to live with the default.
@@ -21,14 +20,14 @@ module RubyXL
21
20
  define_child_node(RubyXL::BooleanValue, :node_name => :extend)
22
21
  define_child_node(RubyXL::Color)
23
22
  define_child_node(RubyXL::FloatValue, :node_name => :sz)
24
- define_child_node(RubyXL::BooleanValue, :node_name => :u)
23
+ define_child_node(RubyXL::StringValue, :node_name => :u) # ST_UnderlineValues (http://www.datypic.com/sc/ooxml/e-ssml_u-1.html)
25
24
  define_child_node(RubyXL::StringValue, :node_name => :vertAlign)
26
25
  define_child_node(RubyXL::StringValue, :node_name => :scheme)
27
26
  define_element_name 'font'
28
27
 
29
28
  def self.default(size = 10)
30
29
  self.new(:name => RubyXL::StringValue.new(:val => 'Verdana'),
31
- :sz => RubyXL::FloatValue.new(:val => size) )
30
+ :sz => RubyXL::FloatValue.new(:val => size))
32
31
  end
33
32
  end
34
33
 
@@ -41,5 +40,4 @@ module RubyXL
41
40
  self.new(:_ => [ RubyXL::Font.default(10), RubyXL::Font.default(8) ])
42
41
  end
43
42
  end
44
-
45
43
  end
@@ -2,12 +2,11 @@ require 'rubyXL/objects/ooxml_object'
2
2
  require 'rubyXL/objects/simple_types'
3
3
 
4
4
  module RubyXL
5
-
6
5
  # http://www.datypic.com/sc/ooxml/e-ssml_f-1.html
7
6
  class Formula < OOXMLObject
8
7
  define_attribute(:_, :string, :accessor => :expression)
9
8
  define_attribute(:t, RubyXL::ST_CellFormulaType, :default => 'normal')
10
- define_attribute(:aca, :bool, :default => false)
9
+ define_attribute(:aca, :bool, :default => false)
11
10
  define_attribute(:ref, :ref)
12
11
  define_attribute(:dt2D, :bool, :default => false)
13
12
  define_attribute(:dtr, :bool, :default => false)
@@ -15,10 +14,9 @@ module RubyXL
15
14
  define_attribute(:del2, :bool, :default => false)
16
15
  define_attribute(:r1, :ref)
17
16
  define_attribute(:r2, :ref)
18
- define_attribute(:ca, :bool, :default => false)
17
+ define_attribute(:ca, :bool, :default => false)
19
18
  define_attribute(:si, :int)
20
- define_attribute(:bx, :bool, :default => false)
19
+ define_attribute(:bx, :bool, :default => false)
21
20
  define_element_name 'f'
22
21
  end
23
-
24
22
  end
@@ -12,16 +12,16 @@ module RubyXL
12
12
  # addressing variable by name creates it in the context of defining class, while calling
13
13
  # the setter/getter method addresses it in the context of descendant class,
14
14
  # which is what we need.
15
- def obtain_class_variable(var_name, default = {})
15
+ def obtain_class_variable(var_name, default = nil)
16
16
  self.class_variable_get(var_name)
17
17
  rescue NameError
18
- self.class_variable_set(var_name, default)
18
+ self.class_variable_set(var_name, default || {})
19
19
  end
20
20
 
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>
@@ -45,14 +45,20 @@ module RubyXL
45
45
  # The value of the element will be accessible as a <tt>String</tt> by calling +obj.expression+
46
46
  # define_attribute(:errorStyle, %w{ stop warning information }, :default => 'stop',)
47
47
  # A <tt>String</tt> attribute named 'errorStyle' will be accessible as +obj.error_style+, valid values are <tt>"stop"</tt>, <tt>"warning"</tt>, <tt>"information"</tt>
48
- def define_attribute(attr_name, attr_type, extra_params = {})
48
+ def define_attribute(attr_name, attr_type, extra_params = nil)
49
49
  attrs = obtain_class_variable(:@@ooxml_attributes)
50
- attr_hash = extra_params.merge({ :attr_type => attr_type })
50
+ attr_hash = { :attr_type => attr_type }
51
+ attr_hash.merge!(extra_params) if extra_params
51
52
  attr_hash[:accessor] ||= accessorize(attr_name)
52
53
  attrs[attr_name.to_s] = attr_hash
53
54
  self.send(:attr_accessor, attr_hash[:accessor]) unless attr_hash[:computed]
54
55
  end
55
56
 
57
+ # Defines a `r:id` attribute
58
+ def define_relationship(extra_params = {})
59
+ define_attribute(:'r:id', :string, extra_params)
60
+ end
61
+
56
62
  # Defines a child node of OOXML object.
57
63
  # === Parameters
58
64
  # * +klass+ - Class (descendant of RubyXL::OOXMLObject) of the child nodes. Child node objects will be produced by calling +parse+ method of that class.
@@ -79,7 +85,7 @@ module RubyXL
79
85
  accessor = (extra_params[:accessor] || accessorize(child_node_name)).to_sym
80
86
 
81
87
  child_nodes[child_node_name] = {
82
- :class => klass,
88
+ :class => klass,
83
89
  :is_array => extra_params[:collection],
84
90
  :accessor => accessor
85
91
  }
@@ -117,7 +123,9 @@ module RubyXL
117
123
  end
118
124
 
119
125
  obj = self.new
120
- obj.local_namespaces = node.namespace_definitions
126
+ hsh = {}
127
+ node.namespace_definitions.each { |ns| hsh[ns.href] = ns.prefix }
128
+ obj.local_namespaces = hsh
121
129
 
122
130
  known_attributes = obtain_class_variable(:@@ooxml_attributes)
123
131
 
@@ -142,10 +150,10 @@ module RubyXL
142
150
  known_namespaces ||= obtain_class_variable(:@@ooxml_namespaces)
143
151
 
144
152
  node.element_children.each { |child_node|
145
-
146
153
  ns = child_node.namespace
147
- prefix = if known_namespaces.has_key?(ns.href) then known_namespaces[ns.href]
148
- else ns.prefix
154
+
155
+ prefix = if known_namespaces.has_key?(ns&.href) then known_namespaces[ns&.href]
156
+ else ns&.prefix
149
157
  end
150
158
 
151
159
  child_node_name = case prefix
@@ -180,21 +188,21 @@ module RubyXL
180
188
  private
181
189
  def accessorize(str)
182
190
  acc = str.to_s.dup
183
- acc.gsub!(/([A-Z\d]+)([A-Z][a-z])/,'\1_\2')
184
- acc.gsub!(/([a-z\d])([A-Z])/,'\1_\2')
185
- acc.gsub!(':','_')
191
+ acc.gsub!(/([A-Z\d]+)([A-Z][a-z])/, '\1_\2')
192
+ acc.gsub!(/([a-z\d])([A-Z])/, '\1_\2')
193
+ acc.gsub!(':', '_')
186
194
  acc.downcase.to_sym
187
195
  end
188
196
 
189
197
  def process_attribute(obj, raw_value, params)
190
198
  val = raw_value &&
191
199
  case params[:attr_type]
192
- when :double then Float(raw_value) # http://www.datypic.com/sc/xsd/t-xsd_double.html
200
+ when :double then Float(raw_value) # http://www.datypic.com/sc/xsd/t-xsd_double.html
193
201
  when :string then raw_value
194
202
  when Array then raw_value # Case of Simple Types
195
203
  when :sqref then RubyXL::Sqref.new(raw_value)
196
204
  when :ref then RubyXL::Reference.new(raw_value)
197
- when :bool then ['1', 'true'].include?(raw_value) # http://www.datypic.com/sc/xsd/t-xsd_boolean.html
205
+ when :bool then ['1', 'true'].include?(raw_value) # http://www.datypic.com/sc/xsd/t-xsd_boolean.html
198
206
  when :int then Integer(raw_value)
199
207
  when :uint then
200
208
  v = Integer(raw_value)
@@ -203,7 +211,6 @@ module RubyXL
203
211
  end
204
212
  obj.send("#{params[:accessor]}=", val)
205
213
  end
206
-
207
214
  end
208
215
 
209
216
 
@@ -219,8 +226,9 @@ module RubyXL
219
226
  end
220
227
  private :obtain_class_variable
221
228
 
222
- def initialize(params = {})
229
+ def initialize(params = nil)
223
230
  @local_namespaces = nil
231
+ params ||= {}
224
232
 
225
233
  obtain_class_variable(:@@ooxml_attributes).each_value { |v|
226
234
  instance_variable_set("@#{v[:accessor]}", params[v[:accessor]]) unless v[:computed]
@@ -231,7 +239,6 @@ module RubyXL
231
239
 
232
240
  def init_child_nodes(params)
233
241
  obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
234
-
235
242
  initial_value =
236
243
  if params.has_key?(v[:accessor]) then params[v[:accessor]]
237
244
  elsif v[:is_array] then []
@@ -250,8 +257,8 @@ module RubyXL
250
257
 
251
258
  def ==(other)
252
259
  other.is_a?(self.class) &&
253
- obtain_class_variable(:@@ooxml_attributes).all? { |k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } &&
254
- 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]) }
255
262
  end
256
263
 
257
264
  # Recursively write the OOXML object and all its children out as Nokogiri::XML. Immediately before the actual
@@ -308,12 +315,11 @@ module RubyXL
308
315
  element_text = attrs.delete('_')
309
316
  elem = xml.create_element(node_name_override || obtain_class_variable(:@@ooxml_tag_name), attrs, element_text)
310
317
 
311
- if @local_namespaces.nil? || @local_namespaces.empty? then # If no local namespaces provided in the original document,
312
- # use the defaults
313
- obtain_class_variable(:@@ooxml_namespaces).each_pair { |k, v| elem.add_namespace_definition(v, k) }
314
- else # otherwise preserve the original ones
315
- @local_namespaces.each { |ns| elem.add_namespace_definition(ns.prefix, ns.href) }
316
- 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) }
317
323
 
318
324
  child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
319
325
  child_nodes.each_pair { |child_node_name, child_node_params|
@@ -351,12 +357,11 @@ module RubyXL
351
357
  def before_write_xml
352
358
  #TODO# This will go away once containers are fully implemented.
353
359
  child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
354
- child_nodes.each_pair { |child_node_name, child_node_params|
360
+ child_nodes.each_pair { |_child_node_name, child_node_params|
355
361
  self.count = self.send(child_node_params[:accessor]).size if child_node_params[:is_array] == :with_count
356
362
  }
357
363
  true
358
364
  end
359
-
360
365
  end
361
366
 
362
367
  # Parent class for defining OOXML based objects (not unlike Rails' +ActiveRecord+!)
@@ -366,7 +371,7 @@ module RubyXL
366
371
  include OOXMLObjectInstanceMethods
367
372
  end
368
373
 
369
- # Parent class for OOXML conainer objects (for example,
374
+ # Parent class for OOXML container objects (for example,
370
375
  # <tt>&lt;fonts&gt;&lt;font&gt;...&lt;/font&gt;&lt;font&gt;...&lt;/font&gt;&lt;/fonts&gt;</tt>
371
376
  # that obscures the top-level container, allowing direct access to the contents as +Array+.
372
377
  class OOXMLContainerObject < Array
@@ -410,7 +415,6 @@ module RubyXL
410
415
  end
411
416
  protected :define_count_attribute
412
417
  end
413
-
414
418
  end
415
419
 
416
420
  # Extension class providing functionality for top-level OOXML objects that are represented by
@@ -461,7 +465,5 @@ module RubyXL
461
465
  def file_index
462
466
  root.rels_hash[self.class].index{ |f| f.equal?(self) }.to_i + 1
463
467
  end
464
-
465
468
  end
466
-
467
469
  end
@@ -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
 
@@ -62,8 +64,8 @@ module RubyXL
62
64
 
63
65
  # http://www.datypic.com/sc/ooxml/e-ssml_queryTable.html
64
66
  class QueryTable < OOXMLTopLevelObject
65
- CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml'
66
- REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable'
67
+ CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.queryTable+xml'.freeze
68
+ REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/queryTable'.freeze
67
69
 
68
70
  include RubyXL::RelationshipSupport
69
71
 
@@ -94,7 +96,7 @@ module RubyXL
94
96
  define_child_node(RubyXL::ExtensionStorageArea)
95
97
 
96
98
  define_element_name 'queryTable'
97
- set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
99
+ set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
98
100
  'http://schemas.openxmlformats.org/officeDocument/2006/relationships' => 'r')
99
101
 
100
102
  def xlsx_path