rubyXL 1.2.10 → 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 (518) hide show
  1. checksums.yaml +7 -0
  2. data/.circleci/config.yml +60 -0
  3. data/.codeclimate.yml +3 -0
  4. data/.rubocop.yml +124 -0
  5. data/CHANGELOG.md +12 -0
  6. data/Gemfile +18 -14
  7. data/LICENSE.txt +1 -1
  8. data/README.rdoc +170 -100
  9. data/Rakefile +76 -26
  10. data/VERSION +1 -1
  11. data/lib/rubyXL/cell.rb +13 -447
  12. data/lib/rubyXL/convenience_methods/cell.rb +276 -0
  13. data/lib/rubyXL/convenience_methods/color.rb +156 -0
  14. data/lib/rubyXL/convenience_methods/font.rb +63 -0
  15. data/lib/rubyXL/convenience_methods/workbook.rb +137 -0
  16. data/lib/rubyXL/convenience_methods/worksheet.rb +734 -0
  17. data/lib/rubyXL/convenience_methods.rb +5 -0
  18. data/lib/rubyXL/objects/border.rb +71 -0
  19. data/lib/rubyXL/objects/calculation_chain.rb +31 -0
  20. data/lib/rubyXL/objects/cell_style.rb +63 -0
  21. data/lib/rubyXL/objects/chartsheet.rb +88 -0
  22. data/lib/rubyXL/objects/color.rb +25 -0
  23. data/lib/rubyXL/objects/column_range.rb +93 -0
  24. data/lib/rubyXL/objects/comments.rb +44 -0
  25. data/lib/rubyXL/objects/connection.rb +175 -0
  26. data/lib/rubyXL/objects/container_nodes.rb +131 -0
  27. data/lib/rubyXL/objects/content_types.rb +74 -0
  28. data/lib/rubyXL/objects/data_validation.rb +37 -0
  29. data/lib/rubyXL/objects/document_properties.rb +156 -0
  30. data/lib/rubyXL/objects/extensions.rb +51 -0
  31. data/lib/rubyXL/objects/external_links.rb +115 -0
  32. data/lib/rubyXL/objects/fill.rb +52 -0
  33. data/lib/rubyXL/objects/filters.rb +118 -0
  34. data/lib/rubyXL/objects/font.rb +43 -0
  35. data/lib/rubyXL/objects/formula.rb +22 -0
  36. data/lib/rubyXL/objects/ooxml_object.rb +469 -0
  37. data/lib/rubyXL/objects/query_table.rb +106 -0
  38. data/lib/rubyXL/objects/reference.rb +119 -0
  39. data/lib/rubyXL/objects/relationships.rb +213 -0
  40. data/lib/rubyXL/objects/root.rb +84 -0
  41. data/lib/rubyXL/objects/shared_strings.rb +67 -0
  42. data/lib/rubyXL/objects/sheet_common.rb +49 -0
  43. data/lib/rubyXL/objects/sheet_data.rb +219 -0
  44. data/lib/rubyXL/objects/simple_types.rb +249 -0
  45. data/lib/rubyXL/objects/storage.rb +193 -0
  46. data/lib/rubyXL/objects/stylesheet.rb +224 -0
  47. data/lib/rubyXL/objects/text.rb +92 -0
  48. data/lib/rubyXL/objects/theme.rb +1730 -0
  49. data/lib/rubyXL/objects/workbook.rb +572 -0
  50. data/lib/rubyXL/objects/worksheet.rb +762 -0
  51. data/lib/rubyXL/parser.rb +18 -459
  52. data/lib/rubyXL/worksheet.rb +73 -1461
  53. data/lib/rubyXL.rb +9 -7
  54. data/rdoc/README_rdoc.html +534 -0
  55. data/rdoc/RubyXL/AExtension.html +187 -0
  56. data/rdoc/RubyXL/AExtensionStorageArea.html +97 -0
  57. data/rdoc/RubyXL/ActiveX.html +156 -0
  58. data/rdoc/RubyXL/ActiveXBinary.html +106 -0
  59. data/rdoc/RubyXL/AdjustHandleList.html +99 -0
  60. data/rdoc/RubyXL/Alignment.html +99 -0
  61. data/rdoc/RubyXL/AlternateContent.html +97 -0
  62. data/rdoc/RubyXL/AlternateUrls.html +99 -0
  63. data/rdoc/RubyXL/Authors.html +99 -0
  64. data/rdoc/RubyXL/AutoFilter.html +99 -0
  65. data/rdoc/RubyXL/AutoFilterColumn.html +99 -0
  66. data/rdoc/RubyXL/BinaryImageFile.html +108 -0
  67. data/rdoc/RubyXL/BodyProperties.html +99 -0
  68. data/rdoc/RubyXL/BooleanNode.html +97 -0
  69. data/rdoc/RubyXL/BooleanValue.html +97 -0
  70. data/rdoc/RubyXL/Border.html +223 -0
  71. data/rdoc/RubyXL/BorderEdge.html +160 -0
  72. data/rdoc/RubyXL/Borders.html +138 -0
  73. data/rdoc/RubyXL/Break.html +99 -0
  74. data/rdoc/RubyXL/BreakList.html +99 -0
  75. data/rdoc/RubyXL/CT_AdjPoint2D.html +99 -0
  76. data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +99 -0
  77. data/rdoc/RubyXL/CT_AlphaModulateEffect.html +99 -0
  78. data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +99 -0
  79. data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +99 -0
  80. data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +99 -0
  81. data/rdoc/RubyXL/CT_Backdrop.html +99 -0
  82. data/rdoc/RubyXL/CT_Bevel.html +99 -0
  83. data/rdoc/RubyXL/CT_BiLevelEffect.html +99 -0
  84. data/rdoc/RubyXL/CT_BlendEffect.html +99 -0
  85. data/rdoc/RubyXL/CT_Blip.html +99 -0
  86. data/rdoc/RubyXL/CT_BlipFillProperties.html +99 -0
  87. data/rdoc/RubyXL/CT_BlurEffect.html +99 -0
  88. data/rdoc/RubyXL/CT_Camera.html +99 -0
  89. data/rdoc/RubyXL/CT_Color.html +99 -0
  90. data/rdoc/RubyXL/CT_ColorChangeEffect.html +99 -0
  91. data/rdoc/RubyXL/CT_ColorMapping.html +99 -0
  92. data/rdoc/RubyXL/CT_ColorScheme.html +99 -0
  93. data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +99 -0
  94. data/rdoc/RubyXL/CT_ConnectionSite.html +99 -0
  95. data/rdoc/RubyXL/CT_ConnectionSiteList.html +99 -0
  96. data/rdoc/RubyXL/CT_DashStop.html +99 -0
  97. data/rdoc/RubyXL/CT_DashStopList.html +99 -0
  98. data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +99 -0
  99. data/rdoc/RubyXL/CT_DuotoneEffect.html +99 -0
  100. data/rdoc/RubyXL/CT_EffectContainer.html +99 -0
  101. data/rdoc/RubyXL/CT_EffectList.html +99 -0
  102. data/rdoc/RubyXL/CT_EffectReference.html +99 -0
  103. data/rdoc/RubyXL/CT_EffectStyleItem.html +99 -0
  104. data/rdoc/RubyXL/CT_EffectStyleList.html +99 -0
  105. data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +99 -0
  106. data/rdoc/RubyXL/CT_FillEffect.html +99 -0
  107. data/rdoc/RubyXL/CT_FillOverlayEffect.html +99 -0
  108. data/rdoc/RubyXL/CT_FillStyleList.html +99 -0
  109. data/rdoc/RubyXL/CT_FlatText.html +99 -0
  110. data/rdoc/RubyXL/CT_FontCollection.html +99 -0
  111. data/rdoc/RubyXL/CT_FontReference.html +99 -0
  112. data/rdoc/RubyXL/CT_GeomGuideList.html +99 -0
  113. data/rdoc/RubyXL/CT_GlowEffect.html +99 -0
  114. data/rdoc/RubyXL/CT_GradientFillProperties.html +99 -0
  115. data/rdoc/RubyXL/CT_GradientStop.html +99 -0
  116. data/rdoc/RubyXL/CT_GradientStopList.html +99 -0
  117. data/rdoc/RubyXL/CT_HSLEffect.html +99 -0
  118. data/rdoc/RubyXL/CT_HslColor.html +99 -0
  119. data/rdoc/RubyXL/CT_Hyperlink.html +99 -0
  120. data/rdoc/RubyXL/CT_InnerShadowEffect.html +99 -0
  121. data/rdoc/RubyXL/CT_LightRig.html +99 -0
  122. data/rdoc/RubyXL/CT_LineEndProperties.html +99 -0
  123. data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +99 -0
  124. data/rdoc/RubyXL/CT_LineProperties.html +99 -0
  125. data/rdoc/RubyXL/CT_LineStyleList.html +99 -0
  126. data/rdoc/RubyXL/CT_LinearShadeProperties.html +99 -0
  127. data/rdoc/RubyXL/CT_LuminanceEffect.html +99 -0
  128. data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +99 -0
  129. data/rdoc/RubyXL/CT_OuterShadowEffect.html +99 -0
  130. data/rdoc/RubyXL/CT_Path2D.html +99 -0
  131. data/rdoc/RubyXL/CT_Path2DArcTo.html +99 -0
  132. data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +99 -0
  133. data/rdoc/RubyXL/CT_Path2DList.html +99 -0
  134. data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +99 -0
  135. data/rdoc/RubyXL/CT_Path2DTo.html +99 -0
  136. data/rdoc/RubyXL/CT_PathShadeProperties.html +99 -0
  137. data/rdoc/RubyXL/CT_PatternFillProperties.html +99 -0
  138. data/rdoc/RubyXL/CT_Point3D.html +99 -0
  139. data/rdoc/RubyXL/CT_PolarAdjustHandle.html +99 -0
  140. data/rdoc/RubyXL/CT_PresetColor.html +99 -0
  141. data/rdoc/RubyXL/CT_PresetLineDashProperties.html +99 -0
  142. data/rdoc/RubyXL/CT_PresetShadowEffect.html +99 -0
  143. data/rdoc/RubyXL/CT_PresetTextShape.html +99 -0
  144. data/rdoc/RubyXL/CT_ReflectionEffect.html +99 -0
  145. data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +99 -0
  146. data/rdoc/RubyXL/CT_RelativeRect.html +99 -0
  147. data/rdoc/RubyXL/CT_SRgbColor.html +99 -0
  148. data/rdoc/RubyXL/CT_ScRgbColor.html +99 -0
  149. data/rdoc/RubyXL/CT_Scene3D.html +99 -0
  150. data/rdoc/RubyXL/CT_SchemeColor.html +99 -0
  151. data/rdoc/RubyXL/CT_Shape3D.html +99 -0
  152. data/rdoc/RubyXL/CT_ShapeStyle.html +99 -0
  153. data/rdoc/RubyXL/CT_SoftEdgesEffect.html +99 -0
  154. data/rdoc/RubyXL/CT_SphereCoords.html +99 -0
  155. data/rdoc/RubyXL/CT_StretchInfoProperties.html +99 -0
  156. data/rdoc/RubyXL/CT_StyleMatrix.html +99 -0
  157. data/rdoc/RubyXL/CT_StyleMatrixReference.html +99 -0
  158. data/rdoc/RubyXL/CT_SupplementalFont.html +99 -0
  159. data/rdoc/RubyXL/CT_SystemColor.html +99 -0
  160. data/rdoc/RubyXL/CT_TextAutonumberBullet.html +99 -0
  161. data/rdoc/RubyXL/CT_TextBlipBullet.html +99 -0
  162. data/rdoc/RubyXL/CT_TextCharBullet.html +99 -0
  163. data/rdoc/RubyXL/CT_TextCharacterProperties.html +99 -0
  164. data/rdoc/RubyXL/CT_TextFont.html +99 -0
  165. data/rdoc/RubyXL/CT_TextListStyle.html +99 -0
  166. data/rdoc/RubyXL/CT_TextNormalAutofit.html +99 -0
  167. data/rdoc/RubyXL/CT_TextParagraphProperties.html +99 -0
  168. data/rdoc/RubyXL/CT_TextSpacing.html +99 -0
  169. data/rdoc/RubyXL/CT_TextTabStop.html +99 -0
  170. data/rdoc/RubyXL/CT_TextTabStopList.html +99 -0
  171. data/rdoc/RubyXL/CT_TileInfoProperties.html +99 -0
  172. data/rdoc/RubyXL/CT_TintEffect.html +99 -0
  173. data/rdoc/RubyXL/CT_Transform2D.html +99 -0
  174. data/rdoc/RubyXL/CT_TransformEffect.html +99 -0
  175. data/rdoc/RubyXL/CT_Vector3D.html +99 -0
  176. data/rdoc/RubyXL/CT_XYAdjustHandle.html +99 -0
  177. data/rdoc/RubyXL/CalculationChain.html +149 -0
  178. data/rdoc/RubyXL/CalculationChainCell.html +99 -0
  179. data/rdoc/RubyXL/CalculationProperties.html +99 -0
  180. data/rdoc/RubyXL/Cell.html +510 -0
  181. data/rdoc/RubyXL/CellConvenienceMethods.html +1077 -0
  182. data/rdoc/RubyXL/CellExt.html +99 -0
  183. data/rdoc/RubyXL/CellSmartTag.html +99 -0
  184. data/rdoc/RubyXL/CellSmartTagProperty.html +99 -0
  185. data/rdoc/RubyXL/CellSmartTags.html +99 -0
  186. data/rdoc/RubyXL/CellStyle.html +99 -0
  187. data/rdoc/RubyXL/CellStyleXFs.html +138 -0
  188. data/rdoc/RubyXL/CellStyles.html +138 -0
  189. data/rdoc/RubyXL/CellValue.html +139 -0
  190. data/rdoc/RubyXL/CellWatch.html +99 -0
  191. data/rdoc/RubyXL/CellWatches.html +99 -0
  192. data/rdoc/RubyXL/CellXFs.html +139 -0
  193. data/rdoc/RubyXL/ChartColorsFile.html +108 -0
  194. data/rdoc/RubyXL/ChartFile.html +160 -0
  195. data/rdoc/RubyXL/ChartStyleFile.html +108 -0
  196. data/rdoc/RubyXL/ChartUserShapesFile.html +108 -0
  197. data/rdoc/RubyXL/Chartsheet.html +213 -0
  198. data/rdoc/RubyXL/ChartsheetPageSetup.html +99 -0
  199. data/rdoc/RubyXL/ChartsheetProperties.html +99 -0
  200. data/rdoc/RubyXL/ChartsheetProtection.html +99 -0
  201. data/rdoc/RubyXL/ChartsheetView.html +99 -0
  202. data/rdoc/RubyXL/ChartsheetViews.html +99 -0
  203. data/rdoc/RubyXL/Color.html +151 -0
  204. data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +246 -0
  205. data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +285 -0
  206. data/rdoc/RubyXL/ColorConvenienceClasses.html +91 -0
  207. data/rdoc/RubyXL/ColorConvenienceMethods.html +139 -0
  208. data/rdoc/RubyXL/ColorFilter.html +99 -0
  209. data/rdoc/RubyXL/ColorScale.html +99 -0
  210. data/rdoc/RubyXL/ColorSet.html +99 -0
  211. data/rdoc/RubyXL/Colors.html +99 -0
  212. data/rdoc/RubyXL/ColumnRange.html +230 -0
  213. data/rdoc/RubyXL/ColumnRanges.html +237 -0
  214. data/rdoc/RubyXL/Comment.html +99 -0
  215. data/rdoc/RubyXL/CommentList.html +99 -0
  216. data/rdoc/RubyXL/CommentsFile.html +165 -0
  217. data/rdoc/RubyXL/ConditionalFormatValue.html +99 -0
  218. data/rdoc/RubyXL/ConditionalFormatting.html +99 -0
  219. data/rdoc/RubyXL/ConditionalFormattingRule.html +99 -0
  220. data/rdoc/RubyXL/Connection.html +99 -0
  221. data/rdoc/RubyXL/ConnectionTable.html +99 -0
  222. data/rdoc/RubyXL/ConnectionTables.html +99 -0
  223. data/rdoc/RubyXL/ConnectionTextField.html +99 -0
  224. data/rdoc/RubyXL/ConnectionTextFields.html +99 -0
  225. data/rdoc/RubyXL/Connections.html +149 -0
  226. data/rdoc/RubyXL/ContentTypeDefault.html +97 -0
  227. data/rdoc/RubyXL/ContentTypeOverride.html +97 -0
  228. data/rdoc/RubyXL/ContentTypes.html +211 -0
  229. data/rdoc/RubyXL/ControlPropertiesFile.html +108 -0
  230. data/rdoc/RubyXL/CorePropertiesFile.html +355 -0
  231. data/rdoc/RubyXL/CustomColor.html +99 -0
  232. data/rdoc/RubyXL/CustomColorList.html +99 -0
  233. data/rdoc/RubyXL/CustomFilter.html +99 -0
  234. data/rdoc/RubyXL/CustomFilters.html +99 -0
  235. data/rdoc/RubyXL/CustomGeometry.html +99 -0
  236. data/rdoc/RubyXL/CustomProperties.html +99 -0
  237. data/rdoc/RubyXL/CustomPropertiesFile.html +108 -0
  238. data/rdoc/RubyXL/CustomProperty.html +99 -0
  239. data/rdoc/RubyXL/CustomPropertyFile.html +108 -0
  240. data/rdoc/RubyXL/CustomSheetView.html +99 -0
  241. data/rdoc/RubyXL/CustomSheetViews.html +99 -0
  242. data/rdoc/RubyXL/CustomWorkbookView.html +99 -0
  243. data/rdoc/RubyXL/CustomWorkbookViews.html +99 -0
  244. data/rdoc/RubyXL/CustomXMLFile.html +106 -0
  245. data/rdoc/RubyXL/DXF.html +99 -0
  246. data/rdoc/RubyXL/DXFs.html +99 -0
  247. data/rdoc/RubyXL/DataBar.html +99 -0
  248. data/rdoc/RubyXL/DataConsolidate.html +99 -0
  249. data/rdoc/RubyXL/DataConsolidationReference.html +99 -0
  250. data/rdoc/RubyXL/DataConsolidationReferences.html +99 -0
  251. data/rdoc/RubyXL/DataType.html +114 -0
  252. data/rdoc/RubyXL/DataValidation.html +99 -0
  253. data/rdoc/RubyXL/DataValidations.html +99 -0
  254. data/rdoc/RubyXL/DateGroupItem.html +99 -0
  255. data/rdoc/RubyXL/DefinedName.html +99 -0
  256. data/rdoc/RubyXL/DefinedNameExt.html +99 -0
  257. data/rdoc/RubyXL/DefinedNames.html +99 -0
  258. data/rdoc/RubyXL/DefinedNamesExt.html +99 -0
  259. data/rdoc/RubyXL/DocumentPropertiesFile.html +213 -0
  260. data/rdoc/RubyXL/DrawingFile.html +159 -0
  261. data/rdoc/RubyXL/DynamicFilter.html +99 -0
  262. data/rdoc/RubyXL/EmbeddedControl.html +99 -0
  263. data/rdoc/RubyXL/EmbeddedControls.html +99 -0
  264. data/rdoc/RubyXL/Extension.html +99 -0
  265. data/rdoc/RubyXL/ExtensionStorageArea.html +99 -0
  266. data/rdoc/RubyXL/Extents.html +99 -0
  267. data/rdoc/RubyXL/ExternalBook.html +99 -0
  268. data/rdoc/RubyXL/ExternalLinksFile.html +155 -0
  269. data/rdoc/RubyXL/ExternalReference.html +99 -0
  270. data/rdoc/RubyXL/ExternalReferences.html +99 -0
  271. data/rdoc/RubyXL/ExtraColorSchemeList.html +99 -0
  272. data/rdoc/RubyXL/FieldItem.html +99 -0
  273. data/rdoc/RubyXL/FileRecoveryProperties.html +99 -0
  274. data/rdoc/RubyXL/FileSharing.html +99 -0
  275. data/rdoc/RubyXL/FileVersion.html +99 -0
  276. data/rdoc/RubyXL/Fill.html +138 -0
  277. data/rdoc/RubyXL/Fills.html +138 -0
  278. data/rdoc/RubyXL/FilterContainer.html +99 -0
  279. data/rdoc/RubyXL/FloatNode.html +97 -0
  280. data/rdoc/RubyXL/FloatValue.html +97 -0
  281. data/rdoc/RubyXL/Font.html +148 -0
  282. data/rdoc/RubyXL/FontConvenienceMethods.html +442 -0
  283. data/rdoc/RubyXL/FontScheme.html +99 -0
  284. data/rdoc/RubyXL/Fonts.html +138 -0
  285. data/rdoc/RubyXL/Formula.html +99 -0
  286. data/rdoc/RubyXL/FunctionGroup.html +99 -0
  287. data/rdoc/RubyXL/FunctionGroups.html +99 -0
  288. data/rdoc/RubyXL/GenericStorageObject.html +241 -0
  289. data/rdoc/RubyXL/GradientFill.html +99 -0
  290. data/rdoc/RubyXL/HeaderFooterSettings.html +99 -0
  291. data/rdoc/RubyXL/Hyperlink.html +99 -0
  292. data/rdoc/RubyXL/HyperlinkRelFile.html +106 -0
  293. data/rdoc/RubyXL/Hyperlinks.html +99 -0
  294. data/rdoc/RubyXL/IconFilter.html +99 -0
  295. data/rdoc/RubyXL/IconSet.html +99 -0
  296. data/rdoc/RubyXL/IgnoredError.html +99 -0
  297. data/rdoc/RubyXL/IgnoredErrors.html +99 -0
  298. data/rdoc/RubyXL/IndexedColors.html +99 -0
  299. data/rdoc/RubyXL/InputCells.html +99 -0
  300. data/rdoc/RubyXL/IntegerNode.html +97 -0
  301. data/rdoc/RubyXL/IntegerValue.html +97 -0
  302. data/rdoc/RubyXL/LegacyCell.html +130 -0
  303. data/rdoc/RubyXL/LegacyWorksheet.html +306 -0
  304. data/rdoc/RubyXL/MRUColors.html +99 -0
  305. data/rdoc/RubyXL/MacrosFile.html +108 -0
  306. data/rdoc/RubyXL/MergedCell.html +99 -0
  307. data/rdoc/RubyXL/MergedCells.html +99 -0
  308. data/rdoc/RubyXL/NumFmt.html +99 -0
  309. data/rdoc/RubyXL/NumberFormat.html +139 -0
  310. data/rdoc/RubyXL/NumberFormats.html +147 -0
  311. data/rdoc/RubyXL/OLEObject.html +99 -0
  312. data/rdoc/RubyXL/OLEObjectFile.html +108 -0
  313. data/rdoc/RubyXL/OLEObjects.html +99 -0
  314. data/rdoc/RubyXL/OLESize.html +99 -0
  315. data/rdoc/RubyXL/OOXMLContainerObject.html +309 -0
  316. data/rdoc/RubyXL/OOXMLIgnored.html +167 -0
  317. data/rdoc/RubyXL/OOXMLObject.html +107 -0
  318. data/rdoc/RubyXL/OOXMLObjectClassMethods.html +455 -0
  319. data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +442 -0
  320. data/rdoc/RubyXL/OOXMLRelationshipsFile.html +470 -0
  321. data/rdoc/RubyXL/OOXMLTopLevelObject.html +297 -0
  322. data/rdoc/RubyXL/OdbcOleDbProperties.html +99 -0
  323. data/rdoc/RubyXL/Offset.html +99 -0
  324. data/rdoc/RubyXL/OlapProperties.html +99 -0
  325. data/rdoc/RubyXL/OleItem.html +99 -0
  326. data/rdoc/RubyXL/OleItems.html +99 -0
  327. data/rdoc/RubyXL/OleLink.html +99 -0
  328. data/rdoc/RubyXL/OutlineProperties.html +99 -0
  329. data/rdoc/RubyXL/PageMargins.html +99 -0
  330. data/rdoc/RubyXL/PageSetup.html +99 -0
  331. data/rdoc/RubyXL/PageSetupProperties.html +99 -0
  332. data/rdoc/RubyXL/Pane.html +99 -0
  333. data/rdoc/RubyXL/Parser.html +174 -0
  334. data/rdoc/RubyXL/PatternFill.html +99 -0
  335. data/rdoc/RubyXL/PersonMetadata.html +108 -0
  336. data/rdoc/RubyXL/PhoneticProperties.html +99 -0
  337. data/rdoc/RubyXL/PhoneticRun.html +99 -0
  338. data/rdoc/RubyXL/PivotArea.html +99 -0
  339. data/rdoc/RubyXL/PivotCache.html +99 -0
  340. data/rdoc/RubyXL/PivotCacheDefinitionFile.html +116 -0
  341. data/rdoc/RubyXL/PivotCacheRecordsFile.html +108 -0
  342. data/rdoc/RubyXL/PivotCaches.html +99 -0
  343. data/rdoc/RubyXL/PivotReference.html +99 -0
  344. data/rdoc/RubyXL/PivotReferences.html +99 -0
  345. data/rdoc/RubyXL/PivotTableFile.html +116 -0
  346. data/rdoc/RubyXL/PivotTableSelection.html +99 -0
  347. data/rdoc/RubyXL/PresetGeometry.html +99 -0
  348. data/rdoc/RubyXL/PrintOptions.html +99 -0
  349. data/rdoc/RubyXL/PrinterSettingsFile.html +108 -0
  350. data/rdoc/RubyXL/ProtectedRange.html +99 -0
  351. data/rdoc/RubyXL/ProtectedRanges.html +99 -0
  352. data/rdoc/RubyXL/Protection.html +99 -0
  353. data/rdoc/RubyXL/QueryParameter.html +99 -0
  354. data/rdoc/RubyXL/QueryParameters.html +99 -0
  355. data/rdoc/RubyXL/QueryTable.html +157 -0
  356. data/rdoc/RubyXL/QueryTableDeletedField.html +99 -0
  357. data/rdoc/RubyXL/QueryTableDeletedFields.html +99 -0
  358. data/rdoc/RubyXL/QueryTableField.html +99 -0
  359. data/rdoc/RubyXL/QueryTableFields.html +99 -0
  360. data/rdoc/RubyXL/QueryTableRefresh.html +99 -0
  361. data/rdoc/RubyXL/RID.html +97 -0
  362. data/rdoc/RubyXL/RawOOXML.html +187 -0
  363. data/rdoc/RubyXL/Reference.html +510 -0
  364. data/rdoc/RubyXL/Relationship.html +97 -0
  365. data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +131 -0
  366. data/rdoc/RubyXL/RelationshipSupport.html +336 -0
  367. data/rdoc/RubyXL/RevisionPointer.html +99 -0
  368. data/rdoc/RubyXL/RichText.html +141 -0
  369. data/rdoc/RubyXL/RichTextRun.html +138 -0
  370. data/rdoc/RubyXL/Row.html +357 -0
  371. data/rdoc/RubyXL/RowExt.html +99 -0
  372. data/rdoc/RubyXL/RunProperties.html +99 -0
  373. data/rdoc/RubyXL/Scenario.html +99 -0
  374. data/rdoc/RubyXL/Scenarios.html +99 -0
  375. data/rdoc/RubyXL/Selection.html +146 -0
  376. data/rdoc/RubyXL/ShapeGuide.html +99 -0
  377. data/rdoc/RubyXL/ShapeTextRectangle.html +99 -0
  378. data/rdoc/RubyXL/SharedStringsTable.html +328 -0
  379. data/rdoc/RubyXL/Sheet.html +99 -0
  380. data/rdoc/RubyXL/SheetCalculationProperties.html +99 -0
  381. data/rdoc/RubyXL/SheetData.html +162 -0
  382. data/rdoc/RubyXL/SheetDataExt.html +99 -0
  383. data/rdoc/RubyXL/SheetDataSet.html +99 -0
  384. data/rdoc/RubyXL/SheetMetadata.html +108 -0
  385. data/rdoc/RubyXL/SheetName.html +99 -0
  386. data/rdoc/RubyXL/SheetNames.html +99 -0
  387. data/rdoc/RubyXL/Sheets.html +99 -0
  388. data/rdoc/RubyXL/SlicerCacheFile.html +108 -0
  389. data/rdoc/RubyXL/SlicerFile.html +108 -0
  390. data/rdoc/RubyXL/SmartTagProperties.html +99 -0
  391. data/rdoc/RubyXL/SmartTagType.html +99 -0
  392. data/rdoc/RubyXL/SmartTagTypes.html +99 -0
  393. data/rdoc/RubyXL/SmartTags.html +99 -0
  394. data/rdoc/RubyXL/SortCondition.html +99 -0
  395. data/rdoc/RubyXL/SortState.html +99 -0
  396. data/rdoc/RubyXL/Sqref.html +167 -0
  397. data/rdoc/RubyXL/Stop.html +99 -0
  398. data/rdoc/RubyXL/StringNode.html +97 -0
  399. data/rdoc/RubyXL/StringNodeW3C.html +167 -0
  400. data/rdoc/RubyXL/StringValue.html +97 -0
  401. data/rdoc/RubyXL/Stylesheet.html +281 -0
  402. data/rdoc/RubyXL/TableFile.html +108 -0
  403. data/rdoc/RubyXL/TableParts.html +97 -0
  404. data/rdoc/RubyXL/TableStyle.html +99 -0
  405. data/rdoc/RubyXL/TableStyles.html +99 -0
  406. data/rdoc/RubyXL/Text.html +175 -0
  407. data/rdoc/RubyXL/TextImportSettings.html +99 -0
  408. data/rdoc/RubyXL/Theme.html +535 -0
  409. data/rdoc/RubyXL/ThemeElements.html +99 -0
  410. data/rdoc/RubyXL/ThumbnailFile.html +108 -0
  411. data/rdoc/RubyXL/Top10.html +99 -0
  412. data/rdoc/RubyXL/VMLDrawingFile.html +116 -0
  413. data/rdoc/RubyXL/Variant.html +99 -0
  414. data/rdoc/RubyXL/Vector.html +142 -0
  415. data/rdoc/RubyXL/VectorValue.html +97 -0
  416. data/rdoc/RubyXL/VisualProperties.html +99 -0
  417. data/rdoc/RubyXL/WebPublishObject.html +99 -0
  418. data/rdoc/RubyXL/WebPublishObjects.html +99 -0
  419. data/rdoc/RubyXL/WebPublishingItem.html +99 -0
  420. data/rdoc/RubyXL/WebPublishingItems.html +99 -0
  421. data/rdoc/RubyXL/WebPublishingProperties.html +99 -0
  422. data/rdoc/RubyXL/WebQueryProperties.html +99 -0
  423. data/rdoc/RubyXL/Workbook.html +948 -0
  424. data/rdoc/RubyXL/WorkbookConvenienceMethods.html +596 -0
  425. data/rdoc/RubyXL/WorkbookProperties.html +99 -0
  426. data/rdoc/RubyXL/WorkbookProtection.html +99 -0
  427. data/rdoc/RubyXL/WorkbookRoot.html +325 -0
  428. data/rdoc/RubyXL/WorkbookView.html +99 -0
  429. data/rdoc/RubyXL/WorkbookViews.html +99 -0
  430. data/rdoc/RubyXL/Worksheet.html +418 -0
  431. data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2205 -0
  432. data/rdoc/RubyXL/WorksheetDimensions.html +99 -0
  433. data/rdoc/RubyXL/WorksheetFormatProperties.html +97 -0
  434. data/rdoc/RubyXL/WorksheetProperties.html +99 -0
  435. data/rdoc/RubyXL/WorksheetProtection.html +99 -0
  436. data/rdoc/RubyXL/WorksheetView.html +99 -0
  437. data/rdoc/RubyXL/WorksheetViews.html +99 -0
  438. data/rdoc/RubyXL/XF.html +99 -0
  439. data/rdoc/RubyXL.html +338 -0
  440. data/rdoc/created.rid +45 -0
  441. data/rdoc/css/fonts.css +167 -0
  442. data/rdoc/css/rdoc.css +687 -0
  443. data/rdoc/fonts/Lato-Light.ttf +0 -0
  444. data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
  445. data/rdoc/fonts/Lato-Regular.ttf +0 -0
  446. data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
  447. data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
  448. data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
  449. data/rdoc/images/add.png +0 -0
  450. data/rdoc/images/arrow_up.png +0 -0
  451. data/rdoc/images/brick.png +0 -0
  452. data/rdoc/images/brick_link.png +0 -0
  453. data/rdoc/images/bug.png +0 -0
  454. data/rdoc/images/bullet_black.png +0 -0
  455. data/rdoc/images/bullet_toggle_minus.png +0 -0
  456. data/rdoc/images/bullet_toggle_plus.png +0 -0
  457. data/rdoc/images/date.png +0 -0
  458. data/rdoc/images/delete.png +0 -0
  459. data/rdoc/images/find.png +0 -0
  460. data/rdoc/images/loadingAnimation.gif +0 -0
  461. data/rdoc/images/macFFBgHack.png +0 -0
  462. data/rdoc/images/package.png +0 -0
  463. data/rdoc/images/page_green.png +0 -0
  464. data/rdoc/images/page_white_text.png +0 -0
  465. data/rdoc/images/page_white_width.png +0 -0
  466. data/rdoc/images/plugin.png +0 -0
  467. data/rdoc/images/ruby.png +0 -0
  468. data/rdoc/images/tag_blue.png +0 -0
  469. data/rdoc/images/tag_green.png +0 -0
  470. data/rdoc/images/transparent.png +0 -0
  471. data/rdoc/images/wrench.png +0 -0
  472. data/rdoc/images/wrench_orange.png +0 -0
  473. data/rdoc/images/zoom.png +0 -0
  474. data/rdoc/index.html +477 -0
  475. data/rdoc/js/darkfish.js +97 -0
  476. data/rdoc/js/navigation.js +105 -0
  477. data/rdoc/js/navigation.js.gz +0 -0
  478. data/rdoc/js/search.js +110 -0
  479. data/rdoc/js/search_index.js +1 -0
  480. data/rdoc/js/search_index.js.gz +0 -0
  481. data/rdoc/js/searcher.js +229 -0
  482. data/rdoc/js/searcher.js.gz +0 -0
  483. data/rdoc/table_of_contents.html +3021 -0
  484. data/rubyXL.gemspec +521 -60
  485. data/spec/lib/cell_spec.rb +386 -143
  486. data/spec/lib/color_spec.rb +11 -4
  487. data/spec/lib/parser_spec.rb +90 -38
  488. data/spec/lib/reference_spec.rb +64 -0
  489. data/spec/lib/rgb_color_spec.rb +29 -0
  490. data/spec/lib/stylesheet_spec.rb +27 -0
  491. data/spec/lib/text_spec.rb +27 -0
  492. data/spec/lib/workbook_spec.rb +168 -22
  493. data/spec/lib/worksheet_spec.rb +1207 -1220
  494. data/spec/spec_helper.rb +13 -0
  495. data/test/input/.gitkeep +0 -0
  496. data/test/output/.gitkeep +0 -0
  497. data/test/test_parse_write.rb +15 -0
  498. data/tmp/.gitignore +1 -0
  499. metadata +634 -168
  500. data/Gemfile.lock +0 -34
  501. data/lib/.DS_Store +0 -0
  502. data/lib/rubyXL/Hash.rb +0 -60
  503. data/lib/rubyXL/color.rb +0 -14
  504. data/lib/rubyXL/private_class.rb +0 -265
  505. data/lib/rubyXL/workbook.rb +0 -450
  506. data/lib/rubyXL/writer/app_writer.rb +0 -62
  507. data/lib/rubyXL/writer/calc_chain_writer.rb +0 -33
  508. data/lib/rubyXL/writer/content_types_writer.rb +0 -77
  509. data/lib/rubyXL/writer/core_writer.rb +0 -51
  510. data/lib/rubyXL/writer/root_rels_writer.rb +0 -25
  511. data/lib/rubyXL/writer/shared_strings_writer.rb +0 -30
  512. data/lib/rubyXL/writer/styles_writer.rb +0 -407
  513. data/lib/rubyXL/writer/theme_writer.rb +0 -343
  514. data/lib/rubyXL/writer/workbook_rels_writer.rb +0 -59
  515. data/lib/rubyXL/writer/workbook_writer.rb +0 -77
  516. data/lib/rubyXL/writer/worksheet_writer.rb +0 -230
  517. data/lib/rubyXL/zip.rb +0 -20
  518. data/spec/lib/hash_spec.rb +0 -28
data/lib/rubyXL.rb CHANGED
@@ -1,10 +1,12 @@
1
- $: << File.expand_path(File.dirname(__FILE__))
2
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','workbook'))
3
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','private_class'))
4
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','worksheet'))
5
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','cell'))
6
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','parser'))
7
- require File.expand_path(File.join(File.dirname(__FILE__),'rubyXL','color'))
1
+ require 'rubyXL/objects/root'
2
+ require 'rubyXL/parser'
8
3
 
9
4
  module RubyXL
5
+ @@suppress_warnings = false
6
+
7
+ # Convert any path passed to absolute path (within the XLSX file).
8
+ def self.from_root(path)
9
+ return path unless path.absolute?
10
+ path.relative_path_from(OOXMLTopLevelObject::ROOT)
11
+ end
10
12
  end
@@ -0,0 +1,534 @@
1
+ <!DOCTYPE html>
2
+
3
+ <html>
4
+ <head>
5
+ <meta charset="UTF-8">
6
+
7
+ <title>README - rubyXL 3.4.33</title>
8
+
9
+ <script type="text/javascript">
10
+ var rdoc_rel_prefix = "./";
11
+ var index_rel_prefix = "./";
12
+ </script>
13
+
14
+ <script src="./js/navigation.js" defer></script>
15
+ <script src="./js/search.js" defer></script>
16
+ <script src="./js/search_index.js" defer></script>
17
+ <script src="./js/searcher.js" defer></script>
18
+ <script src="./js/darkfish.js" defer></script>
19
+
20
+ <link href="./css/fonts.css" rel="stylesheet">
21
+ <link href="./css/rdoc.css" rel="stylesheet">
22
+
23
+
24
+ <body id="top" role="document" class="file">
25
+ <nav role="navigation">
26
+ <div id="project-navigation">
27
+ <div id="home-section" role="region" title="Quick navigation" class="nav-section">
28
+ <h2>
29
+ <a href="./index.html" rel="home">Home</a>
30
+ </h2>
31
+
32
+ <div id="table-of-contents-navigation">
33
+ <a href="./table_of_contents.html#pages">Pages</a>
34
+ <a href="./table_of_contents.html#classes">Classes</a>
35
+ <a href="./table_of_contents.html#methods">Methods</a>
36
+ </div>
37
+ </div>
38
+
39
+ <div id="search-section" role="search" class="project-section initially-hidden">
40
+ <form action="#" method="get" accept-charset="utf-8">
41
+ <div id="search-field-wrapper">
42
+ <input id="search-field" role="combobox" aria-label="Search"
43
+ aria-autocomplete="list" aria-controls="search-results"
44
+ type="text" name="search" placeholder="Search (/) for a class, method, ..." spellcheck="false"
45
+ title="Type to search, Up and Down to navigate, Enter to load">
46
+ </div>
47
+
48
+ <ul id="search-results" aria-label="Search Results"
49
+ aria-busy="false" aria-expanded="false"
50
+ aria-atomic="false" class="initially-hidden"></ul>
51
+ </form>
52
+ </div>
53
+
54
+ </div>
55
+
56
+
57
+ <div class="nav-section">
58
+ <h3>Table of Contents</h3>
59
+
60
+
61
+
62
+ <ul class="link-list" role="directory">
63
+ <li>
64
+ <details open>
65
+ <summary> <a href="#label-rubyXL">rubyXL</a>
66
+ </summary>
67
+ <ul class="link-list" role="directory">
68
+ <li> <a href="#label-To+Install-3A">To Install:</a>
69
+ <li>
70
+ <details open>
71
+ <summary> <a href="#label-To+Use-3A">To Use:</a>
72
+ </summary>
73
+ <ul class="link-list" role="directory">
74
+ <li> <a href="#label-Convenience+methods">Convenience methods</a>
75
+ <li> <a href="#label-Parsing+an+existing+workbook">Parsing an existing workbook</a>
76
+ <li> <a href="#label-Creating+a+new+Workbook">Creating a new Workbook</a>
77
+ <li>
78
+ <details open>
79
+ <summary> <a href="#label-Accessing">Accessing</a>
80
+ </summary>
81
+ <ul class="link-list" role="directory">
82
+ <li> <a href="#label-Accessing+a+Worksheet">Accessing a Worksheet</a>
83
+ <li> <a href="#label-Accessing+a+Row+-28Array+of+Cells-29">Accessing a Row (Array of Cells)</a>
84
+ <li> <a href="#label-Accessing+a+Cell+object">Accessing a Cell object</a>
85
+ <li> <a href="#label-Wrappers+for+accessing+Cell+properties">Wrappers for accessing Cell properties</a>
86
+ <li> <a href="#label-Wrappers+for+accessing+Row+properties+">Wrappers for accessing Row properties </a>
87
+ <li> <a href="#label-Accessing+column+properties">Accessing column properties</a>
88
+
89
+ </ul>
90
+ </details>
91
+ </li>
92
+ <li>
93
+ <details open>
94
+ <summary> <a href="#label-Modifying">Modifying</a>
95
+ </summary>
96
+ <ul class="link-list" role="directory">
97
+ <li> <a href="#label-Adding+Worksheets">Adding Worksheets</a>
98
+ <li> <a href="#label-Renaming+Worksheets">Renaming Worksheets</a>
99
+ <li> <a href="#label-Adding+Cells">Adding Cells</a>
100
+ <li> <a href="#label-Changing+Cells">Changing Cells</a>
101
+ <li> <a href="#label-Changing+Fonts">Changing Fonts</a>
102
+ <li> <a href="#label-Changing+Fills+++++">Changing Fills </a>
103
+ <li> <a href="#label-Changing+Borders">Changing Borders</a>
104
+ <li>
105
+ <details open>
106
+ <summary> <a href="#label-Changing+Alignment">Changing Alignment</a>
107
+ </summary>
108
+ <ul class="link-list" role="directory">
109
+ <li> <a href="#label-Horizontal">Horizontal</a>
110
+ <li> <a href="#label-Vertical">Vertical</a>
111
+ <li> <a href="#label-Rotation">Rotation</a>
112
+
113
+ </ul>
114
+ </details>
115
+ </li>
116
+ <li> <a href="#label-Changing+Row+Height">Changing Row Height</a>
117
+ <li> <a href="#label-Changing+Column+Width">Changing Column Width</a>
118
+ <li> <a href="#label-Merging+Cells">Merging Cells</a>
119
+ <li> <a href="#label-Insert+Row">Insert Row</a>
120
+ <li> <a href="#label-Insert+Column">Insert Column</a>
121
+ <li> <a href="#label-Delete+Row">Delete Row</a>
122
+ <li> <a href="#label-Delete+Column">Delete Column</a>
123
+ <li> <a href="#label-Insert+Cell">Insert Cell</a>
124
+ <li> <a href="#label-Delete+Cell">Delete Cell</a>
125
+ <li> <a href="#label-Modifying+Cell+Format">Modifying Cell Format</a>
126
+ <li> <a href="#label-Add+hyperlink+to+a+Cell">Add hyperlink to a Cell</a>
127
+
128
+ </ul>
129
+ </details>
130
+ </li>
131
+
132
+ </ul>
133
+ </details>
134
+ </li>
135
+ <li> <a href="#label-I-2FO">I/O</a>
136
+ <li>
137
+ <details open>
138
+ <summary> <a href="#label-Miscellaneous">Miscellaneous</a>
139
+ </summary>
140
+ <ul class="link-list" role="directory">
141
+ <li> <a href="#label-Suppress+warnings+about+malformed+input+files">Suppress warnings about malformed input files</a>
142
+
143
+ </ul>
144
+ </details>
145
+ </li>
146
+ <li> <a href="#label-Data+validation+-28colloquially+referred+to+as+-22dropdown+list-22-29">Data validation (colloquially referred to as “dropdown list”)</a>
147
+ <li> <a href="#label-For+more+information">For more information</a>
148
+ <li> <a href="#label-Contributing+to+rubyXL">Contributing to rubyXL</a>
149
+ <li> <a href="#label-Copyright">Copyright</a>
150
+
151
+ </ul>
152
+ </details>
153
+ </li>
154
+
155
+ </ul>
156
+ </div>
157
+
158
+
159
+ <div id="project-metadata">
160
+
161
+ <div id="fileindex-section" class="nav-section">
162
+ <h3>Pages</h3>
163
+
164
+ <ul class="link-list">
165
+ <li><a href="./README_rdoc.html">README</a>
166
+ </ul>
167
+ </div>
168
+
169
+ </div>
170
+ </nav>
171
+
172
+ <main role="main" aria-label="Page README.rdoc">
173
+
174
+ <h1 id="label-rubyXL">rubyXL<span><a href="#label-rubyXL">&para;</a> <a href="#top">&uarr;</a></span></h1>
175
+
176
+ <p><a href="http://badge.fury.io/rb/rubyXL"><img src="https://badge.fury.io/rb/rubyXL.svg"></a> <a href="https://codeclimate.com/github/weshatheleopard/rubyXL"><img src="https://codeclimate.com/github/weshatheleopard/rubyXL.png"></a> <a href="https://circleci.com/gh/weshatheleopard/rubyXL"><img src="https://circleci.com/gh/weshatheleopard/rubyXL.svg?style=svg"></a></p>
177
+
178
+ <p>This gem supports operating on <code>xlsx</code> files (Open XML format). While it is capable of properly parsing the entire OOXML structure, its current main emphasis is on reading files produced by MS Excel, making minor modifications to them and saving them to be opened again, while preserving as much of the structure as possible.</p>
179
+
180
+ <p>Please note that proprietary binary <code>xls</code> format is <strong>not</strong> supported by this gem. If you need to parse those files, try <a href="https://github.com/zdavatz/spreadsheet">spreadsheet</a> gem.</p>
181
+
182
+ <h2 id="label-To+Install-3A">To Install:<span><a href="#label-To+Install-3A">&para;</a> <a href="#top">&uarr;</a></span></h2>
183
+
184
+ <pre class="ruby"><span class="ruby-identifier">gem</span> <span class="ruby-identifier">install</span> <span class="ruby-identifier">rubyXL</span>
185
+ </pre>
186
+
187
+ <h2 id="label-To+Use-3A">To Use:<span><a href="#label-To+Use-3A">&para;</a> <a href="#top">&uarr;</a></span></h2>
188
+
189
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL&#39;</span> <span class="ruby-comment"># Assuming rubygems is already required</span>
190
+ </pre>
191
+
192
+ <h3 id="label-Convenience+methods">Convenience methods<span><a href="#label-Convenience+methods">&para;</a> <a href="#top">&uarr;</a></span></h3>
193
+
194
+ <p>Starting with version 3.4.0, the main data structure has been separated from the convenience methods that provide access to individual features of the <code>xlsx</code> format, in order to decrease the memory footprint. If you intend to use these features, you will need to additionally include the respective files:</p>
195
+
196
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods/cell&#39;</span>
197
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods/color&#39;</span>
198
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods/font&#39;</span>
199
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods/workbook&#39;</span>
200
+ <span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods/worksheet&#39;</span>
201
+ </pre>
202
+
203
+ <p>If you do not care about your RAM usage, just include them all at once by adding the following line to your code so it can continue operating just as before:</p>
204
+
205
+ <pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">&#39;rubyXL/convenience_methods&#39;</span>
206
+ </pre>
207
+
208
+ <h3 id="label-Parsing+an+existing+workbook">Parsing an existing workbook<span><a href="#label-Parsing+an+existing+workbook">&para;</a> <a href="#top">&uarr;</a></span></h3>
209
+
210
+ <pre class="ruby"><span class="ruby-identifier">workbook</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;path/to/Excel/file.xlsx&quot;</span>)
211
+ </pre>
212
+
213
+ <h3 id="label-Creating+a+new+Workbook">Creating a new Workbook<span><a href="#label-Creating+a+new+Workbook">&para;</a> <a href="#top">&uarr;</a></span></h3>
214
+
215
+ <pre class="ruby"><span class="ruby-identifier">workbook</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Workbook</span>.<span class="ruby-identifier">new</span>
216
+ </pre>
217
+
218
+ <h3 id="label-Accessing">Accessing<span><a href="#label-Accessing">&para;</a> <a href="#top">&uarr;</a></span></h3>
219
+
220
+ <h4 id="label-Accessing+a+Worksheet">Accessing a Worksheet<span><a href="#label-Accessing+a+Worksheet">&para;</a> <a href="#top">&uarr;</a></span></h4>
221
+
222
+ <pre class="ruby"><span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">worksheets</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first worksheet</span>
223
+ <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first worksheet</span>
224
+ <span class="ruby-identifier">workbook</span>[<span class="ruby-string">&#39;Sheet1&#39;</span>] <span class="ruby-comment"># Finds and returns worksheet titled &quot;Sheet1&quot;. Note that sheet names in Excel are limited to 31 character.</span>
225
+ </pre>
226
+
227
+ <h4 id="label-Accessing+a+Row+-28Array+of+Cells-29">Accessing a Row (Array of Cells)<span><a href="#label-Accessing+a+Row+-28Array+of+Cells-29">&para;</a> <a href="#top">&uarr;</a></span></h4>
228
+
229
+ <p>Please note that worksheet is a <em>sparse</em> array of rows. Your code <strong>must</strong> expect that any row it plucks from the array may be <code>nil</code>.</p>
230
+
231
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
232
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first row of the worksheet</span>
233
+ <span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first row of the worksheet</span>
234
+ </pre>
235
+
236
+ <h4 id="label-Accessing+a+Cell+object">Accessing a Cell object<span><a href="#label-Accessing+a+Cell+object">&para;</a> <a href="#top">&uarr;</a></span></h4>
237
+
238
+ <p>Please note that row is a <em>sparse</em> array of cells. Your code <strong>must</strong> expect that any cell it plucks from the array may be <code>nil</code>.</p>
239
+
240
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
241
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns cell A1 in the worksheet</span>
242
+ <span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns cell A1 in the worksheet</span>
243
+
244
+ <span class="ruby-identifier">cell</span> = <span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
245
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">value</span> <span class="ruby-comment"># Returns a properly converted value in the cell (if the file claims that the cell</span>
246
+ <span class="ruby-comment"># is holding a number, returns a respective Integer or Float, and so on).</span>
247
+ </pre>
248
+
249
+ <p>Or, if you prefer Excel-style references (single-cell only!)</p>
250
+
251
+ <pre class="ruby"><span class="ruby-identifier">cell</span> = <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">cell_at</span>(<span class="ruby-string">&#39;B11&#39;</span>)
252
+ </pre>
253
+
254
+ <h4 id="label-Wrappers+for+accessing+Cell+properties">Wrappers for accessing Cell properties<span><a href="#label-Wrappers+for+accessing+Cell+properties">&para;</a> <a href="#top">&uarr;</a></span></h4>
255
+
256
+ <pre class="ruby"><span class="ruby-identifier">cell</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
257
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">is_struckthrough</span> <span class="ruby-comment"># Returns +true+ if the cell is struckthrough, other boolean properties have same syntax</span>
258
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">font_name</span>
259
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">font_size</span>
260
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">font_color</span>
261
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">fill_color</span>
262
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">horizontal_alignment</span>
263
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">vertical_alignment</span>
264
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">get_border</span>(<span class="ruby-value">:top</span>)
265
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">get_border_color</span>(<span class="ruby-value">:top</span>)
266
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">text_rotation</span>
267
+ </pre>
268
+
269
+ <h4 id="label-Wrappers+for+accessing+Row+properties+">Wrappers for accessing Row properties <span><a href="#label-Wrappers+for+accessing+Row+properties+">&para;</a> <a href="#top">&uarr;</a></span></h4>
270
+
271
+ <p>Please note: these methods are being phased out in favor of the OOXML object model.</p>
272
+
273
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
274
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_fill</span>(<span class="ruby-value">0</span>)
275
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_font_name</span>(<span class="ruby-value">0</span>)
276
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_font_size</span>(<span class="ruby-value">0</span>)
277
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_font_color</span>(<span class="ruby-value">0</span>)
278
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">is_row_underlined</span>(<span class="ruby-value">0</span>)
279
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_height</span>(<span class="ruby-value">0</span>)
280
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-keyword">true</span>)
281
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-keyword">false</span>)
282
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_border</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:right</span>)
283
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_row_border_color</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:right</span>)
284
+ </pre>
285
+
286
+ <h4 id="label-Accessing+column+properties">Accessing column properties<span><a href="#label-Accessing+column+properties">&para;</a> <a href="#top">&uarr;</a></span></h4>
287
+
288
+ <p>Please note: these methods are being phased out in favor of the OOXML object model.</p>
289
+
290
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
291
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_fill</span>(<span class="ruby-value">0</span>)
292
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_font_name</span>(<span class="ruby-value">0</span>)
293
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_font_size</span>(<span class="ruby-value">0</span>)
294
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_font_color</span>(<span class="ruby-value">0</span>)
295
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">is_column_underlined</span>(<span class="ruby-value">0</span>)
296
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_width</span>(<span class="ruby-value">0</span>)
297
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:horizontal</span>)
298
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:vertical</span>)
299
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_border</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:right</span>)
300
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">get_column_border_color</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:right</span>)
301
+ </pre>
302
+
303
+ <h3 id="label-Modifying">Modifying<span><a href="#label-Modifying">&para;</a> <a href="#top">&uarr;</a></span></h3>
304
+
305
+ <h4 id="label-Adding+Worksheets">Adding Worksheets<span><a href="#label-Adding+Worksheets">&para;</a> <a href="#top">&uarr;</a></span></h4>
306
+
307
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">add_worksheet</span>(<span class="ruby-string">&#39;Sheet2&#39;</span>)
308
+ </pre>
309
+
310
+ <h4 id="label-Renaming+Worksheets">Renaming Worksheets<span><a href="#label-Renaming+Worksheets">&para;</a> <a href="#top">&uarr;</a></span></h4>
311
+
312
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_name</span> = <span class="ruby-string">&#39;Cool New Name&#39;</span> <span class="ruby-comment"># Note that sheet name is limited to 31 characters by Excel.</span>
313
+ </pre>
314
+
315
+ <h4 id="label-Adding+Cells">Adding Cells<span><a href="#label-Adding+Cells">&para;</a> <a href="#top">&uarr;</a></span></h4>
316
+
317
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">add_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-string">&#39;A1&#39;</span>) <span class="ruby-comment"># Sets cell A1 to string &quot;A1&quot;</span>
318
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">add_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">1</span>, <span class="ruby-string">&#39;&#39;</span>, <span class="ruby-string">&#39;A1&#39;</span>) <span class="ruby-comment"># Sets formula in the cell B1 to &#39;=A1&#39;</span>
319
+ </pre>
320
+
321
+ <h4 id="label-Changing+Cells">Changing Cells<span><a href="#label-Changing+Cells">&para;</a> <a href="#top">&uarr;</a></span></h4>
322
+
323
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_contents</span>(<span class="ruby-string">&quot;&quot;</span>, <span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">formula</span>) <span class="ruby-comment"># Sets value of cell A1 to empty string, preserves formula</span>
324
+ </pre>
325
+
326
+ <h4 id="label-Changing+Fonts">Changing Fonts<span><a href="#label-Changing+Fonts">&para;</a> <a href="#top">&uarr;</a></span></h4>
327
+
328
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_font_bold</span>(<span class="ruby-keyword">true</span>) <span class="ruby-comment"># Makes A1 bold</span>
329
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_italics</span>(<span class="ruby-value">0</span>,<span class="ruby-keyword">true</span>) <span class="ruby-comment"># Makes first row italicized</span>
330
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_font_name</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;Courier&#39;</span>) <span class="ruby-comment"># Makes first column have font Courier</span>
331
+ </pre>
332
+
333
+ <h4 id="label-Changing+Fills+++++">Changing Fills <span><a href="#label-Changing+Fills+++++">&para;</a> <a href="#top">&uarr;</a></span></h4>
334
+
335
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_fill</span>(<span class="ruby-string">&#39;0ba53d&#39;</span>) <span class="ruby-comment"># Sets A1 to have fill #0ba53d</span>
336
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;0ba53d&#39;</span>) <span class="ruby-comment"># Sets first row to have fill #0ba53d</span>
337
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;0ba53d&#39;</span>) <span class="ruby-comment"># Sets first column to have fill #0ba53d</span>
338
+ </pre>
339
+
340
+ <h4 id="label-Changing+Borders">Changing Borders<span><a href="#label-Changing+Borders">&para;</a> <a href="#top">&uarr;</a></span></h4>
341
+
342
+ <pre class="ruby"><span class="ruby-comment"># Possible weights: hairline, thin, medium, thick</span>
343
+ <span class="ruby-comment"># Possible &quot;directions&quot;: top, bottom, left, right, diagonal</span>
344
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_border</span>(<span class="ruby-value">:top</span>, <span class="ruby-string">&#39;thin&#39;</span>) <span class="ruby-comment"># Sets A1 to have a top, thin border</span>
345
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_border</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:left</span>, <span class="ruby-string">&#39;hairline&#39;</span>) <span class="ruby-comment"># Sets first row to have a left, hairline border</span>
346
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_border</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:diagonal</span>, <span class="ruby-string">&#39;medium&#39;</span>) <span class="ruby-comment"># Sets first column to have diagonal, medium border</span>
347
+
348
+ <span class="ruby-comment"># Set the border style first so there&#39;s something to color.</span>
349
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_border_color</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:top</span>, <span class="ruby-string">&#39;0ba53d&#39;</span>) <span class="ruby-comment"># Sets first row to have a green top border</span>
350
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_border_color</span>(<span class="ruby-value">0</span>, <span class="ruby-value">:top</span>, <span class="ruby-string">&#39;0ba53d&#39;</span>) <span class="ruby-comment"># Sets first column to have a green top border</span>
351
+ </pre>
352
+
353
+ <h4 id="label-Changing+Alignment">Changing Alignment<span><a href="#label-Changing+Alignment">&para;</a> <a href="#top">&uarr;</a></span></h4>
354
+
355
+ <h5 id="label-Horizontal">Horizontal<span><a href="#label-Horizontal">&para;</a> <a href="#top">&uarr;</a></span></h5>
356
+
357
+ <pre class="ruby"><span class="ruby-comment"># Possible alignments: center, distributed, justify, left, right</span>
358
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_horizontal_alignment</span>(<span class="ruby-string">&#39;center&#39;</span>) <span class="ruby-comment"># Sets A1 to be centered</span>
359
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_horizontal_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;justify&#39;</span>) <span class="ruby-comment"># Sets first row to be justified</span>
360
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_horizontal_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;right&#39;</span>) <span class="ruby-comment"># Sets first column to be right-aligned</span>
361
+ </pre>
362
+
363
+ <h5 id="label-Vertical">Vertical<span><a href="#label-Vertical">&para;</a> <a href="#top">&uarr;</a></span></h5>
364
+
365
+ <pre class="ruby"><span class="ruby-comment"># Possible alignments: bottom, center, distributed, top</span>
366
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_vertical_alignment</span>(<span class="ruby-string">&#39;bottom&#39;</span>) <span class="ruby-comment"># Sets A1 to be bottom aligned</span>
367
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_vertical_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;distributed&#39;</span>) <span class="ruby-comment"># Sets first row to be distributed vertically</span>
368
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_vertical_alignment</span>(<span class="ruby-value">0</span>, <span class="ruby-string">&#39;top&#39;</span>) <span class="ruby-comment"># Sets first column to be top aligned</span>
369
+ </pre>
370
+
371
+ <h5 id="label-Rotation">Rotation<span><a href="#label-Rotation">&para;</a> <a href="#top">&uarr;</a></span></h5>
372
+
373
+ <pre class="ruby"><span class="ruby-comment"># Possible values:</span>
374
+ <span class="ruby-comment"># * 0-90 - degrees counterclockwise, around the bottom LEFT corner of the cell;</span>
375
+ <span class="ruby-comment"># * 91-179 - degrees clockwise, around the bottom RIGHT corner of the cell;</span>
376
+ <span class="ruby-comment"># * 180-254 - degrees clockwise, around the bottom LEFT corner of the cell, text becomes progressively invisible</span>
377
+ <span class="ruby-comment"># * 255 - text is in normal rotation but displayed vertically (one letter under another), line feed starts new line to the right of the previous.</span>
378
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_data</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>].<span class="ruby-identifier">change_text_rotation</span>(<span class="ruby-value">90</span>) <span class="ruby-comment"># Sets A1 to be rotated by 90 degrees</span>
379
+ </pre>
380
+
381
+ <h4 id="label-Changing+Row+Height">Changing Row Height<span><a href="#label-Changing+Row+Height">&para;</a> <a href="#top">&uarr;</a></span></h4>
382
+
383
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_height</span>(<span class="ruby-value">0</span>, <span class="ruby-value">30</span>) <span class="ruby-comment"># Sets first row height to 30</span>
384
+ </pre>
385
+
386
+ <h4 id="label-Changing+Column+Width">Changing Column Width<span><a href="#label-Changing+Column+Width">&para;</a> <a href="#top">&uarr;</a></span></h4>
387
+
388
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_width</span>(<span class="ruby-value">0</span>, <span class="ruby-value">30</span>) <span class="ruby-comment"># Sets first column width to 30</span>
389
+ </pre>
390
+
391
+ <h4 id="label-Merging+Cells">Merging Cells<span><a href="#label-Merging+Cells">&para;</a> <a href="#top">&uarr;</a></span></h4>
392
+
393
+ <pre>worksheet.merge_cells(0, 1, 2, 3) # Merges B1:D3
394
+ worksheet.merge_cells(&#39;A2:C4&#39;) # Merges A2:C4
395
+ worksheet.merge_cells(row_from: 0, row_to: 1, col_from 2:, col_to: 3) # Merges C1:D2</pre>
396
+
397
+ <h4 id="label-Insert+Row">Insert Row<span><a href="#label-Insert+Row">&para;</a> <a href="#top">&uarr;</a></span></h4>
398
+
399
+ <p>This method will insert a row at specified index, pushing all rows below it down. It also copies styles from row above.</p>
400
+
401
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted rows</p>
402
+
403
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">insert_row</span>(<span class="ruby-value">1</span>)
404
+ </pre>
405
+
406
+ <h4 id="label-Insert+Column">Insert Column<span><a href="#label-Insert+Column">&para;</a> <a href="#top">&uarr;</a></span></h4>
407
+
408
+ <p>This method will insert a column at specified index, pushing all columns to the right of it one to the right. It also copies styles from column to the left</p>
409
+
410
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted columns</p>
411
+
412
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">insert_column</span>(<span class="ruby-value">1</span>)
413
+ </pre>
414
+
415
+ <h4 id="label-Delete+Row">Delete Row<span><a href="#label-Delete+Row">&para;</a> <a href="#top">&uarr;</a></span></h4>
416
+
417
+ <p>This method will delete a row at specified index, pushing all rows below it up.</p>
418
+
419
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted rows</p>
420
+
421
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">delete_row</span>(<span class="ruby-value">1</span>)
422
+ </pre>
423
+
424
+ <h4 id="label-Delete+Column">Delete Column<span><a href="#label-Delete+Column">&para;</a> <a href="#top">&uarr;</a></span></h4>
425
+
426
+ <p>This method will delete a column at specified index, pushing all columns to the right of it left.</p>
427
+
428
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted columns</p>
429
+
430
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">delete_column</span>(<span class="ruby-value">1</span>)
431
+ </pre>
432
+
433
+ <h4 id="label-Insert+Cell">Insert Cell<span><a href="#label-Insert+Cell">&para;</a> <a href="#top">&uarr;</a></span></h4>
434
+
435
+ <p>This method will insert a cell at specified position. It takes a :right or :down option, to shift cells either left or down upon inserting (nil means replacing the cell)</p>
436
+
437
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted cells</p>
438
+
439
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">insert_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-string">&quot;blah&quot;</span>, <span class="ruby-identifier">formula</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">:right</span>) <span class="ruby-comment"># Inserts cell at A1, shifts cells in first row right</span>
440
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">insert_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-string">&quot;blah&quot;</span>, <span class="ruby-identifier">formula</span> = <span class="ruby-keyword">nil</span>, <span class="ruby-value">:down</span>) <span class="ruby-comment"># Inserts cell at A1, shifts cells in first column down</span>
441
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">insert_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-string">&quot;blah&quot;</span>) <span class="ruby-comment"># Inserts cell at A1, shifts nothing</span>
442
+ </pre>
443
+
444
+ <h4 id="label-Delete+Cell">Delete Cell<span><a href="#label-Delete+Cell">&para;</a> <a href="#top">&uarr;</a></span></h4>
445
+
446
+ <p>This method will delete a cell at specified position. It takes a :left or :up option, to shift cells either up or left upon deletion (nil means simply deleting the cell contents)</p>
447
+
448
+ <p>WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted cells</p>
449
+
450
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">delete_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-value">:left</span>) <span class="ruby-comment"># Deletes A1, shifts contents of first row left</span>
451
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">delete_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>, <span class="ruby-value">:up</span>) <span class="ruby-comment"># Deletes A1, shifts contents of first column up</span>
452
+ <span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">delete_cell</span>(<span class="ruby-value">0</span>, <span class="ruby-value">0</span>) <span class="ruby-comment"># Deletes A1, does not shift cells</span>
453
+ </pre>
454
+
455
+ <h4 id="label-Modifying+Cell+Format">Modifying Cell Format<span><a href="#label-Modifying+Cell+Format">&para;</a> <a href="#top">&uarr;</a></span></h4>
456
+
457
+ <pre class="ruby"><span class="ruby-identifier">cell</span> = <span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>][<span class="ruby-value">0</span>]
458
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">set_number_format</span> <span class="ruby-string">&#39;0.0000%&#39;</span> <span class="ruby-comment"># For formats, see https://support.office.com/en-us/article/5026bbd6-04bc-48cd-bf33-80f18b4eae68</span>
459
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">change_text_wrap</span>(<span class="ruby-keyword">true</span>) <span class="ruby-comment"># Makes the text in the cell to wrap.</span>
460
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">change_shrink_to_fit</span>(<span class="ruby-keyword">true</span>) <span class="ruby-comment"># Makes the text in the cell to shrink to fit.</span>
461
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">change_text_indent</span>(<span class="ruby-value">1</span>) <span class="ruby-comment"># Indents the text in the cell by 1 level</span>
462
+ </pre>
463
+
464
+ <h4 id="label-Add+hyperlink+to+a+Cell">Add hyperlink to a Cell<span><a href="#label-Add+hyperlink+to+a+Cell">&para;</a> <a href="#top">&uarr;</a></span></h4>
465
+
466
+ <pre class="ruby"><span class="ruby-identifier">cell</span>.<span class="ruby-identifier">add_hyperlink</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>)
467
+ <span class="ruby-identifier">cell</span>.<span class="ruby-identifier">add_hyperlink</span>(<span class="ruby-string">&#39;http://example.com&#39;</span>, <span class="ruby-string">&#39;Some tooltip text&#39;</span>)
468
+ </pre>
469
+
470
+ <h2 id="label-I-2FO">I/O<span><a href="#label-I-2FO">&para;</a> <a href="#top">&uarr;</a></span></h2>
471
+
472
+ <p>By default, the gem operates with files on the local filesystem:</p>
473
+
474
+ <pre class="ruby"><span class="ruby-identifier">workbook</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse</span>(<span class="ruby-string">&quot;path/to/Excel/file.xlsx&quot;</span>)
475
+ <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">write</span>(<span class="ruby-string">&quot;path/to/desired/Excel/file.xlsx&quot;</span>)
476
+ </pre>
477
+
478
+ <p>It can also operate on <code>StringIO</code> objects, thus eliminating the need to save the <code>xlsx</code> file to disk. This capability comes in handy for web servers.</p>
479
+
480
+ <pre class="ruby"><span class="ruby-identifier">workbook</span> = <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Parser</span>.<span class="ruby-identifier">parse_buffer</span>(<span class="ruby-identifier">buffer</span>)
481
+ <span class="ruby-identifier">workbook</span>.<span class="ruby-identifier">stream</span>
482
+ </pre>
483
+
484
+ <h2 id="label-Miscellaneous">Miscellaneous<span><a href="#label-Miscellaneous">&para;</a> <a href="#top">&uarr;</a></span></h2>
485
+
486
+ <pre class="ruby"><span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ind2ref</span>(<span class="ruby-value">0</span>,<span class="ruby-value">0</span>) <span class="ruby-operator">==</span> <span class="ruby-string">&#39;A1&#39;</span> <span class="ruby-comment"># Converts row and column index to Excel-style cell reference</span>
487
+ <span class="ruby-constant">RubyXL</span><span class="ruby-operator">::</span><span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-string">&#39;A1&#39;</span>) <span class="ruby-operator">==</span> [<span class="ruby-value">0</span>, <span class="ruby-value">0</span>] <span class="ruby-comment"># Converts Excel-style cell reference to row and column index</span>
488
+ </pre>
489
+
490
+ <h3 id="label-Suppress+warnings+about+malformed+input+files">Suppress warnings about malformed input files<span><a href="#label-Suppress+warnings+about+malformed+input+files">&para;</a> <a href="#top">&uarr;</a></span></h3>
491
+
492
+ <pre class="ruby"><span class="ruby-constant">RubyXL</span>.<span class="ruby-identifier">class_variable_set</span>(<span class="ruby-value">:@@suppress_warnings</span>, <span class="ruby-keyword">true</span>)
493
+ </pre>
494
+
495
+ <h2 id="label-Data+validation+-28colloquially+referred+to+as+-22dropdown+list-22-29">Data validation (colloquially referred to as “dropdown list”)<span><a href="#label-Data+validation+-28colloquially+referred+to+as+-22dropdown+list-22-29">&para;</a> <a href="#top">&uarr;</a></span></h2>
496
+
497
+ <pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">add_validation_list</span>(<span class="ruby-string">&quot;A1&quot;</span>, [ <span class="ruby-string">&quot;value1&quot;</span>, <span class="ruby-string">&quot;value2&quot;</span> ])
498
+ </pre>
499
+
500
+ <h2 id="label-For+more+information">For more information<span><a href="#label-For+more+information">&para;</a> <a href="#top">&uarr;</a></span></h2>
501
+
502
+ <p>Take a look at the files in spec/lib/ for rspecs on most methods</p>
503
+
504
+ <h2 id="label-Contributing+to+rubyXL">Contributing to rubyXL<span><a href="#label-Contributing+to+rubyXL">&para;</a> <a href="#top">&uarr;</a></span></h2>
505
+ <ul><li>
506
+ <p>Check out the latest master to make sure the feature hasn’t been implemented or the bug hasn’t been fixed yet</p>
507
+ </li><li>
508
+ <p>Check out the issue tracker to make sure someone already hasn’t requested it and/or contributed it</p>
509
+ </li><li>
510
+ <p>Fork the project</p>
511
+ </li><li>
512
+ <p>Start a feature/bugfix branch</p>
513
+ </li><li>
514
+ <p>Commit and push until you are happy with your contribution</p>
515
+ </li><li>
516
+ <p>Make sure to add tests for it. This is important so I don’t break it in a future version unintentionally.</p>
517
+ </li><li>
518
+ <p>Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.</p>
519
+ </li></ul>
520
+
521
+ <h2 id="label-Copyright">Copyright<span><a href="#label-Copyright">&para;</a> <a href="#top">&uarr;</a></span></h2>
522
+
523
+ <p>Copyright © 2011 Vivek Bhagwat, 2013-2022 Wesha. See LICENSE.txt for further details.</p>
524
+
525
+ </main>
526
+
527
+
528
+
529
+ <footer id="validator-badges" role="contentinfo">
530
+ <p><a href="https://validator.w3.org/check/referer">Validate</a>
531
+ <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.6.3.1.
532
+ <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
533
+ </footer>
534
+