rubyXL 3.4.38 → 3.4.43

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