rubyXL 3.3.15 → 3.3.16
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.
- checksums.yaml +7 -0
- data/Gemfile +3 -3
- data/README.rdoc +5 -1
- data/Rakefile +6 -16
- data/VERSION +1 -1
- data/lib/rubyXL/convenience_methods.rb +40 -65
- data/lib/rubyXL/objects/ooxml_object.rb +3 -1
- data/lib/rubyXL/objects/sheet_data.rb +2 -0
- data/lib/rubyXL/objects/text.rb +1 -1
- data/lib/rubyXL/worksheet.rb +3 -56
- data/rdoc/README_rdoc.html +37 -31
- data/rdoc/RubyXL.html +2 -2
- data/rdoc/RubyXL/AExtension.html +2 -2
- data/rdoc/RubyXL/AExtensionStorageArea.html +2 -2
- data/rdoc/RubyXL/AdjustHandleList.html +2 -2
- data/rdoc/RubyXL/Alignment.html +2 -2
- data/rdoc/RubyXL/AlternateContent.html +2 -2
- data/rdoc/RubyXL/Authors.html +2 -2
- data/rdoc/RubyXL/AutoFilter.html +2 -2
- data/rdoc/RubyXL/AutoFilterColumn.html +2 -2
- data/rdoc/RubyXL/BinaryImageFile.html +2 -2
- data/rdoc/RubyXL/BodyProperties.html +2 -2
- data/rdoc/RubyXL/BooleanNode.html +2 -2
- data/rdoc/RubyXL/BooleanValue.html +2 -2
- data/rdoc/RubyXL/Border.html +2 -2
- data/rdoc/RubyXL/BorderEdge.html +2 -2
- data/rdoc/RubyXL/Borders.html +2 -2
- data/rdoc/RubyXL/Break.html +2 -2
- data/rdoc/RubyXL/BreakList.html +2 -2
- data/rdoc/RubyXL/CT_AdjPoint2D.html +2 -2
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +2 -2
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +2 -2
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +2 -2
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +2 -2
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +2 -2
- data/rdoc/RubyXL/CT_Backdrop.html +2 -2
- data/rdoc/RubyXL/CT_Bevel.html +2 -2
- data/rdoc/RubyXL/CT_BiLevelEffect.html +2 -2
- data/rdoc/RubyXL/CT_BlendEffect.html +2 -2
- data/rdoc/RubyXL/CT_Blip.html +2 -2
- data/rdoc/RubyXL/CT_BlipFillProperties.html +2 -2
- data/rdoc/RubyXL/CT_BlurEffect.html +2 -2
- data/rdoc/RubyXL/CT_Camera.html +2 -2
- data/rdoc/RubyXL/CT_Color.html +2 -2
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +2 -2
- data/rdoc/RubyXL/CT_ColorMapping.html +2 -2
- data/rdoc/RubyXL/CT_ColorScheme.html +2 -2
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +2 -2
- data/rdoc/RubyXL/CT_ConnectionSite.html +2 -2
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +2 -2
- data/rdoc/RubyXL/CT_DashStop.html +2 -2
- data/rdoc/RubyXL/CT_DashStopList.html +2 -2
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +2 -2
- data/rdoc/RubyXL/CT_DuotoneEffect.html +2 -2
- data/rdoc/RubyXL/CT_EffectContainer.html +2 -2
- data/rdoc/RubyXL/CT_EffectList.html +2 -2
- data/rdoc/RubyXL/CT_EffectReference.html +2 -2
- data/rdoc/RubyXL/CT_EffectStyleItem.html +2 -2
- data/rdoc/RubyXL/CT_EffectStyleList.html +2 -2
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +2 -2
- data/rdoc/RubyXL/CT_FillEffect.html +2 -2
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +2 -2
- data/rdoc/RubyXL/CT_FillStyleList.html +2 -2
- data/rdoc/RubyXL/CT_FlatText.html +2 -2
- data/rdoc/RubyXL/CT_FontCollection.html +2 -2
- data/rdoc/RubyXL/CT_FontReference.html +2 -2
- data/rdoc/RubyXL/CT_GeomGuideList.html +2 -2
- data/rdoc/RubyXL/CT_GlowEffect.html +2 -2
- data/rdoc/RubyXL/CT_GradientFillProperties.html +2 -2
- data/rdoc/RubyXL/CT_GradientStop.html +2 -2
- data/rdoc/RubyXL/CT_GradientStopList.html +2 -2
- data/rdoc/RubyXL/CT_HSLEffect.html +2 -2
- data/rdoc/RubyXL/CT_HslColor.html +2 -2
- data/rdoc/RubyXL/CT_Hyperlink.html +2 -2
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +2 -2
- data/rdoc/RubyXL/CT_LightRig.html +2 -2
- data/rdoc/RubyXL/CT_LineEndProperties.html +2 -2
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +2 -2
- data/rdoc/RubyXL/CT_LineProperties.html +2 -2
- data/rdoc/RubyXL/CT_LineStyleList.html +2 -2
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +2 -2
- data/rdoc/RubyXL/CT_LuminanceEffect.html +2 -2
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +2 -2
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +2 -2
- data/rdoc/RubyXL/CT_Path2D.html +2 -2
- data/rdoc/RubyXL/CT_Path2DArcTo.html +2 -2
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +2 -2
- data/rdoc/RubyXL/CT_Path2DList.html +2 -2
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +2 -2
- data/rdoc/RubyXL/CT_Path2DTo.html +2 -2
- data/rdoc/RubyXL/CT_PathShadeProperties.html +2 -2
- data/rdoc/RubyXL/CT_PatternFillProperties.html +2 -2
- data/rdoc/RubyXL/CT_Point3D.html +2 -2
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +2 -2
- data/rdoc/RubyXL/CT_PresetColor.html +2 -2
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +2 -2
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +2 -2
- data/rdoc/RubyXL/CT_PresetTextShape.html +2 -2
- data/rdoc/RubyXL/CT_ReflectionEffect.html +2 -2
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +2 -2
- data/rdoc/RubyXL/CT_RelativeRect.html +2 -2
- data/rdoc/RubyXL/CT_SRgbColor.html +2 -2
- data/rdoc/RubyXL/CT_ScRgbColor.html +2 -2
- data/rdoc/RubyXL/CT_Scene3D.html +2 -2
- data/rdoc/RubyXL/CT_SchemeColor.html +2 -2
- data/rdoc/RubyXL/CT_Shape3D.html +2 -2
- data/rdoc/RubyXL/CT_ShapeStyle.html +2 -2
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +2 -2
- data/rdoc/RubyXL/CT_SphereCoords.html +2 -2
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +2 -2
- data/rdoc/RubyXL/CT_StyleMatrix.html +2 -2
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +2 -2
- data/rdoc/RubyXL/CT_SupplementalFont.html +2 -2
- data/rdoc/RubyXL/CT_SystemColor.html +2 -2
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +2 -2
- data/rdoc/RubyXL/CT_TextBlipBullet.html +2 -2
- data/rdoc/RubyXL/CT_TextCharBullet.html +2 -2
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +2 -2
- data/rdoc/RubyXL/CT_TextFont.html +2 -2
- data/rdoc/RubyXL/CT_TextListStyle.html +2 -2
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +2 -2
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +2 -2
- data/rdoc/RubyXL/CT_TextSpacing.html +2 -2
- data/rdoc/RubyXL/CT_TextTabStop.html +2 -2
- data/rdoc/RubyXL/CT_TextTabStopList.html +2 -2
- data/rdoc/RubyXL/CT_TileInfoProperties.html +2 -2
- data/rdoc/RubyXL/CT_TintEffect.html +2 -2
- data/rdoc/RubyXL/CT_Transform2D.html +2 -2
- data/rdoc/RubyXL/CT_TransformEffect.html +2 -2
- data/rdoc/RubyXL/CT_Vector3D.html +2 -2
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +2 -2
- data/rdoc/RubyXL/CalculationChain.html +3 -3
- data/rdoc/RubyXL/CalculationChainCell.html +2 -2
- data/rdoc/RubyXL/CalculationProperties.html +2 -2
- data/rdoc/RubyXL/Cell.html +2 -2
- data/rdoc/RubyXL/CellConvenienceMethods.html +37 -37
- data/rdoc/RubyXL/CellExt.html +2 -2
- data/rdoc/RubyXL/CellSmartTag.html +2 -2
- data/rdoc/RubyXL/CellSmartTagProperty.html +2 -2
- data/rdoc/RubyXL/CellSmartTags.html +2 -2
- data/rdoc/RubyXL/CellStyle.html +2 -2
- data/rdoc/RubyXL/CellStyleXFs.html +2 -2
- data/rdoc/RubyXL/CellStyles.html +3 -3
- data/rdoc/RubyXL/CellValue.html +2 -2
- data/rdoc/RubyXL/CellWatch.html +2 -2
- data/rdoc/RubyXL/CellWatches.html +2 -2
- data/rdoc/RubyXL/CellXFs.html +2 -2
- data/rdoc/RubyXL/ChartColorsFile.html +2 -2
- data/rdoc/RubyXL/ChartFile.html +2 -2
- data/rdoc/RubyXL/ChartStyleFile.html +2 -2
- data/rdoc/RubyXL/ChartUserShapesFile.html +2 -2
- data/rdoc/RubyXL/Chartsheet.html +3 -3
- data/rdoc/RubyXL/ChartsheetPageSetup.html +2 -2
- data/rdoc/RubyXL/ChartsheetProperties.html +2 -2
- data/rdoc/RubyXL/ChartsheetProtection.html +2 -2
- data/rdoc/RubyXL/ChartsheetView.html +2 -2
- data/rdoc/RubyXL/ChartsheetViews.html +2 -2
- data/rdoc/RubyXL/Color.html +4 -4
- data/rdoc/RubyXL/ColorFilter.html +2 -2
- data/rdoc/RubyXL/ColorScale.html +2 -2
- data/rdoc/RubyXL/ColorSet.html +2 -2
- data/rdoc/RubyXL/Colors.html +2 -2
- data/rdoc/RubyXL/ColumnRange.html +2 -2
- data/rdoc/RubyXL/ColumnRanges.html +2 -2
- data/rdoc/RubyXL/Comment.html +2 -2
- data/rdoc/RubyXL/CommentList.html +2 -2
- data/rdoc/RubyXL/CommentsFile.html +3 -3
- data/rdoc/RubyXL/ConditionalFormatValue.html +2 -2
- data/rdoc/RubyXL/ConditionalFormatting.html +2 -2
- data/rdoc/RubyXL/ConditionalFormattingRule.html +2 -2
- data/rdoc/RubyXL/ContentTypeDefault.html +2 -2
- data/rdoc/RubyXL/ContentTypeOverride.html +2 -2
- data/rdoc/RubyXL/ContentTypes.html +3 -3
- data/rdoc/RubyXL/ControlPropertiesFile.html +2 -2
- data/rdoc/RubyXL/CorePropertiesFile.html +3 -3
- data/rdoc/RubyXL/CustomColor.html +2 -2
- data/rdoc/RubyXL/CustomColorList.html +2 -2
- data/rdoc/RubyXL/CustomFilter.html +2 -2
- data/rdoc/RubyXL/CustomFilters.html +2 -2
- data/rdoc/RubyXL/CustomGeometry.html +2 -2
- data/rdoc/RubyXL/CustomProperties.html +2 -2
- data/rdoc/RubyXL/CustomPropertiesFile.html +2 -2
- data/rdoc/RubyXL/CustomProperty.html +2 -2
- data/rdoc/RubyXL/CustomSheetView.html +2 -2
- data/rdoc/RubyXL/CustomSheetViews.html +2 -2
- data/rdoc/RubyXL/CustomWorkbookView.html +2 -2
- data/rdoc/RubyXL/CustomWorkbookViews.html +2 -2
- data/rdoc/RubyXL/CustomXMLFile.html +2 -2
- data/rdoc/RubyXL/DXF.html +2 -2
- data/rdoc/RubyXL/DXFs.html +2 -2
- data/rdoc/RubyXL/DataBar.html +2 -2
- data/rdoc/RubyXL/DataConsolidate.html +2 -2
- data/rdoc/RubyXL/DataConsolidationReference.html +2 -2
- data/rdoc/RubyXL/DataConsolidationReferences.html +2 -2
- data/rdoc/RubyXL/DataType.html +2 -2
- data/rdoc/RubyXL/DataValidation.html +2 -2
- data/rdoc/RubyXL/DataValidations.html +2 -2
- data/rdoc/RubyXL/DateGroupItem.html +2 -2
- data/rdoc/RubyXL/DefinedName.html +2 -2
- data/rdoc/RubyXL/DefinedNameExt.html +2 -2
- data/rdoc/RubyXL/DefinedNames.html +2 -2
- data/rdoc/RubyXL/DefinedNamesExt.html +2 -2
- data/rdoc/RubyXL/DocumentPropertiesFile.html +8 -8
- data/rdoc/RubyXL/DrawingFile.html +2 -2
- data/rdoc/RubyXL/DynamicFilter.html +2 -2
- data/rdoc/RubyXL/EmbeddedControl.html +2 -2
- data/rdoc/RubyXL/EmbeddedControls.html +2 -2
- data/rdoc/RubyXL/Extension.html +2 -2
- data/rdoc/RubyXL/ExtensionStorageArea.html +2 -2
- data/rdoc/RubyXL/Extents.html +2 -2
- data/rdoc/RubyXL/ExternalBook.html +2 -2
- data/rdoc/RubyXL/ExternalLinksFile.html +3 -3
- data/rdoc/RubyXL/ExternalReference.html +2 -2
- data/rdoc/RubyXL/ExternalReferences.html +2 -2
- data/rdoc/RubyXL/ExtraColorSchemeList.html +2 -2
- data/rdoc/RubyXL/FieldItem.html +2 -2
- data/rdoc/RubyXL/FileRecoveryProperties.html +2 -2
- data/rdoc/RubyXL/FileSharing.html +2 -2
- data/rdoc/RubyXL/FileVersion.html +2 -2
- data/rdoc/RubyXL/Fill.html +2 -2
- data/rdoc/RubyXL/Fills.html +3 -3
- data/rdoc/RubyXL/FilterContainer.html +2 -2
- data/rdoc/RubyXL/FloatNode.html +2 -2
- data/rdoc/RubyXL/FloatValue.html +2 -2
- data/rdoc/RubyXL/Font.html +5 -5
- data/rdoc/RubyXL/FontScheme.html +2 -2
- data/rdoc/RubyXL/Fonts.html +2 -2
- data/rdoc/RubyXL/Formula.html +2 -2
- data/rdoc/RubyXL/FunctionGroup.html +2 -2
- data/rdoc/RubyXL/FunctionGroups.html +2 -2
- data/rdoc/RubyXL/GenericStorageObject.html +2 -2
- data/rdoc/RubyXL/GradientFill.html +2 -2
- data/rdoc/RubyXL/HeaderFooterSettings.html +2 -2
- data/rdoc/RubyXL/Hyperlink.html +2 -2
- data/rdoc/RubyXL/HyperlinkRelFile.html +2 -2
- data/rdoc/RubyXL/Hyperlinks.html +2 -2
- data/rdoc/RubyXL/IconFilter.html +2 -2
- data/rdoc/RubyXL/IconSet.html +2 -2
- data/rdoc/RubyXL/IgnoredError.html +2 -2
- data/rdoc/RubyXL/IgnoredErrors.html +2 -2
- data/rdoc/RubyXL/IndexedColors.html +2 -2
- data/rdoc/RubyXL/InputCells.html +2 -2
- data/rdoc/RubyXL/IntegerNode.html +2 -2
- data/rdoc/RubyXL/IntegerValue.html +2 -2
- data/rdoc/RubyXL/LegacyCell.html +2 -2
- data/rdoc/RubyXL/LegacyWorksheet.html +5 -162
- data/rdoc/RubyXL/MRUColors.html +2 -2
- data/rdoc/RubyXL/MacrosFile.html +2 -2
- data/rdoc/RubyXL/MergedCell.html +2 -2
- data/rdoc/RubyXL/MergedCells.html +2 -2
- data/rdoc/RubyXL/NumFmt.html +2 -2
- data/rdoc/RubyXL/NumberFormat.html +3 -3
- data/rdoc/RubyXL/NumberFormats.html +2 -2
- data/rdoc/RubyXL/OLEObject.html +2 -2
- data/rdoc/RubyXL/OLEObjectFile.html +2 -2
- data/rdoc/RubyXL/OLEObjects.html +2 -2
- data/rdoc/RubyXL/OLESize.html +2 -2
- data/rdoc/RubyXL/OOXMLContainerObject.html +8 -8
- data/rdoc/RubyXL/OOXMLObject.html +3 -3
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +14 -14
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +21 -19
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +7 -7
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +11 -11
- data/rdoc/RubyXL/Offset.html +2 -2
- data/rdoc/RubyXL/OutlineProperties.html +2 -2
- data/rdoc/RubyXL/PageMargins.html +2 -2
- data/rdoc/RubyXL/PageSetup.html +2 -2
- data/rdoc/RubyXL/PageSetupProperties.html +2 -2
- data/rdoc/RubyXL/Pane.html +2 -2
- data/rdoc/RubyXL/Parser.html +2 -2
- data/rdoc/RubyXL/PatternFill.html +2 -2
- data/rdoc/RubyXL/PhoneticProperties.html +2 -2
- data/rdoc/RubyXL/PhoneticRun.html +2 -2
- data/rdoc/RubyXL/PivotArea.html +2 -2
- data/rdoc/RubyXL/PivotCache.html +2 -2
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +2 -2
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +2 -2
- data/rdoc/RubyXL/PivotCaches.html +2 -2
- data/rdoc/RubyXL/PivotReference.html +2 -2
- data/rdoc/RubyXL/PivotReferences.html +2 -2
- data/rdoc/RubyXL/PivotTableFile.html +2 -2
- data/rdoc/RubyXL/PivotTableSelection.html +2 -2
- data/rdoc/RubyXL/PresetGeometry.html +2 -2
- data/rdoc/RubyXL/PrintOptions.html +2 -2
- data/rdoc/RubyXL/PrinterSettingsFile.html +2 -2
- data/rdoc/RubyXL/ProtectedRange.html +2 -2
- data/rdoc/RubyXL/ProtectedRanges.html +2 -2
- data/rdoc/RubyXL/Protection.html +2 -2
- data/rdoc/RubyXL/RID.html +2 -2
- data/rdoc/RubyXL/RawOOXML.html +2 -2
- data/rdoc/RubyXL/Reference.html +6 -6
- data/rdoc/RubyXL/Relationship.html +2 -2
- data/rdoc/RubyXL/RelationshipSupport.html +3 -3
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +2 -2
- data/rdoc/RubyXL/RichText.html +2 -2
- data/rdoc/RubyXL/RichTextRun.html +2 -2
- data/rdoc/RubyXL/Row.html +16 -2
- data/rdoc/RubyXL/RowExt.html +2 -2
- data/rdoc/RubyXL/RunProperties.html +2 -2
- data/rdoc/RubyXL/Scenario.html +2 -2
- data/rdoc/RubyXL/Scenarios.html +2 -2
- data/rdoc/RubyXL/Selection.html +2 -2
- data/rdoc/RubyXL/ShapeGuide.html +2 -2
- data/rdoc/RubyXL/ShapeTextRectangle.html +2 -2
- data/rdoc/RubyXL/SharedStringsTable.html +3 -3
- data/rdoc/RubyXL/Sheet.html +2 -2
- data/rdoc/RubyXL/SheetCalculationProperties.html +2 -2
- data/rdoc/RubyXL/SheetData.html +4 -4
- data/rdoc/RubyXL/SheetDataExt.html +2 -2
- data/rdoc/RubyXL/SheetDataSet.html +2 -2
- data/rdoc/RubyXL/SheetName.html +2 -2
- data/rdoc/RubyXL/SheetNames.html +2 -2
- data/rdoc/RubyXL/Sheets.html +2 -2
- data/rdoc/RubyXL/SlicerCacheFile.html +2 -2
- data/rdoc/RubyXL/SlicerFile.html +2 -2
- data/rdoc/RubyXL/SmartTagProperties.html +2 -2
- data/rdoc/RubyXL/SmartTagType.html +2 -2
- data/rdoc/RubyXL/SmartTagTypes.html +2 -2
- data/rdoc/RubyXL/SmartTags.html +2 -2
- data/rdoc/RubyXL/SortCondition.html +2 -2
- data/rdoc/RubyXL/SortState.html +2 -2
- data/rdoc/RubyXL/Sqref.html +3 -3
- data/rdoc/RubyXL/Stop.html +2 -2
- data/rdoc/RubyXL/StringNode.html +2 -2
- data/rdoc/RubyXL/StringNodeW3C.html +2 -2
- data/rdoc/RubyXL/StringValue.html +2 -2
- data/rdoc/RubyXL/Stylesheet.html +3 -3
- data/rdoc/RubyXL/TableFile.html +2 -2
- data/rdoc/RubyXL/TableParts.html +2 -2
- data/rdoc/RubyXL/TableStyle.html +2 -2
- data/rdoc/RubyXL/TableStyles.html +2 -2
- data/rdoc/RubyXL/Text.html +3 -3
- data/rdoc/RubyXL/Theme.html +5 -5
- data/rdoc/RubyXL/ThemeElements.html +2 -2
- data/rdoc/RubyXL/ThumbnailFile.html +2 -2
- data/rdoc/RubyXL/Top10.html +2 -2
- data/rdoc/RubyXL/VMLDrawingFile.html +3 -3
- data/rdoc/RubyXL/Variant.html +2 -2
- data/rdoc/RubyXL/Vector.html +2 -2
- data/rdoc/RubyXL/VectorValue.html +2 -2
- data/rdoc/RubyXL/VisualProperties.html +2 -2
- data/rdoc/RubyXL/WebPublishObject.html +2 -2
- data/rdoc/RubyXL/WebPublishObjects.html +2 -2
- data/rdoc/RubyXL/WebPublishingItem.html +2 -2
- data/rdoc/RubyXL/WebPublishingItems.html +2 -2
- data/rdoc/RubyXL/WebPublishingProperties.html +2 -2
- data/rdoc/RubyXL/Workbook.html +5 -5
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +34 -34
- data/rdoc/RubyXL/WorkbookProperties.html +2 -2
- data/rdoc/RubyXL/WorkbookProtection.html +2 -2
- data/rdoc/RubyXL/WorkbookRoot.html +2 -2
- data/rdoc/RubyXL/WorkbookView.html +2 -2
- data/rdoc/RubyXL/WorkbookViews.html +2 -2
- data/rdoc/RubyXL/Worksheet.html +4 -4
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +243 -208
- data/rdoc/RubyXL/WorksheetDimensions.html +2 -2
- data/rdoc/RubyXL/WorksheetFormatProperties.html +2 -2
- data/rdoc/RubyXL/WorksheetProperties.html +2 -2
- data/rdoc/RubyXL/WorksheetProtection.html +2 -2
- data/rdoc/RubyXL/WorksheetView.html +2 -2
- data/rdoc/RubyXL/WorksheetViews.html +2 -2
- data/rdoc/RubyXL/XF.html +2 -2
- data/rdoc/created.rid +28 -28
- data/rdoc/index.html +3 -3
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +2 -2
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +185 -195
- data/rubyXL.gemspec +13 -8
- data/spec/lib/cell_spec.rb +1 -2
- data/spec/lib/color_spec.rb +1 -2
- data/spec/lib/parser_spec.rb +3 -4
- data/spec/lib/reference_spec.rb +1 -2
- data/spec/lib/stylesheet_spec.rb +1 -2
- data/spec/lib/text_spec.rb +1 -1
- data/spec/lib/workbook_spec.rb +1 -2
- data/spec/lib/worksheet_spec.rb +1 -8
- data/spec/spec_helper.rb +11 -0
- metadata +38 -42
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA1:
|
|
3
|
+
metadata.gz: cbf354d127afcb15c81218739d5a092b8bb41de7
|
|
4
|
+
data.tar.gz: 504efe47d0b6bd8ec35965fda0db5fdab339c3e5
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: 1ce62590ad386c957c8e68db937b5702fc8aab86a0536414b6134f3c73d2b7db03c8426bb0fd43b77b6da9f6eb46405f798f1f8906bdcb609c7fa823a89b99df
|
|
7
|
+
data.tar.gz: 5f7c1c4ccca984714f663c79e9485db4e1d98aa49ee637168aa79fe0e2dc74351ae491bfd7ba777a16f78861f8eda6fac398f5de44f9e206d5a644c9f8d3d1d7
|
data/Gemfile
CHANGED
|
@@ -5,12 +5,12 @@ gem "nokogiri", ">= 1.4.4"
|
|
|
5
5
|
gem "rubyzip", ">= 1.1.6" , :require => 'zip'
|
|
6
6
|
|
|
7
7
|
# Development dependencies.
|
|
8
|
-
group :development do
|
|
8
|
+
group :development, :test do
|
|
9
9
|
gem "bundler"
|
|
10
10
|
gem "rake"
|
|
11
11
|
gem "jeweler"
|
|
12
|
-
|
|
13
|
-
gem "
|
|
12
|
+
gem "rspec"
|
|
13
|
+
gem "simplecov"
|
|
14
14
|
|
|
15
15
|
# gem 'stackprof'
|
|
16
16
|
gem 'ruby-prof'
|
data/README.rdoc
CHANGED
|
@@ -29,11 +29,15 @@ Please note that proprietary binary +xls+ format is *not* supported.
|
|
|
29
29
|
workbook['Sheet1'] # Finds and returns worksheet titled "Sheet1"
|
|
30
30
|
|
|
31
31
|
==== Accessing a Row (Array of Cells)
|
|
32
|
+
Please note that worksheets are sparse collections. Your code *must* expect that any row it encounters may be `nil`.
|
|
33
|
+
|
|
32
34
|
worksheet = workbook[0]
|
|
33
35
|
worksheet.sheet_data[0] # Returns first row of the worksheet
|
|
34
36
|
worksheet[0] # Returns first row of the worksheet
|
|
35
37
|
|
|
36
38
|
==== Accessing a Cell object
|
|
39
|
+
Please note that rows are sparse collections. Your code *must* expect that any cell it encounters may be `nil`.
|
|
40
|
+
|
|
37
41
|
worksheet = workbook[0]
|
|
38
42
|
worksheet.sheet_data[0][0] # Returns cell A1 in the worksheet
|
|
39
43
|
worksheet[0][0] # Returns cell A1 in the worksheet
|
|
@@ -47,7 +51,7 @@ Please note that proprietary binary +xls+ format is *not* supported.
|
|
|
47
51
|
cell.fill_color
|
|
48
52
|
cell.horizontal_alignment
|
|
49
53
|
cell.vertical_alignment
|
|
50
|
-
cell.
|
|
54
|
+
cell.get_border(:top)
|
|
51
55
|
|
|
52
56
|
==== Wrappers for accessing Row properties
|
|
53
57
|
Please note: these methods are being phased out in favor of the OOXML object model.
|
data/Rakefile
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# encoding: utf-8
|
|
2
2
|
require 'rubygems'
|
|
3
|
-
require 'bundler'
|
|
4
3
|
|
|
4
|
+
require 'bundler'
|
|
5
5
|
begin
|
|
6
6
|
Bundler.setup(:default, :development)
|
|
7
7
|
rescue Bundler::BundlerError => e
|
|
@@ -9,7 +9,6 @@ rescue Bundler::BundlerError => e
|
|
|
9
9
|
$stderr.puts "Run `bundle install` to install missing gems"
|
|
10
10
|
exit e.status_code
|
|
11
11
|
end
|
|
12
|
-
require 'rake'
|
|
13
12
|
|
|
14
13
|
require 'jeweler'
|
|
15
14
|
Jeweler::Tasks.new do |gem|
|
|
@@ -30,18 +29,9 @@ Rake::TestTask.new(:test) do |test|
|
|
|
30
29
|
test.libs << 'lib' << 'test'
|
|
31
30
|
test.pattern = 'test/**/test_*.rb'
|
|
32
31
|
test.verbose = true
|
|
32
|
+
test.warning = true
|
|
33
33
|
end
|
|
34
34
|
|
|
35
|
-
=begin
|
|
36
|
-
require 'rcov/rcovtask'
|
|
37
|
-
Rcov::RcovTask.new do |test|
|
|
38
|
-
test.libs << 'test'
|
|
39
|
-
test.pattern = 'test/**/test_*.rb'
|
|
40
|
-
test.verbose = true
|
|
41
|
-
test.rcov_opts << '--exclude "gems/*"'
|
|
42
|
-
end
|
|
43
|
-
=end
|
|
44
|
-
|
|
45
35
|
require 'rspec/core/rake_task'
|
|
46
36
|
RSpec::Core::RakeTask.new(:spec)
|
|
47
37
|
task :default => :spec
|
|
@@ -56,8 +46,8 @@ Rake::RDocTask.new do |rdoc|
|
|
|
56
46
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
57
47
|
end
|
|
58
48
|
|
|
59
|
-
desc "Dump profiling data"
|
|
60
|
-
task :
|
|
49
|
+
desc "Dump profiling data with stackprof"
|
|
50
|
+
task :stackprof do
|
|
61
51
|
require 'benchmark'
|
|
62
52
|
require 'stackprof'
|
|
63
53
|
|
|
@@ -83,8 +73,8 @@ task :profile do
|
|
|
83
73
|
}
|
|
84
74
|
end
|
|
85
75
|
|
|
86
|
-
desc "Dump profiling data
|
|
87
|
-
task :
|
|
76
|
+
desc "Dump profiling data with ruby-prof"
|
|
77
|
+
task :rubyprof do
|
|
88
78
|
require 'benchmark'
|
|
89
79
|
require 'ruby-prof'
|
|
90
80
|
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.3.
|
|
1
|
+
3.3.16
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
module RubyXL
|
|
2
|
+
|
|
2
3
|
module WorkbookConvenienceMethods
|
|
3
4
|
SHEET_NAME_TEMPLATE = 'Sheet%d'
|
|
4
5
|
|
|
@@ -208,7 +209,7 @@ module RubyXL
|
|
|
208
209
|
raise 'invalid shift option'
|
|
209
210
|
end
|
|
210
211
|
|
|
211
|
-
return add_cell(row,col,data,formula)
|
|
212
|
+
return add_cell(row, col, data, formula)
|
|
212
213
|
end
|
|
213
214
|
|
|
214
215
|
# by default, only sets cell to nil
|
|
@@ -324,13 +325,13 @@ module RubyXL
|
|
|
324
325
|
validate_workbook
|
|
325
326
|
validate_nonnegative(column_index)
|
|
326
327
|
|
|
327
|
-
#
|
|
328
|
+
# Delete column
|
|
328
329
|
sheet_data.rows.each { |row| row.cells.delete_at(column_index) }
|
|
329
330
|
|
|
330
|
-
#
|
|
331
|
+
# Update column numbers for cells to the right of the deleted column
|
|
331
332
|
sheet_data.rows.each_with_index { |row, row_index|
|
|
332
|
-
row.cells.each_with_index { |c,
|
|
333
|
-
c.column =
|
|
333
|
+
row.cells.each_with_index { |c, ci|
|
|
334
|
+
c.column = ci if c.is_a?(Cell)
|
|
334
335
|
}
|
|
335
336
|
}
|
|
336
337
|
|
|
@@ -380,7 +381,7 @@ module RubyXL
|
|
|
380
381
|
validate_workbook
|
|
381
382
|
validate_nonnegative(row)
|
|
382
383
|
row = sheet_data.rows[row]
|
|
383
|
-
row && row.ht ||
|
|
384
|
+
row && row.ht || RubyXL::Row::DEFAULT_HEIGHT
|
|
384
385
|
end
|
|
385
386
|
|
|
386
387
|
def get_row_border(row, border_direction)
|
|
@@ -473,6 +474,21 @@ module RubyXL
|
|
|
473
474
|
(width - (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)).round
|
|
474
475
|
end
|
|
475
476
|
|
|
477
|
+
# Set raw column width value
|
|
478
|
+
def change_column_width_raw(column_index, width)
|
|
479
|
+
validate_workbook
|
|
480
|
+
ensure_cell_exists(0, column_index)
|
|
481
|
+
range = cols.get_range(column_index)
|
|
482
|
+
range.width = width
|
|
483
|
+
range.custom_width = true
|
|
484
|
+
end
|
|
485
|
+
|
|
486
|
+
# Get column width measured in number of digits, as per
|
|
487
|
+
# http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx
|
|
488
|
+
def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)
|
|
489
|
+
change_column_width_raw(column_index, ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0)
|
|
490
|
+
end
|
|
491
|
+
|
|
476
492
|
# Helper method to get the style index for a column
|
|
477
493
|
def get_col_style(column_index)
|
|
478
494
|
range = cols.locate_range(column_index)
|
|
@@ -486,6 +502,19 @@ module RubyXL
|
|
|
486
502
|
@workbook.get_fill_color(get_col_xf(col))
|
|
487
503
|
end
|
|
488
504
|
|
|
505
|
+
def change_column_fill(column_index, color_code = 'ffffff')
|
|
506
|
+
validate_workbook
|
|
507
|
+
RubyXL::Color.validate_color(color_code)
|
|
508
|
+
ensure_cell_exists(0, column_index)
|
|
509
|
+
|
|
510
|
+
cols.get_range(column_index).style_index = @workbook.modify_fill(get_col_style(column_index), color_code)
|
|
511
|
+
|
|
512
|
+
sheet_data.rows.each { |row|
|
|
513
|
+
c = row[column_index]
|
|
514
|
+
c.change_fill(color_code) if c
|
|
515
|
+
}
|
|
516
|
+
end
|
|
517
|
+
|
|
489
518
|
def get_column_border(col, border_direction)
|
|
490
519
|
validate_workbook
|
|
491
520
|
|
|
@@ -725,70 +754,16 @@ module RubyXL
|
|
|
725
754
|
}
|
|
726
755
|
end
|
|
727
756
|
|
|
728
|
-
#
|
|
729
|
-
def
|
|
730
|
-
warn "[DEPRECATION] `#{__method__}` is deprecated. Please access data directly by iterating through .sheet_data.rows"
|
|
731
|
-
sheet_data.rows.map { |row|
|
|
732
|
-
row.cells.map { |c| c && c.value(args) } unless row.nil?
|
|
733
|
-
}
|
|
734
|
-
end
|
|
735
|
-
|
|
736
|
-
def get_table(headers = [], opts = {})
|
|
737
|
-
warn "[DEPRECATION] `#{__method__}` is deprecated. Please access data directly by iterating through .sheet_data.rows"
|
|
757
|
+
# Merges cells within a rectangular area
|
|
758
|
+
def merge_cells(start_row, start_col, end_row, end_col)
|
|
738
759
|
validate_workbook
|
|
739
760
|
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
table_hash = {}
|
|
745
|
-
table_hash[:table] = []
|
|
746
|
-
|
|
747
|
-
header_row = sheet_data[row_num]
|
|
748
|
-
header_row.cells.each_with_index { |header_cell, index|
|
|
749
|
-
break if index>0 && !opts[:last_header].nil? && !header_row[index-1].nil? && !header_row[index-1].value.nil? && header_row[index-1].value.to_s==opts[:last_header]
|
|
750
|
-
next if header_cell.nil? || header_cell.value.nil?
|
|
751
|
-
header = header_cell.value.to_s
|
|
752
|
-
table_hash[:sorted_headers]||=[]
|
|
753
|
-
table_hash[:sorted_headers] << header
|
|
754
|
-
table_hash[header] = []
|
|
755
|
-
|
|
756
|
-
original_row = row_num + 1
|
|
757
|
-
current_row = original_row
|
|
758
|
-
|
|
759
|
-
row = sheet_data.rows[current_row]
|
|
760
|
-
cell = row && row.cells[index]
|
|
761
|
-
|
|
762
|
-
# makes array of hashes in table_hash[:table]
|
|
763
|
-
# as well as hash of arrays in table_hash[header]
|
|
764
|
-
table_index = current_row - original_row
|
|
765
|
-
cell_test = (!cell.nil? && !cell.value.nil?)
|
|
766
|
-
|
|
767
|
-
while cell_test || (table_hash[:table][table_index] && !table_hash[:table][table_index].empty?)
|
|
768
|
-
table_hash[header] << cell.value if cell_test
|
|
769
|
-
table_index = current_row - original_row
|
|
770
|
-
|
|
771
|
-
if cell_test then
|
|
772
|
-
table_hash[:table][table_index] ||= {}
|
|
773
|
-
table_hash[:table][table_index][header] = cell.value
|
|
774
|
-
end
|
|
775
|
-
|
|
776
|
-
current_row += 1
|
|
777
|
-
if sheet_data.rows[current_row].nil? then
|
|
778
|
-
cell = nil
|
|
779
|
-
else
|
|
780
|
-
cell = sheet_data.rows[current_row].cells[index]
|
|
781
|
-
end
|
|
782
|
-
cell_test = (!cell.nil? && !cell.value.nil?)
|
|
783
|
-
end
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
return table_hash
|
|
761
|
+
self.merged_cells ||= RubyXL::MergedCells.new
|
|
762
|
+
# TODO: add validation to make sure ranges are not intersecting with existing ones
|
|
763
|
+
merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(start_row, end_row, start_col, end_col))
|
|
787
764
|
end
|
|
788
|
-
|
|
789
765
|
end
|
|
790
766
|
|
|
791
|
-
|
|
792
767
|
module CellConvenienceMethods
|
|
793
768
|
|
|
794
769
|
def change_contents(data, formula_expression = nil)
|
|
@@ -218,6 +218,8 @@ module RubyXL
|
|
|
218
218
|
private :obtain_class_variable
|
|
219
219
|
|
|
220
220
|
def initialize(params = {})
|
|
221
|
+
@local_namespaces = nil
|
|
222
|
+
|
|
221
223
|
obtain_class_variable(:@@ooxml_attributes).each_value { |v|
|
|
222
224
|
instance_variable_set("@#{v[:accessor]}", params[v[:accessor]]) unless v[:computed]
|
|
223
225
|
}
|
|
@@ -300,7 +302,7 @@ module RubyXL
|
|
|
300
302
|
elem = xml.create_element(node_name_override || obtain_class_variable(:@@ooxml_tag_name), attrs, element_text)
|
|
301
303
|
|
|
302
304
|
if @local_namespaces.nil? || @local_namespaces.empty? then # If no local namespaces provided in the original document,
|
|
303
|
-
# use the
|
|
305
|
+
# use the defaults
|
|
304
306
|
obtain_class_variable(:@@ooxml_namespaces).each_pair { |k, v| elem.add_namespace_definition(v, k) }
|
|
305
307
|
else # otherwise preserve the original ones
|
|
306
308
|
@local_namespaces.each { |ns| elem.add_namespace_definition(ns.prefix, ns.href) }
|
data/lib/rubyXL/objects/text.rb
CHANGED
data/lib/rubyXL/worksheet.rb
CHANGED
|
@@ -23,59 +23,6 @@ module LegacyWorksheet
|
|
|
23
23
|
sheet_data.rows.each { |row| yield(row) }
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
-
# finds first row which contains at least all strings in cells_content
|
|
27
|
-
def find_first_row_with_content(cells_content)
|
|
28
|
-
validate_workbook
|
|
29
|
-
|
|
30
|
-
sheet_data.rows.each_with_index { |row, index|
|
|
31
|
-
next if row.nil?
|
|
32
|
-
cells_content = cells_content.map { |header| header.to_s.strip.downcase }
|
|
33
|
-
original_cells_content = row.cells.map { |cell| (cell && cell.value).to_s.strip.downcase }
|
|
34
|
-
|
|
35
|
-
if (cells_content & original_cells_content).size == cells_content.size
|
|
36
|
-
return index
|
|
37
|
-
end
|
|
38
|
-
}
|
|
39
|
-
return nil
|
|
40
|
-
end
|
|
41
|
-
private :find_first_row_with_content
|
|
42
|
-
|
|
43
|
-
# Set raw column width value
|
|
44
|
-
def change_column_width_raw(column_index, width)
|
|
45
|
-
validate_workbook
|
|
46
|
-
ensure_cell_exists(0, column_index)
|
|
47
|
-
range = cols.get_range(column_index)
|
|
48
|
-
range.width = width
|
|
49
|
-
range.custom_width = true
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
# Get column width measured in number of digits, as per
|
|
53
|
-
# http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx
|
|
54
|
-
def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)
|
|
55
|
-
change_column_width_raw(column_index, ((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0)
|
|
56
|
-
end
|
|
57
|
-
|
|
58
|
-
def change_column_fill(column_index, color_index='ffffff')
|
|
59
|
-
validate_workbook
|
|
60
|
-
Color.validate_color(color_index)
|
|
61
|
-
ensure_cell_exists(0, column_index)
|
|
62
|
-
|
|
63
|
-
cols.get_range(column_index).style_index = @workbook.modify_fill(get_col_style(column_index), color_index)
|
|
64
|
-
|
|
65
|
-
sheet_data.rows.each { |row|
|
|
66
|
-
c = row[column_index]
|
|
67
|
-
c.change_fill(color_index) if c
|
|
68
|
-
}
|
|
69
|
-
end
|
|
70
|
-
|
|
71
|
-
# merges cells within a rectangular range
|
|
72
|
-
def merge_cells(row1 = 0, col1 = 0, row2 = 0, col2 = 0)
|
|
73
|
-
validate_workbook
|
|
74
|
-
|
|
75
|
-
self.merged_cells ||= RubyXL::MergedCells.new
|
|
76
|
-
merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(row1, row2, col1, col2))
|
|
77
|
-
end
|
|
78
|
-
|
|
79
26
|
def add_row(row_index = 0, params = {})
|
|
80
27
|
new_row = RubyXL::Row.new(params)
|
|
81
28
|
new_row.worksheet = self
|
|
@@ -118,13 +65,13 @@ module LegacyWorksheet
|
|
|
118
65
|
raise "This worksheet #{self} is not in workbook #{@workbook}"
|
|
119
66
|
end
|
|
120
67
|
|
|
121
|
-
# Ensures that cell with +row_index+ and +column_index+
|
|
122
|
-
#
|
|
68
|
+
# Ensures that storage space for a cell with +row_index+ and +column_index+
|
|
69
|
+
# exists in +sheet_data+ arrays, growing them up if necessary.
|
|
123
70
|
def ensure_cell_exists(row_index, column_index = 0)
|
|
124
71
|
validate_nonnegative(row_index)
|
|
125
72
|
validate_nonnegative(column_index)
|
|
126
73
|
|
|
127
|
-
|
|
74
|
+
sheet_data.rows[row_index] || add_row(row_index)
|
|
128
75
|
end
|
|
129
76
|
|
|
130
77
|
def get_col_xf(column_index)
|
data/rdoc/README_rdoc.html
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
<head>
|
|
5
5
|
<meta charset="UTF-8">
|
|
6
6
|
|
|
7
|
-
<title>README - rubyXL 3.3.
|
|
7
|
+
<title>README - rubyXL 3.3.16</title>
|
|
8
8
|
|
|
9
9
|
<script type="text/javascript">
|
|
10
10
|
var rdoc_rel_prefix = "./";
|
|
@@ -138,7 +138,7 @@ preserving as much of the structure as possible.</p>
|
|
|
138
138
|
|
|
139
139
|
<h2 id="label-To+Use-3A">To Use:<span><a href="#label-To+Use-3A">¶</a> <a href="#top">↑</a></span></h2>
|
|
140
140
|
|
|
141
|
-
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string"
|
|
141
|
+
<pre class="ruby"><span class="ruby-identifier">require</span> <span class="ruby-string">'rubyXL'</span> <span class="ruby-comment"># Assuming rubygems is already required</span>
|
|
142
142
|
</pre>
|
|
143
143
|
|
|
144
144
|
<h3 id="label-Parsing+an+existing+workbook">Parsing an existing workbook<span><a href="#label-Parsing+an+existing+workbook">¶</a> <a href="#top">↑</a></span></h3>
|
|
@@ -157,11 +157,14 @@ preserving as much of the structure as possible.</p>
|
|
|
157
157
|
|
|
158
158
|
<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>
|
|
159
159
|
<span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first worksheet</span>
|
|
160
|
-
<span class="ruby-identifier">workbook</span>[<span class="ruby-string"
|
|
160
|
+
<span class="ruby-identifier">workbook</span>[<span class="ruby-string">'Sheet1'</span>] <span class="ruby-comment"># Finds and returns worksheet titled "Sheet1"</span>
|
|
161
161
|
</pre>
|
|
162
162
|
|
|
163
163
|
<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">¶</a> <a href="#top">↑</a></span></h4>
|
|
164
164
|
|
|
165
|
+
<p>Please note that worksheets are sparse collections. Your code
|
|
166
|
+
<strong>must</strong> expect that any row it encounters may be `nil`.</p>
|
|
167
|
+
|
|
165
168
|
<pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
|
|
166
169
|
<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>
|
|
167
170
|
<span class="ruby-identifier">worksheet</span>[<span class="ruby-value">0</span>] <span class="ruby-comment"># Returns first row of the worksheet</span>
|
|
@@ -169,6 +172,9 @@ preserving as much of the structure as possible.</p>
|
|
|
169
172
|
|
|
170
173
|
<h4 id="label-Accessing+a+Cell+object">Accessing a Cell object<span><a href="#label-Accessing+a+Cell+object">¶</a> <a href="#top">↑</a></span></h4>
|
|
171
174
|
|
|
175
|
+
<p>Please note that rows are sparse collections. Your code
|
|
176
|
+
<strong>must</strong> expect that any cell it encounters may be `nil`.</p>
|
|
177
|
+
|
|
172
178
|
<pre class="ruby"><span class="ruby-identifier">worksheet</span> = <span class="ruby-identifier">workbook</span>[<span class="ruby-value">0</span>]
|
|
173
179
|
<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>
|
|
174
180
|
<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>
|
|
@@ -184,7 +190,7 @@ preserving as much of the structure as possible.</p>
|
|
|
184
190
|
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">fill_color</span>
|
|
185
191
|
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">horizontal_alignment</span>
|
|
186
192
|
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">vertical_alignment</span>
|
|
187
|
-
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">
|
|
193
|
+
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">get_border</span>(:<span class="ruby-identifier">top</span>)
|
|
188
194
|
</pre>
|
|
189
195
|
|
|
190
196
|
<h4 id="label-Wrappers+for+accessing+Row+properties+">Wrappers for accessing Row properties <span><a href="#label-Wrappers+for+accessing+Row+properties+">¶</a> <a href="#top">↑</a></span></h4>
|
|
@@ -239,18 +245,18 @@ You should access and iterate through rows and cells directly:</p>
|
|
|
239
245
|
|
|
240
246
|
<h4 id="label-Adding+Worksheets">Adding Worksheets<span><a href="#label-Adding+Worksheets">¶</a> <a href="#top">↑</a></span></h4>
|
|
241
247
|
|
|
242
|
-
<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"
|
|
248
|
+
<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">'Sheet2'</span>)
|
|
243
249
|
</pre>
|
|
244
250
|
|
|
245
251
|
<h4 id="label-Renaming+Worksheets">Renaming Worksheets<span><a href="#label-Renaming+Worksheets">¶</a> <a href="#top">↑</a></span></h4>
|
|
246
252
|
|
|
247
|
-
<pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_name</span> = <span class="ruby-string"
|
|
253
|
+
<pre class="ruby"><span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">sheet_name</span> = <span class="ruby-string">'Cool New Name'</span>
|
|
248
254
|
</pre>
|
|
249
255
|
|
|
250
256
|
<h4 id="label-Adding+Cells">Adding Cells<span><a href="#label-Adding+Cells">¶</a> <a href="#top">↑</a></span></h4>
|
|
251
257
|
|
|
252
|
-
<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"
|
|
253
|
-
<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"
|
|
258
|
+
<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">'A1'</span>) <span class="ruby-comment"># Sets cell A1 to string "A1"</span>
|
|
259
|
+
<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">''</span>, <span class="ruby-string">'A1'</span>) <span class="ruby-comment"># Sets formula in the cell B1 to '=A1'</span>
|
|
254
260
|
</pre>
|
|
255
261
|
|
|
256
262
|
<h4 id="label-Changing+Cells">Changing Cells<span><a href="#label-Changing+Cells">¶</a> <a href="#top">↑</a></span></h4>
|
|
@@ -262,23 +268,23 @@ You should access and iterate through rows and cells directly:</p>
|
|
|
262
268
|
|
|
263
269
|
<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>
|
|
264
270
|
<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>
|
|
265
|
-
<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"
|
|
271
|
+
<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">'Courier'</span>) <span class="ruby-comment"># Makes first column have font Courier</span>
|
|
266
272
|
</pre>
|
|
267
273
|
|
|
268
274
|
<h4 id="label-Changing+Fills+++++">Changing Fills <span><a href="#label-Changing+Fills+++++">¶</a> <a href="#top">↑</a></span></h4>
|
|
269
275
|
|
|
270
|
-
<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"
|
|
271
|
-
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string"
|
|
272
|
-
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string"
|
|
276
|
+
<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">'0ba53d'</span>) <span class="ruby-comment"># Sets A1 to have fill #0ba53d</span>
|
|
277
|
+
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string">'0ba53d'</span>) <span class="ruby-comment"># Sets first row to have fill #0ba53d</span>
|
|
278
|
+
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_fill</span>(<span class="ruby-value">0</span>, <span class="ruby-string">'0ba53d'</span>) <span class="ruby-comment"># Sets first column to have fill #0ba53d</span>
|
|
273
279
|
</pre>
|
|
274
280
|
|
|
275
281
|
<h4 id="label-Changing+Borders">Changing Borders<span><a href="#label-Changing+Borders">¶</a> <a href="#top">↑</a></span></h4>
|
|
276
282
|
|
|
277
283
|
<pre class="ruby"><span class="ruby-comment"># Possible weights: hairline, thin, medium, thick</span>
|
|
278
284
|
<span class="ruby-comment"># Possible "directions": top, bottom, left, right, diagonal</span>
|
|
279
|
-
<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-identifier">top</span>, <span class="ruby-string"
|
|
280
|
-
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_border</span>(<span class="ruby-value">0</span>, :<span class="ruby-identifier">left</span>, <span class="ruby-string"
|
|
281
|
-
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_border</span>(<span class="ruby-value">0</span>, :<span class="ruby-identifier">diagonal</span>, <span class="ruby-string"
|
|
285
|
+
<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-identifier">top</span>, <span class="ruby-string">'thin'</span>) <span class="ruby-comment"># Sets A1 to have a top, thin border</span>
|
|
286
|
+
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_row_border</span>(<span class="ruby-value">0</span>, :<span class="ruby-identifier">left</span>, <span class="ruby-string">'hairline'</span>) <span class="ruby-comment"># Sets first row to have a left, hairline border</span>
|
|
287
|
+
<span class="ruby-identifier">worksheet</span>.<span class="ruby-identifier">change_column_border</span>(<span class="ruby-value">0</span>, :<span class="ruby-identifier">diagonal</span>, <span class="ruby-string">'medium'</span>) <span class="ruby-comment"># Sets first column to have diagonal, medium border</span>
|
|
282
288
|
</pre>
|
|
283
289
|
|
|
284
290
|
<h4 id="label-Changing+Alignment">Changing Alignment<span><a href="#label-Changing+Alignment">¶</a> <a href="#top">↑</a></span></h4>
|
|
@@ -287,18 +293,18 @@ You should access and iterate through rows and cells directly:</p>
|
|
|
287
293
|
|
|
288
294
|
<p>center, distributed, justify, left, right</p>
|
|
289
295
|
|
|
290
|
-
<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_horizontal_alignment</span>(<span class="ruby-string"
|
|
291
|
-
<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"
|
|
292
|
-
<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"
|
|
296
|
+
<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_horizontal_alignment</span>(<span class="ruby-string">'center'</span>) <span class="ruby-comment"># Sets A1 to be centered</span>
|
|
297
|
+
<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">'justify'</span>) <span class="ruby-comment"># Sets first row to be justified</span>
|
|
298
|
+
<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">'right'</span>) <span class="ruby-comment"># Sets first column to be right-aligned</span>
|
|
293
299
|
</pre>
|
|
294
300
|
|
|
295
301
|
<h5 id="label-Vertical">Vertical<span><a href="#label-Vertical">¶</a> <a href="#top">↑</a></span></h5>
|
|
296
302
|
|
|
297
303
|
<p>bottom, center, distributed, top</p>
|
|
298
304
|
|
|
299
|
-
<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_vertical_alignment</span>(<span class="ruby-string"
|
|
300
|
-
<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"
|
|
301
|
-
<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"
|
|
305
|
+
<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_vertical_alignment</span>(<span class="ruby-string">'bottom'</span>) <span class="ruby-comment"># Sets A1 to be bottom aligned</span>
|
|
306
|
+
<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">'distributed'</span>) <span class="ruby-comment"># Sets first row to be distributed vertically</span>
|
|
307
|
+
<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">'top'</span>) <span class="ruby-comment"># Sets first column to be top aligned</span>
|
|
302
308
|
</pre>
|
|
303
309
|
|
|
304
310
|
<h4 id="label-Changing+Row+Height">Changing Row Height<span><a href="#label-Changing+Row+Height">¶</a> <a href="#top">↑</a></span></h4>
|
|
@@ -392,7 +398,7 @@ have been moved, as the formulas do not adapt to the shifted cells</p>
|
|
|
392
398
|
<h4 id="label-Modifying+Cell+Format">Modifying Cell Format<span><a href="#label-Modifying+Cell+Format">¶</a> <a href="#top">↑</a></span></h4>
|
|
393
399
|
|
|
394
400
|
<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>]
|
|
395
|
-
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">set_number_format</span> <span class="ruby-string"
|
|
401
|
+
<span class="ruby-identifier">cell</span>.<span class="ruby-identifier">set_number_format</span> <span class="ruby-string">'0.0000%'</span> <span class="ruby-comment"># For formats, see https://support.office.com/en-us/article/5026bbd6-04bc-48cd-bf33-80f18b4eae68</span>
|
|
396
402
|
</pre>
|
|
397
403
|
|
|
398
404
|
<h2 id="label-I-2FO">I/O<span><a href="#label-I-2FO">¶</a> <a href="#top">↑</a></span></h2>
|
|
@@ -413,8 +419,8 @@ handy for web servers.</p>
|
|
|
413
419
|
|
|
414
420
|
<h2 id="label-Miscellaneous">Miscellaneous<span><a href="#label-Miscellaneous">¶</a> <a href="#top">↑</a></span></h2>
|
|
415
421
|
|
|
416
|
-
<pre class="ruby"><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"
|
|
417
|
-
<span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-string"
|
|
422
|
+
<pre class="ruby"><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">'A1'</span> <span class="ruby-comment"># Converts row and column index to Excel-style cell reference</span>
|
|
423
|
+
<span class="ruby-constant">Reference</span>.<span class="ruby-identifier">ref2ind</span>(<span class="ruby-string">'A1'</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>
|
|
418
424
|
</pre>
|
|
419
425
|
|
|
420
426
|
<h2 id="label-For+more+information">For more information<span><a href="#label-For+more+information">¶</a> <a href="#top">↑</a></span></h2>
|
|
@@ -423,11 +429,11 @@ handy for web servers.</p>
|
|
|
423
429
|
|
|
424
430
|
<h2 id="label-Contributing+to+rubyXL">Contributing to rubyXL<span><a href="#label-Contributing+to+rubyXL">¶</a> <a href="#top">↑</a></span></h2>
|
|
425
431
|
<ul><li>
|
|
426
|
-
<p>Check out the latest master to make sure the feature hasn
|
|
427
|
-
implemented or the bug hasn
|
|
432
|
+
<p>Check out the latest master to make sure the feature hasn't been
|
|
433
|
+
implemented or the bug hasn't been fixed yet</p>
|
|
428
434
|
</li><li>
|
|
429
|
-
<p>Check out the issue tracker to make sure someone already hasn
|
|
430
|
-
it and/or contributed it</p>
|
|
435
|
+
<p>Check out the issue tracker to make sure someone already hasn't
|
|
436
|
+
requested it and/or contributed it</p>
|
|
431
437
|
</li><li>
|
|
432
438
|
<p>Fork the project</p>
|
|
433
439
|
</li><li>
|
|
@@ -435,8 +441,8 @@ it and/or contributed it</p>
|
|
|
435
441
|
</li><li>
|
|
436
442
|
<p>Commit and push until you are happy with your contribution</p>
|
|
437
443
|
</li><li>
|
|
438
|
-
<p>Make sure to add tests for it. This is important so I don
|
|
439
|
-
future version unintentionally.</p>
|
|
444
|
+
<p>Make sure to add tests for it. This is important so I don't break it in
|
|
445
|
+
a future version unintentionally.</p>
|
|
440
446
|
</li><li>
|
|
441
447
|
<p>Please try not to mess with the Rakefile, version, or history. If you want
|
|
442
448
|
to have your own version, or is otherwise necessary, that is fine, but
|
|
@@ -453,7 +459,7 @@ further details.</p>
|
|
|
453
459
|
|
|
454
460
|
<footer id="validator-badges" role="contentinfo">
|
|
455
461
|
<p><a href="http://validator.w3.org/check/referer">Validate</a>
|
|
456
|
-
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.
|
|
462
|
+
<p>Generated by <a href="http://docs.seattlerb.org/rdoc/">RDoc</a> 4.2.1.
|
|
457
463
|
<p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
|
|
458
464
|
</footer>
|
|
459
465
|
|