rubyXL 3.4.38 → 3.4.39
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 +4 -4
- data/Gemfile +4 -1
- data/README.rdoc +3 -4
- data/Rakefile +18 -13
- data/VERSION +1 -1
- data/lib/rubyXL/cell.rb +2 -2
- data/lib/rubyXL/convenience_methods/cell.rb +13 -6
- data/lib/rubyXL/convenience_methods/worksheet.rb +41 -30
- data/lib/rubyXL/objects/border.rb +9 -6
- data/lib/rubyXL/objects/cell_style.rb +2 -0
- data/lib/rubyXL/objects/color.rb +3 -1
- data/lib/rubyXL/objects/container_nodes.rb +2 -0
- data/lib/rubyXL/objects/fill.rb +2 -0
- data/lib/rubyXL/objects/font.rb +2 -0
- data/lib/rubyXL/objects/ooxml_object.rb +16 -16
- data/lib/rubyXL/objects/reference.rb +38 -33
- data/lib/rubyXL/objects/root.rb +8 -1
- data/lib/rubyXL/objects/sheet_data.rb +7 -2
- data/lib/rubyXL/objects/simple_types.rb +101 -98
- data/lib/rubyXL/objects/workbook.rb +5 -5
- data/lib/rubyXL/objects/worksheet.rb +23 -4
- data/lib/rubyXL/worksheet.rb +5 -17
- data/rdoc/README_rdoc.html +8 -8
- data/rdoc/RubyXL/AExtension.html +5 -5
- data/rdoc/RubyXL/AExtensionStorageArea.html +5 -5
- data/rdoc/RubyXL/ActiveX.html +5 -5
- data/rdoc/RubyXL/ActiveXBinary.html +5 -5
- data/rdoc/RubyXL/AdjustHandleList.html +5 -5
- data/rdoc/RubyXL/Alignment.html +5 -5
- data/rdoc/RubyXL/AlternateContent.html +5 -5
- data/rdoc/RubyXL/AlternateUrls.html +5 -5
- data/rdoc/RubyXL/Authors.html +5 -5
- data/rdoc/RubyXL/AutoFilter.html +5 -5
- data/rdoc/RubyXL/AutoFilterColumn.html +5 -5
- data/rdoc/RubyXL/BinaryImageFile.html +5 -5
- data/rdoc/RubyXL/BodyProperties.html +5 -5
- data/rdoc/RubyXL/BooleanNode.html +5 -5
- data/rdoc/RubyXL/BooleanValue.html +5 -5
- data/rdoc/RubyXL/Border.html +14 -13
- data/rdoc/RubyXL/BorderEdge.html +10 -10
- data/rdoc/RubyXL/Borders.html +6 -6
- data/rdoc/RubyXL/Break.html +5 -5
- data/rdoc/RubyXL/BreakList.html +5 -5
- data/rdoc/RubyXL/CT_AdjPoint2D.html +5 -5
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +5 -5
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +5 -5
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +5 -5
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +5 -5
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +5 -5
- data/rdoc/RubyXL/CT_Backdrop.html +5 -5
- data/rdoc/RubyXL/CT_Bevel.html +5 -5
- data/rdoc/RubyXL/CT_BiLevelEffect.html +5 -5
- data/rdoc/RubyXL/CT_BlendEffect.html +5 -5
- data/rdoc/RubyXL/CT_Blip.html +5 -5
- data/rdoc/RubyXL/CT_BlipFillProperties.html +5 -5
- data/rdoc/RubyXL/CT_BlurEffect.html +5 -5
- data/rdoc/RubyXL/CT_Camera.html +5 -5
- data/rdoc/RubyXL/CT_Color.html +5 -5
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +5 -5
- data/rdoc/RubyXL/CT_ColorMapping.html +5 -5
- data/rdoc/RubyXL/CT_ColorScheme.html +5 -5
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +5 -5
- data/rdoc/RubyXL/CT_ConnectionSite.html +5 -5
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +5 -5
- data/rdoc/RubyXL/CT_DashStop.html +5 -5
- data/rdoc/RubyXL/CT_DashStopList.html +5 -5
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +5 -5
- data/rdoc/RubyXL/CT_DuotoneEffect.html +5 -5
- data/rdoc/RubyXL/CT_EffectContainer.html +5 -5
- data/rdoc/RubyXL/CT_EffectList.html +5 -5
- data/rdoc/RubyXL/CT_EffectReference.html +5 -5
- data/rdoc/RubyXL/CT_EffectStyleItem.html +5 -5
- data/rdoc/RubyXL/CT_EffectStyleList.html +5 -5
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +5 -5
- data/rdoc/RubyXL/CT_FillEffect.html +5 -5
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +5 -5
- data/rdoc/RubyXL/CT_FillStyleList.html +5 -5
- data/rdoc/RubyXL/CT_FlatText.html +5 -5
- data/rdoc/RubyXL/CT_FontCollection.html +5 -5
- data/rdoc/RubyXL/CT_FontReference.html +5 -5
- data/rdoc/RubyXL/CT_GeomGuideList.html +5 -5
- data/rdoc/RubyXL/CT_GlowEffect.html +5 -5
- data/rdoc/RubyXL/CT_GradientFillProperties.html +5 -5
- data/rdoc/RubyXL/CT_GradientStop.html +5 -5
- data/rdoc/RubyXL/CT_GradientStopList.html +5 -5
- data/rdoc/RubyXL/CT_HSLEffect.html +5 -5
- data/rdoc/RubyXL/CT_HslColor.html +5 -5
- data/rdoc/RubyXL/CT_Hyperlink.html +5 -5
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +5 -5
- data/rdoc/RubyXL/CT_LightRig.html +5 -5
- data/rdoc/RubyXL/CT_LineEndProperties.html +5 -5
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +5 -5
- data/rdoc/RubyXL/CT_LineProperties.html +5 -5
- data/rdoc/RubyXL/CT_LineStyleList.html +5 -5
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +5 -5
- data/rdoc/RubyXL/CT_LuminanceEffect.html +5 -5
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +5 -5
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +5 -5
- data/rdoc/RubyXL/CT_Path2D.html +5 -5
- data/rdoc/RubyXL/CT_Path2DArcTo.html +5 -5
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +5 -5
- data/rdoc/RubyXL/CT_Path2DList.html +5 -5
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +5 -5
- data/rdoc/RubyXL/CT_Path2DTo.html +5 -5
- data/rdoc/RubyXL/CT_PathShadeProperties.html +5 -5
- data/rdoc/RubyXL/CT_PatternFillProperties.html +5 -5
- data/rdoc/RubyXL/CT_Point3D.html +5 -5
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +5 -5
- data/rdoc/RubyXL/CT_PresetColor.html +5 -5
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +5 -5
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +5 -5
- data/rdoc/RubyXL/CT_PresetTextShape.html +5 -5
- data/rdoc/RubyXL/CT_ReflectionEffect.html +5 -5
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +5 -5
- data/rdoc/RubyXL/CT_RelativeRect.html +5 -5
- data/rdoc/RubyXL/CT_SRgbColor.html +5 -5
- data/rdoc/RubyXL/CT_ScRgbColor.html +5 -5
- data/rdoc/RubyXL/CT_Scene3D.html +5 -5
- data/rdoc/RubyXL/CT_SchemeColor.html +5 -5
- data/rdoc/RubyXL/CT_Shape3D.html +5 -5
- data/rdoc/RubyXL/CT_ShapeStyle.html +5 -5
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +5 -5
- data/rdoc/RubyXL/CT_SphereCoords.html +5 -5
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +5 -5
- data/rdoc/RubyXL/CT_StyleMatrix.html +5 -5
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +5 -5
- data/rdoc/RubyXL/CT_SupplementalFont.html +5 -5
- data/rdoc/RubyXL/CT_SystemColor.html +5 -5
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +5 -5
- data/rdoc/RubyXL/CT_TextBlipBullet.html +5 -5
- data/rdoc/RubyXL/CT_TextCharBullet.html +5 -5
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +5 -5
- data/rdoc/RubyXL/CT_TextFont.html +5 -5
- data/rdoc/RubyXL/CT_TextListStyle.html +5 -5
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +5 -5
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +5 -5
- data/rdoc/RubyXL/CT_TextSpacing.html +5 -5
- data/rdoc/RubyXL/CT_TextTabStop.html +5 -5
- data/rdoc/RubyXL/CT_TextTabStopList.html +5 -5
- data/rdoc/RubyXL/CT_TileInfoProperties.html +5 -5
- data/rdoc/RubyXL/CT_TintEffect.html +5 -5
- data/rdoc/RubyXL/CT_Transform2D.html +5 -5
- data/rdoc/RubyXL/CT_TransformEffect.html +5 -5
- data/rdoc/RubyXL/CT_Vector3D.html +5 -5
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +5 -5
- data/rdoc/RubyXL/CalculationChain.html +5 -5
- data/rdoc/RubyXL/CalculationChainCell.html +5 -5
- data/rdoc/RubyXL/CalculationProperties.html +5 -5
- data/rdoc/RubyXL/Cell.html +6 -6
- data/rdoc/RubyXL/CellConvenienceMethods.html +69 -48
- data/rdoc/RubyXL/CellExt.html +5 -5
- data/rdoc/RubyXL/CellSmartTag.html +5 -5
- data/rdoc/RubyXL/CellSmartTagProperty.html +5 -5
- data/rdoc/RubyXL/CellSmartTags.html +5 -5
- data/rdoc/RubyXL/CellStyle.html +5 -5
- data/rdoc/RubyXL/CellStyleXFs.html +5 -5
- data/rdoc/RubyXL/CellStyles.html +5 -5
- data/rdoc/RubyXL/CellValue.html +5 -5
- data/rdoc/RubyXL/CellWatch.html +5 -5
- data/rdoc/RubyXL/CellWatches.html +5 -5
- data/rdoc/RubyXL/CellXFs.html +5 -5
- data/rdoc/RubyXL/ChartColorsFile.html +5 -5
- data/rdoc/RubyXL/ChartFile.html +5 -5
- data/rdoc/RubyXL/ChartStyleFile.html +5 -5
- data/rdoc/RubyXL/ChartUserShapesFile.html +5 -5
- data/rdoc/RubyXL/Chartsheet.html +5 -5
- data/rdoc/RubyXL/ChartsheetPageSetup.html +5 -5
- data/rdoc/RubyXL/ChartsheetProperties.html +5 -5
- data/rdoc/RubyXL/ChartsheetProtection.html +5 -5
- data/rdoc/RubyXL/ChartsheetView.html +5 -5
- data/rdoc/RubyXL/ChartsheetViews.html +5 -5
- data/rdoc/RubyXL/Color.html +7 -7
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +5 -5
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +5 -5
- data/rdoc/RubyXL/ColorConvenienceClasses.html +5 -5
- data/rdoc/RubyXL/ColorConvenienceMethods.html +5 -5
- data/rdoc/RubyXL/ColorFilter.html +5 -5
- data/rdoc/RubyXL/ColorScale.html +5 -5
- data/rdoc/RubyXL/ColorSet.html +5 -5
- data/rdoc/RubyXL/Colors.html +5 -5
- data/rdoc/RubyXL/ColumnRange.html +5 -5
- data/rdoc/RubyXL/ColumnRanges.html +5 -5
- data/rdoc/RubyXL/Comment.html +5 -5
- data/rdoc/RubyXL/CommentList.html +5 -5
- data/rdoc/RubyXL/CommentsFile.html +5 -5
- data/rdoc/RubyXL/ConditionalFormatValue.html +5 -5
- data/rdoc/RubyXL/ConditionalFormatting.html +5 -5
- data/rdoc/RubyXL/ConditionalFormattingRule.html +5 -5
- data/rdoc/RubyXL/Connection.html +5 -5
- data/rdoc/RubyXL/ConnectionTable.html +5 -5
- data/rdoc/RubyXL/ConnectionTables.html +5 -5
- data/rdoc/RubyXL/ConnectionTextField.html +5 -5
- data/rdoc/RubyXL/ConnectionTextFields.html +5 -5
- data/rdoc/RubyXL/Connections.html +5 -5
- data/rdoc/RubyXL/ContentTypeDefault.html +5 -5
- data/rdoc/RubyXL/ContentTypeOverride.html +5 -5
- data/rdoc/RubyXL/ContentTypes.html +5 -5
- data/rdoc/RubyXL/ControlPropertiesFile.html +5 -5
- data/rdoc/RubyXL/CorePropertiesFile.html +5 -5
- data/rdoc/RubyXL/CustomColor.html +5 -5
- data/rdoc/RubyXL/CustomColorList.html +5 -5
- data/rdoc/RubyXL/CustomFilter.html +5 -5
- data/rdoc/RubyXL/CustomFilters.html +5 -5
- data/rdoc/RubyXL/CustomGeometry.html +5 -5
- data/rdoc/RubyXL/CustomProperties.html +5 -5
- data/rdoc/RubyXL/CustomPropertiesFile.html +5 -5
- data/rdoc/RubyXL/CustomProperty.html +5 -5
- data/rdoc/RubyXL/CustomPropertyFile.html +5 -5
- data/rdoc/RubyXL/CustomSheetView.html +5 -5
- data/rdoc/RubyXL/CustomSheetViews.html +5 -5
- data/rdoc/RubyXL/CustomWorkbookView.html +5 -5
- data/rdoc/RubyXL/CustomWorkbookViews.html +5 -5
- data/rdoc/RubyXL/CustomXMLFile.html +5 -5
- data/rdoc/RubyXL/DXF.html +5 -5
- data/rdoc/RubyXL/DXFs.html +5 -5
- data/rdoc/RubyXL/DataBar.html +5 -5
- data/rdoc/RubyXL/DataConsolidate.html +5 -5
- data/rdoc/RubyXL/DataConsolidationReference.html +5 -5
- data/rdoc/RubyXL/DataConsolidationReferences.html +5 -5
- data/rdoc/RubyXL/DataType.html +5 -5
- data/rdoc/RubyXL/DataValidation.html +5 -5
- data/rdoc/RubyXL/DataValidations.html +5 -5
- data/rdoc/RubyXL/DateGroupItem.html +5 -5
- data/rdoc/RubyXL/DefinedName.html +5 -5
- data/rdoc/RubyXL/DefinedNameExt.html +5 -5
- data/rdoc/RubyXL/DefinedNames.html +5 -5
- data/rdoc/RubyXL/DefinedNamesExt.html +5 -5
- data/rdoc/RubyXL/DocumentPropertiesFile.html +5 -5
- data/rdoc/RubyXL/DrawingFile.html +5 -5
- data/rdoc/RubyXL/DynamicFilter.html +5 -5
- data/rdoc/RubyXL/EmbeddedControl.html +5 -5
- data/rdoc/RubyXL/EmbeddedControls.html +5 -5
- data/rdoc/RubyXL/Extension.html +5 -5
- data/rdoc/RubyXL/ExtensionStorageArea.html +5 -5
- data/rdoc/RubyXL/Extents.html +5 -5
- data/rdoc/RubyXL/ExternalBook.html +5 -5
- data/rdoc/RubyXL/ExternalLinksFile.html +5 -5
- data/rdoc/RubyXL/ExternalReference.html +5 -5
- data/rdoc/RubyXL/ExternalReferences.html +5 -5
- data/rdoc/RubyXL/ExtraColorSchemeList.html +5 -5
- data/rdoc/RubyXL/FieldItem.html +5 -5
- data/rdoc/RubyXL/FileRecoveryProperties.html +5 -5
- data/rdoc/RubyXL/FileSharing.html +5 -5
- data/rdoc/RubyXL/FileVersion.html +5 -5
- data/rdoc/RubyXL/Fill.html +6 -6
- data/rdoc/RubyXL/Fills.html +6 -6
- data/rdoc/RubyXL/FilterContainer.html +5 -5
- data/rdoc/RubyXL/FloatNode.html +5 -5
- data/rdoc/RubyXL/FloatValue.html +5 -5
- data/rdoc/RubyXL/Font.html +6 -6
- data/rdoc/RubyXL/FontConvenienceMethods.html +5 -5
- data/rdoc/RubyXL/FontScheme.html +5 -5
- data/rdoc/RubyXL/Fonts.html +6 -6
- data/rdoc/RubyXL/Formula.html +5 -5
- data/rdoc/RubyXL/FunctionGroup.html +5 -5
- data/rdoc/RubyXL/FunctionGroups.html +5 -5
- data/rdoc/RubyXL/GenericStorageObject.html +5 -5
- data/rdoc/RubyXL/GradientFill.html +5 -5
- data/rdoc/RubyXL/HeaderFooterSettings.html +5 -5
- data/rdoc/RubyXL/Hyperlink.html +5 -5
- data/rdoc/RubyXL/HyperlinkRelFile.html +5 -5
- data/rdoc/RubyXL/Hyperlinks.html +5 -5
- data/rdoc/RubyXL/IconFilter.html +5 -5
- data/rdoc/RubyXL/IconSet.html +5 -5
- data/rdoc/RubyXL/IgnoredError.html +5 -5
- data/rdoc/RubyXL/IgnoredErrors.html +5 -5
- data/rdoc/RubyXL/IndexedColors.html +5 -5
- data/rdoc/RubyXL/InputCells.html +5 -5
- data/rdoc/RubyXL/IntegerNode.html +5 -5
- data/rdoc/RubyXL/IntegerValue.html +5 -5
- data/rdoc/RubyXL/LegacyCell.html +5 -5
- data/rdoc/RubyXL/LegacyWorksheet.html +6 -140
- data/rdoc/RubyXL/MRUColors.html +5 -5
- data/rdoc/RubyXL/MacrosFile.html +5 -5
- data/rdoc/RubyXL/MergedCell.html +5 -5
- data/rdoc/RubyXL/MergedCells.html +5 -5
- data/rdoc/RubyXL/NumFmt.html +5 -5
- data/rdoc/RubyXL/NumberFormat.html +5 -5
- data/rdoc/RubyXL/NumberFormats.html +5 -5
- data/rdoc/RubyXL/OLEObject.html +5 -5
- data/rdoc/RubyXL/OLEObjectFile.html +5 -5
- data/rdoc/RubyXL/OLEObjects.html +5 -5
- data/rdoc/RubyXL/OLESize.html +5 -5
- data/rdoc/RubyXL/OOXMLContainerObject.html +13 -20
- data/rdoc/RubyXL/OOXMLIgnored.html +5 -5
- data/rdoc/RubyXL/OOXMLObject.html +5 -5
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +17 -13
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +16 -17
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +5 -5
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +6 -6
- data/rdoc/RubyXL/OdbcOleDbProperties.html +5 -5
- data/rdoc/RubyXL/Offset.html +5 -5
- data/rdoc/RubyXL/OlapProperties.html +5 -5
- data/rdoc/RubyXL/OleItem.html +5 -5
- data/rdoc/RubyXL/OleItems.html +5 -5
- data/rdoc/RubyXL/OleLink.html +5 -5
- data/rdoc/RubyXL/OutlineProperties.html +5 -5
- data/rdoc/RubyXL/PageMargins.html +5 -5
- data/rdoc/RubyXL/PageSetup.html +5 -5
- data/rdoc/RubyXL/PageSetupProperties.html +5 -5
- data/rdoc/RubyXL/Pane.html +5 -5
- data/rdoc/RubyXL/Parser.html +5 -5
- data/rdoc/RubyXL/PatternFill.html +5 -5
- data/rdoc/RubyXL/PersonMetadata.html +5 -5
- data/rdoc/RubyXL/PhoneticProperties.html +5 -5
- data/rdoc/RubyXL/PhoneticRun.html +5 -5
- data/rdoc/RubyXL/PivotArea.html +5 -5
- data/rdoc/RubyXL/PivotCache.html +5 -5
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +5 -5
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +5 -5
- data/rdoc/RubyXL/PivotCaches.html +5 -5
- data/rdoc/RubyXL/PivotReference.html +5 -5
- data/rdoc/RubyXL/PivotReferences.html +5 -5
- data/rdoc/RubyXL/{PivotTableSelection.html → PivotSelection.html} +12 -12
- data/rdoc/RubyXL/PivotTableFile.html +5 -5
- data/rdoc/RubyXL/PresetGeometry.html +5 -5
- data/rdoc/RubyXL/PrintOptions.html +5 -5
- data/rdoc/RubyXL/PrinterSettingsFile.html +5 -5
- data/rdoc/RubyXL/ProtectedRange.html +5 -5
- data/rdoc/RubyXL/ProtectedRanges.html +5 -5
- data/rdoc/RubyXL/Protection.html +5 -5
- data/rdoc/RubyXL/QueryParameter.html +5 -5
- data/rdoc/RubyXL/QueryParameters.html +5 -5
- data/rdoc/RubyXL/QueryTable.html +5 -5
- data/rdoc/RubyXL/QueryTableDeletedField.html +5 -5
- data/rdoc/RubyXL/QueryTableDeletedFields.html +5 -5
- data/rdoc/RubyXL/QueryTableField.html +5 -5
- data/rdoc/RubyXL/QueryTableFields.html +5 -5
- data/rdoc/RubyXL/QueryTableRefresh.html +5 -5
- data/rdoc/RubyXL/RID.html +5 -5
- data/rdoc/RubyXL/RawOOXML.html +5 -5
- data/rdoc/RubyXL/Reference.html +110 -154
- data/rdoc/RubyXL/Relationship.html +5 -5
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +5 -5
- data/rdoc/RubyXL/RelationshipSupport.html +5 -5
- data/rdoc/RubyXL/RevisionPointer.html +5 -5
- data/rdoc/RubyXL/RichText.html +5 -5
- data/rdoc/RubyXL/RichTextRun.html +5 -5
- data/rdoc/RubyXL/Row.html +14 -14
- data/rdoc/RubyXL/RowExt.html +5 -5
- data/rdoc/RubyXL/RunProperties.html +5 -5
- data/rdoc/RubyXL/Scenario.html +5 -5
- data/rdoc/RubyXL/Scenarios.html +5 -5
- data/rdoc/RubyXL/Selection.html +6 -6
- data/rdoc/RubyXL/ShapeGuide.html +5 -5
- data/rdoc/RubyXL/ShapeTextRectangle.html +5 -5
- data/rdoc/RubyXL/SharedStringsTable.html +5 -5
- data/rdoc/RubyXL/Sheet.html +5 -5
- data/rdoc/RubyXL/SheetCalculationProperties.html +5 -5
- data/rdoc/RubyXL/SheetData.html +7 -7
- data/rdoc/RubyXL/SheetDataExt.html +5 -5
- data/rdoc/RubyXL/SheetDataSet.html +5 -5
- data/rdoc/RubyXL/SheetMetadata.html +5 -5
- data/rdoc/RubyXL/SheetName.html +5 -5
- data/rdoc/RubyXL/SheetNames.html +5 -5
- data/rdoc/RubyXL/Sheets.html +5 -5
- data/rdoc/RubyXL/SlicerCacheFile.html +5 -5
- data/rdoc/RubyXL/SlicerFile.html +5 -5
- data/rdoc/RubyXL/SmartTagProperties.html +5 -5
- data/rdoc/RubyXL/SmartTagType.html +5 -5
- data/rdoc/RubyXL/SmartTagTypes.html +5 -5
- data/rdoc/RubyXL/SmartTags.html +5 -5
- data/rdoc/RubyXL/SortCondition.html +5 -5
- data/rdoc/RubyXL/SortState.html +5 -5
- data/rdoc/RubyXL/Sqref.html +7 -7
- data/rdoc/RubyXL/Stop.html +5 -5
- data/rdoc/RubyXL/StringNode.html +5 -5
- data/rdoc/RubyXL/StringNodeW3C.html +7 -7
- data/rdoc/RubyXL/StringValue.html +5 -5
- data/rdoc/RubyXL/Stylesheet.html +5 -5
- data/rdoc/RubyXL/TableFile.html +5 -5
- data/rdoc/RubyXL/TableParts.html +5 -5
- data/rdoc/RubyXL/TableStyle.html +5 -5
- data/rdoc/RubyXL/TableStyles.html +5 -5
- data/rdoc/RubyXL/Text.html +5 -5
- data/rdoc/RubyXL/TextImportSettings.html +5 -5
- data/rdoc/RubyXL/Theme.html +5 -5
- data/rdoc/RubyXL/ThemeElements.html +5 -5
- data/rdoc/RubyXL/ThumbnailFile.html +5 -5
- data/rdoc/RubyXL/Top10.html +5 -5
- data/rdoc/RubyXL/VMLDrawingFile.html +5 -5
- data/rdoc/RubyXL/Variant.html +5 -5
- data/rdoc/RubyXL/Vector.html +6 -6
- data/rdoc/RubyXL/VectorValue.html +5 -5
- data/rdoc/RubyXL/VisualProperties.html +5 -5
- data/rdoc/RubyXL/WebPublishObject.html +5 -5
- data/rdoc/RubyXL/WebPublishObjects.html +5 -5
- data/rdoc/RubyXL/WebPublishingItem.html +5 -5
- data/rdoc/RubyXL/WebPublishingItems.html +5 -5
- data/rdoc/RubyXL/WebPublishingProperties.html +5 -5
- data/rdoc/RubyXL/WebQueryProperties.html +5 -5
- data/rdoc/RubyXL/Workbook.html +8 -8
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +5 -5
- data/rdoc/RubyXL/WorkbookProperties.html +5 -5
- data/rdoc/RubyXL/WorkbookProtection.html +5 -5
- data/rdoc/RubyXL/WorkbookRoot.html +15 -8
- data/rdoc/RubyXL/WorkbookView.html +5 -5
- data/rdoc/RubyXL/WorkbookViews.html +5 -5
- data/rdoc/RubyXL/Worksheet.html +147 -13
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +111 -100
- data/rdoc/RubyXL/WorksheetDimensions.html +6 -6
- data/rdoc/RubyXL/WorksheetFormatProperties.html +5 -5
- data/rdoc/RubyXL/WorksheetProperties.html +5 -5
- data/rdoc/RubyXL/WorksheetProtection.html +5 -5
- data/rdoc/RubyXL/WorksheetView.html +5 -5
- data/rdoc/RubyXL/WorksheetViews.html +5 -5
- data/rdoc/RubyXL/XF.html +5 -5
- data/rdoc/RubyXL.html +13 -5
- data/rdoc/created.rid +20 -20
- data/rdoc/index.html +10 -10
- data/rdoc/js/search_data.js +1 -1
- data/rubyXL.gemspec +7 -4
- data/spec/lib/cell_spec.rb +45 -5
- data/spec/lib/color_spec.rb +2 -2
- data/spec/lib/reference_spec.rb +25 -0
- data/spec/lib/workbook_root_spec.rb +43 -0
- data/spec/lib/worksheet_spec.rb +65 -57
- metadata +32 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 9d5586b1840082a24c9f55befaada16985ca69b63792f7ceb6b65729ff234e85
|
|
4
|
+
data.tar.gz: 24d767bc267d067a0766867844d53894f34bd5ce2e81482650d04a0a2e7fb067
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a3211c5ed20bb2488057e40d05b5a6e7b0e871cec6864e98942e7ad9e69c348af7044215b0ab54f87fe1c3afdba24e1e126ff794cff845c0597fb00c6f2fefb
|
|
7
|
+
data.tar.gz: 73b787fc9271e14eb7eda7a65df9022fc0b2aefb0e7b0f29e8f17cf6374c08ae771ee0287fee7a21bcabe21fbfecc32b42820639146bafa2ff34b3f95a6428f0
|
data/Gemfile
CHANGED
|
@@ -8,11 +8,14 @@ gem 'rubyzip', '>= 3.2.2', require: 'zip'
|
|
|
8
8
|
group :development, :test do
|
|
9
9
|
gem 'bundler'
|
|
10
10
|
gem 'rake'
|
|
11
|
+
|
|
11
12
|
gem 'juwelier'
|
|
13
|
+
gem 'git', '~> 4.1' # last compatible with juwelier
|
|
14
|
+
|
|
12
15
|
gem 'rspec'
|
|
13
16
|
gem 'simplecov'
|
|
14
17
|
|
|
15
|
-
|
|
18
|
+
gem 'stackprof'
|
|
16
19
|
gem 'ruby-prof'
|
|
17
20
|
gem 'rspec_junit_formatter'
|
|
18
21
|
|
data/README.rdoc
CHANGED
|
@@ -138,17 +138,16 @@ Please note: these methods are being phased out in favor of the OOXML object mod
|
|
|
138
138
|
cell = worksheet.add_cell(1, 1, 'B2')
|
|
139
139
|
cell.change_border(:top, 'thin') # Sets the cell to have a top, thin border
|
|
140
140
|
# Note that with diagonals, you have to specify which one of the diagonals (or both) you need.
|
|
141
|
-
cell.change_border(
|
|
141
|
+
cell.change_border(:diagonal, 'thick', [ :diagonal_down ]) # Sets A1 to have a thick diagonal going from top left to bottom right
|
|
142
142
|
# You can turn on both diagonals, but then they both will share the same style and color:
|
|
143
|
-
cell.change_border(
|
|
143
|
+
cell.change_border(:diagonal, 'thick', [ :diagonal_down, :diagonal_up ])
|
|
144
144
|
|
|
145
145
|
===== Border Colors
|
|
146
146
|
# Make sure you set the border style first so there's something to color.
|
|
147
147
|
cell.change_border_color(:top, '0ba53d') # Sets top border color to green
|
|
148
|
-
cell.change_border_color(:diagonal, 'dd0000') # Sets
|
|
148
|
+
cell.change_border_color(:diagonal, 'dd0000') # Sets diagonal border color to red
|
|
149
149
|
|
|
150
150
|
===== Changing whole row or column
|
|
151
|
-
|
|
152
151
|
worksheet.change_row_border(0, :left, 'hairline') # Sets first row to have a left, hairline border
|
|
153
152
|
worksheet.change_column_border(0, :diagonal, 'medium') # Sets first column to have diagonal, medium border
|
|
154
153
|
worksheet.change_row_border_color(0, :top, '0ba53d') # Sets first row to have a green top border
|
data/Rakefile
CHANGED
|
@@ -9,6 +9,11 @@ rescue Bundler::BundlerError => e
|
|
|
9
9
|
exit e.status_code
|
|
10
10
|
end
|
|
11
11
|
|
|
12
|
+
require 'psych'
|
|
13
|
+
if defined?(Psych::ClassLoader) && defined?(Psych::ClassLoader::ALLOWED_CLASSES)
|
|
14
|
+
Psych::ClassLoader::ALLOWED_CLASSES << 'Gem::Specification'
|
|
15
|
+
end
|
|
16
|
+
|
|
12
17
|
require 'juwelier'
|
|
13
18
|
Juwelier::Tasks.new do |gem|
|
|
14
19
|
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
|
@@ -46,14 +51,16 @@ Rake::RDocTask.new do |rdoc|
|
|
|
46
51
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
|
47
52
|
end
|
|
48
53
|
|
|
54
|
+
task :preload_library do
|
|
55
|
+
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
|
|
56
|
+
require './lib/rubyXL'
|
|
57
|
+
end
|
|
58
|
+
|
|
49
59
|
desc 'Dump profiling data with stackprof'
|
|
50
|
-
task :stackprof do
|
|
60
|
+
task :stackprof => :preload_library do
|
|
51
61
|
require 'benchmark'
|
|
52
62
|
require 'stackprof'
|
|
53
63
|
|
|
54
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
|
|
55
|
-
require './lib/rubyXL'
|
|
56
|
-
|
|
57
64
|
spreadsheets = Dir.glob(File.join('test', 'input', '*.xls?')).sort!
|
|
58
65
|
|
|
59
66
|
spreadsheets.each { |input|
|
|
@@ -74,30 +81,28 @@ task :stackprof do
|
|
|
74
81
|
end
|
|
75
82
|
|
|
76
83
|
desc 'Dump profiling data with ruby-prof'
|
|
77
|
-
task :rubyprof do
|
|
78
|
-
require 'benchmark'
|
|
84
|
+
task :rubyprof => :preload_library do
|
|
79
85
|
require 'ruby-prof'
|
|
80
86
|
|
|
81
|
-
$LOAD_PATH.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
|
|
82
|
-
require './lib/rubyXL'
|
|
83
|
-
|
|
84
87
|
spreadsheets = Dir.glob(File.join('test', 'input', '*.xls?')).sort!
|
|
85
88
|
|
|
86
89
|
spreadsheets.each { |input|
|
|
87
90
|
puts "<<<--- Profiling parsing of #{input}..."
|
|
88
91
|
doc = nil
|
|
89
|
-
result = RubyProf.profile {
|
|
92
|
+
result = RubyProf::Profile.profile {
|
|
90
93
|
doc = RubyXL::Parser.parse(input)
|
|
91
94
|
}
|
|
92
95
|
printer = RubyProf::CallStackPrinter.new(result)
|
|
93
|
-
File.open("tmp/ruby-prof-parse-#{File.basename(input)}.html", 'w') { |f| printer.print(f
|
|
96
|
+
File.open("tmp/ruby-prof-parse-#{File.basename(input)}.html", 'w') { |f| printer.print(f) }
|
|
94
97
|
|
|
95
98
|
output = File.join('test', 'output', File.basename(input))
|
|
96
99
|
puts "--->>> Profiling writing of #{output}..."
|
|
97
|
-
result = RubyProf.profile {
|
|
100
|
+
result = RubyProf::Profile.profile {
|
|
98
101
|
doc.write(output)
|
|
99
102
|
}
|
|
100
103
|
printer = RubyProf::CallStackPrinter.new(result)
|
|
101
|
-
File.open("tmp/ruby-prof-write-#{File.basename(input)}.html", 'w') { |f| printer.print(f
|
|
104
|
+
File.open("tmp/ruby-prof-write-#{File.basename(input)}.html", 'w') { |f| printer.print(f) }
|
|
102
105
|
}
|
|
103
106
|
end
|
|
107
|
+
|
|
108
|
+
Rake::Task["console"].enhance([:preload_library])
|
data/VERSION
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
3.4.
|
|
1
|
+
3.4.39
|
data/lib/rubyXL/cell.rb
CHANGED
|
@@ -16,12 +16,12 @@ module RubyXL
|
|
|
16
16
|
end
|
|
17
17
|
}
|
|
18
18
|
end
|
|
19
|
-
raise "
|
|
19
|
+
raise RuntimeError, "Cell #{self} is not in workbook #{workbook}"
|
|
20
20
|
end
|
|
21
21
|
|
|
22
22
|
def validate_worksheet
|
|
23
23
|
return if @worksheet && @worksheet[row] && @worksheet[row][column].equal?(self)
|
|
24
|
-
raise "Cell #{self} is not in worksheet #{worksheet}"
|
|
24
|
+
raise RuntimeError, "Cell #{self} is not in worksheet #{worksheet}"
|
|
25
25
|
end
|
|
26
26
|
end
|
|
27
27
|
end
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
module RubyXL
|
|
2
2
|
module CellConvenienceMethods
|
|
3
|
+
# Excel has a hard limit of 65'530 hyperlinks per Worksheet
|
|
4
|
+
MAX_HYPERLINKS_PER_WORKSHEET = 65530
|
|
5
|
+
|
|
3
6
|
def change_contents(data, formula_expression = nil)
|
|
4
7
|
validate_worksheet
|
|
5
8
|
|
|
@@ -21,10 +24,10 @@ module RubyXL
|
|
|
21
24
|
def remove_formula
|
|
22
25
|
self.formula = nil
|
|
23
26
|
|
|
24
|
-
calculation_chain = workbook
|
|
25
|
-
calculation_cells = calculation_chain
|
|
26
|
-
calculation_cells
|
|
27
|
-
c.ref.
|
|
27
|
+
calculation_chain = workbook&.calculation_chain
|
|
28
|
+
calculation_cells = calculation_chain&.cells
|
|
29
|
+
calculation_cells&.reject! { |c|
|
|
30
|
+
(c.ref.first_col == self.column) && (c.ref.first_row == self.row)
|
|
28
31
|
}
|
|
29
32
|
end
|
|
30
33
|
|
|
@@ -180,7 +183,7 @@ module RubyXL
|
|
|
180
183
|
# Changes font size of cell
|
|
181
184
|
def change_font_size(font_size = 10)
|
|
182
185
|
validate_worksheet
|
|
183
|
-
raise 'Argument must be a number' unless font_size.is_a?(Integer) || font_size.is_a?(Float)
|
|
186
|
+
raise(ArgumentError, 'Argument must be a number') unless font_size.is_a?(Integer) || font_size.is_a?(Float)
|
|
184
187
|
|
|
185
188
|
font = get_cell_font.dup
|
|
186
189
|
font.set_size(font_size)
|
|
@@ -249,11 +252,15 @@ module RubyXL
|
|
|
249
252
|
when Worksheet::BOLD then change_font_bold(arg)
|
|
250
253
|
when Worksheet::UNDERLINE then change_font_underline(arg)
|
|
251
254
|
when Worksheet::STRIKETHROUGH then change_font_strikethrough(arg)
|
|
252
|
-
else raise
|
|
255
|
+
else raise ArgumentError, "Invalid change_type: #{change_type}"
|
|
253
256
|
end
|
|
254
257
|
end
|
|
255
258
|
|
|
256
259
|
def add_hyperlink(url, tooltip = nil)
|
|
260
|
+
if worksheet.hyperlinks.size >= MAX_HYPERLINKS_PER_WORKSHEET
|
|
261
|
+
raise RuntimeError, "Maximum number of hyperlinks per worksheet reached"
|
|
262
|
+
end
|
|
263
|
+
|
|
257
264
|
worksheet.relationship_container ||= RubyXL::OOXMLRelationshipsFile.new
|
|
258
265
|
relationships = worksheet.relationship_container.relationships
|
|
259
266
|
r_id = "rId#{relationships.size + 1}"
|
|
@@ -28,7 +28,7 @@ module RubyXL
|
|
|
28
28
|
end
|
|
29
29
|
}
|
|
30
30
|
else
|
|
31
|
-
raise
|
|
31
|
+
raise ArgumentError, "Invalid shift option: #{shift}"
|
|
32
32
|
end
|
|
33
33
|
|
|
34
34
|
return add_cell(row, col, data, formula)
|
|
@@ -62,7 +62,7 @@ module RubyXL
|
|
|
62
62
|
end
|
|
63
63
|
}
|
|
64
64
|
else
|
|
65
|
-
raise
|
|
65
|
+
raise ArgumentError, "Invalid shift option: #{shift}"
|
|
66
66
|
end
|
|
67
67
|
|
|
68
68
|
return old_cell
|
|
@@ -108,14 +108,14 @@ module RubyXL
|
|
|
108
108
|
# Update merged cells for all rows below
|
|
109
109
|
if self.merged_cells then
|
|
110
110
|
merged_cells.each { |mc|
|
|
111
|
-
next if mc.ref.
|
|
111
|
+
next if mc.ref.last_row < row_index
|
|
112
112
|
|
|
113
|
-
in_merged_cell = mc.ref.
|
|
113
|
+
in_merged_cell = mc.ref.first_row < row_index
|
|
114
114
|
mc.ref = RubyXL::Reference.new(
|
|
115
|
-
mc.ref.
|
|
116
|
-
mc.ref.
|
|
117
|
-
mc.ref.
|
|
118
|
-
mc.ref.
|
|
115
|
+
mc.ref.first_row + (in_merged_cell ? 0 : 1),
|
|
116
|
+
mc.ref.last_row + 1,
|
|
117
|
+
mc.ref.first_col,
|
|
118
|
+
mc.ref.last_col,
|
|
119
119
|
)
|
|
120
120
|
}
|
|
121
121
|
end
|
|
@@ -137,18 +137,24 @@ module RubyXL
|
|
|
137
137
|
|
|
138
138
|
# Update row number of merged cells
|
|
139
139
|
if self.merged_cells then
|
|
140
|
-
merged_cells.delete_if { |mc|
|
|
140
|
+
merged_cells.delete_if { |mc|
|
|
141
|
+
reference = mc.ref
|
|
142
|
+
(reference.first_row == row_index) && (reference.last_row == row_index)
|
|
143
|
+
}
|
|
144
|
+
|
|
141
145
|
merged_cells.each { |mc|
|
|
142
|
-
|
|
146
|
+
reference = mc.ref
|
|
147
|
+
next if reference.last_row < row_index
|
|
143
148
|
|
|
144
|
-
in_merged_cell =
|
|
149
|
+
in_merged_cell = reference.first_row <= row_index
|
|
145
150
|
mc.ref = RubyXL::Reference.new(
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
151
|
+
reference.first_row - (in_merged_cell ? 0 : 1),
|
|
152
|
+
reference.last_row - 1,
|
|
153
|
+
reference.first_col,
|
|
154
|
+
reference.last_col,
|
|
150
155
|
)
|
|
151
156
|
}
|
|
157
|
+
|
|
152
158
|
merged_cells.delete_if { |mc| mc.ref.single_cell? }
|
|
153
159
|
end
|
|
154
160
|
|
|
@@ -186,14 +192,14 @@ module RubyXL
|
|
|
186
192
|
# Update merged cells for all rows below
|
|
187
193
|
if self.merged_cells then
|
|
188
194
|
merged_cells.each { |mc|
|
|
189
|
-
next if mc.ref.
|
|
195
|
+
next if mc.ref.last_col < column_index
|
|
190
196
|
|
|
191
|
-
in_merged_cell = mc.ref.
|
|
197
|
+
in_merged_cell = mc.ref.first_col < column_index
|
|
192
198
|
mc.ref = RubyXL::Reference.new(
|
|
193
|
-
mc.ref.
|
|
194
|
-
mc.ref.
|
|
195
|
-
mc.ref.
|
|
196
|
-
mc.ref.
|
|
199
|
+
mc.ref.first_row,
|
|
200
|
+
mc.ref.last_row,
|
|
201
|
+
mc.ref.first_col + (in_merged_cell ? 0 : 1),
|
|
202
|
+
mc.ref.last_col + 1,
|
|
197
203
|
)
|
|
198
204
|
}
|
|
199
205
|
end
|
|
@@ -221,16 +227,21 @@ module RubyXL
|
|
|
221
227
|
# Update row number of merged cells
|
|
222
228
|
return unless self.merged_cells
|
|
223
229
|
|
|
224
|
-
merged_cells.delete_if { |mc|
|
|
230
|
+
merged_cells.delete_if { |mc|
|
|
231
|
+
reference = mc.ref
|
|
232
|
+
(reference.first_col == column_index) && (reference.last_col == column_index)
|
|
233
|
+
}
|
|
234
|
+
|
|
225
235
|
merged_cells.each { |mc|
|
|
226
|
-
|
|
236
|
+
reference = mc.ref
|
|
237
|
+
next if reference.last_col < column_index
|
|
227
238
|
|
|
228
|
-
in_merged_cell =
|
|
239
|
+
in_merged_cell = reference.first_col <= column_index
|
|
229
240
|
mc.ref = RubyXL::Reference.new(
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
241
|
+
reference.first_row,
|
|
242
|
+
reference.last_row,
|
|
243
|
+
reference.first_col - (in_merged_cell ? 0 : 1),
|
|
244
|
+
reference.last_col - 1,
|
|
234
245
|
)
|
|
235
246
|
}
|
|
236
247
|
|
|
@@ -704,11 +715,11 @@ module RubyXL
|
|
|
704
715
|
row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
|
|
705
716
|
when String then
|
|
706
717
|
from, to = params[0].split(':')
|
|
707
|
-
raise
|
|
718
|
+
raise(ArgumentError, "Reference for merging cells must be a range") if to.nil?
|
|
708
719
|
row_from, col_from = RubyXL::Reference.ref2ind(from)
|
|
709
720
|
row_to, col_to = RubyXL::Reference.ref2ind(to)
|
|
710
721
|
else
|
|
711
|
-
raise
|
|
722
|
+
raise(ArgumentError, "Invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
|
|
712
723
|
end
|
|
713
724
|
end
|
|
714
725
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rubyXL/objects/ooxml_object'
|
|
2
4
|
require 'rubyXL/objects/simple_types'
|
|
3
5
|
|
|
@@ -6,8 +8,8 @@ module RubyXL
|
|
|
6
8
|
define_attribute(:style, RubyXL::ST_BorderStyle, :default => 'none')
|
|
7
9
|
define_child_node(RubyXL::Color)
|
|
8
10
|
|
|
9
|
-
def set_rgb_color(
|
|
10
|
-
self.color = RubyXL::Color.new(:rgb =>
|
|
11
|
+
def set_rgb_color(edge_color)
|
|
12
|
+
self.color = RubyXL::Color.new(:rgb => edge_color.to_s)
|
|
11
13
|
end
|
|
12
14
|
|
|
13
15
|
def get_rgb_color
|
|
@@ -43,8 +45,8 @@ module RubyXL
|
|
|
43
45
|
end
|
|
44
46
|
|
|
45
47
|
if diagonals then
|
|
46
|
-
self.diagonal_up = true if diagonals.
|
|
47
|
-
self.diagonal_down = true if diagonals.
|
|
48
|
+
self.diagonal_up = true if diagonals.include?(:diagonal_up)
|
|
49
|
+
self.diagonal_down = true if diagonals.include?(:diagonal_down)
|
|
48
50
|
end
|
|
49
51
|
end
|
|
50
52
|
|
|
@@ -58,8 +60,9 @@ module RubyXL
|
|
|
58
60
|
if edge
|
|
59
61
|
edge.set_rgb_color(color)
|
|
60
62
|
else
|
|
61
|
-
|
|
62
|
-
|
|
63
|
+
edge = RubyXL::BorderEdge.new
|
|
64
|
+
edge.set_rgb_color(color)
|
|
65
|
+
self.send("#{direction}=", edge)
|
|
63
66
|
end
|
|
64
67
|
end
|
|
65
68
|
end
|
data/lib/rubyXL/objects/color.rb
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
1
3
|
require 'rubyXL/objects/ooxml_object'
|
|
2
4
|
require 'rubyXL/objects/simple_types'
|
|
3
5
|
|
|
@@ -18,7 +20,7 @@ module RubyXL
|
|
|
18
20
|
if color =~ COLOR_REGEXP
|
|
19
21
|
return true
|
|
20
22
|
else
|
|
21
|
-
raise
|
|
23
|
+
raise ArgumentError, "Invalid color value: #{color}"
|
|
22
24
|
end
|
|
23
25
|
end
|
|
24
26
|
end
|
data/lib/rubyXL/objects/fill.rb
CHANGED
data/lib/rubyXL/objects/font.rb
CHANGED
|
@@ -34,7 +34,7 @@ module RubyXL
|
|
|
34
34
|
# * +:bool+ - <tt>Boolean</tt> ("1" and "true" convert to +true+, others to +false+)
|
|
35
35
|
# * one of +simple_types+ - <tt>String</tt>, plus the list of acceptable values is saved for future validation (not used yet).
|
|
36
36
|
# * +extra_parameters+ - Hash of optional parameters as follows:
|
|
37
|
-
# * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to
|
|
37
|
+
# * +:accessor+ - Name of the accessor for this attribute to be defined on the object. If not provided, defaults to snakecased +attribute_name+.
|
|
38
38
|
# * +:default+ - Value this attribute defaults to if not explicitly provided.
|
|
39
39
|
# * +:required+ - Whether this attribute is required when writing XML. If the value of the attrinute is not explicitly provided, +:default+ is written instead.
|
|
40
40
|
# * +:computed+ - Do not store this attribute on +parse+, but do call the object-provided read accessor on +write_xml+.
|
|
@@ -52,6 +52,8 @@ module RubyXL
|
|
|
52
52
|
attr_hash = { :attr_type => attr_type }
|
|
53
53
|
attr_hash.merge!(extra_params) if extra_params
|
|
54
54
|
attr_hash[:accessor] ||= accessorize(attr_name)
|
|
55
|
+
attr_hash[:instance_var] ||= "@#{attr_hash[:accessor]}".to_sym
|
|
56
|
+
attr_hash[:setter] ||= "#{attr_hash[:accessor]}=".to_sym
|
|
55
57
|
attrs[attr_name.to_s] = attr_hash
|
|
56
58
|
self.send(:attr_accessor, attr_hash[:accessor]) unless attr_hash[:computed]
|
|
57
59
|
end
|
|
@@ -89,7 +91,9 @@ module RubyXL
|
|
|
89
91
|
child_nodes[child_node_name] = {
|
|
90
92
|
:class => klass,
|
|
91
93
|
:is_array => extra_params[:collection],
|
|
92
|
-
:accessor => accessor
|
|
94
|
+
:accessor => accessor,
|
|
95
|
+
:setter => "#{accessor}=".to_sym,
|
|
96
|
+
:instance_var => "@#{accessor}".to_sym
|
|
93
97
|
}
|
|
94
98
|
|
|
95
99
|
define_count_attribute if extra_params[:collection] == :with_count
|
|
@@ -164,7 +168,7 @@ module RubyXL
|
|
|
164
168
|
end
|
|
165
169
|
|
|
166
170
|
child_node_params = known_child_nodes[child_node_name]
|
|
167
|
-
raise "Unknown child node [#{child_node_name}] for element [#{node.name}]" if child_node_params.nil?
|
|
171
|
+
raise(RuntimeError, "Unknown child node [#{child_node_name}] for element [#{node.name}]") if child_node_params.nil?
|
|
168
172
|
parsed_object = child_node_params[:class].parse(child_node, known_namespaces)
|
|
169
173
|
if child_node_params[:is_array] then
|
|
170
174
|
index = parsed_object.index_in_collection
|
|
@@ -179,7 +183,7 @@ module RubyXL
|
|
|
179
183
|
collection[index] = parsed_object
|
|
180
184
|
end
|
|
181
185
|
else
|
|
182
|
-
obj.send(
|
|
186
|
+
obj.send(child_node_params[:setter], parsed_object)
|
|
183
187
|
end
|
|
184
188
|
}
|
|
185
189
|
end
|
|
@@ -208,10 +212,10 @@ module RubyXL
|
|
|
208
212
|
when :int then Integer(raw_value)
|
|
209
213
|
when :uint then
|
|
210
214
|
v = Integer(raw_value)
|
|
211
|
-
raise
|
|
215
|
+
raise(ArgumentError, "Invalid value for unsigned Integer(): \"#{raw_value}\"") if v < 0
|
|
212
216
|
v
|
|
213
217
|
end
|
|
214
|
-
obj.send(
|
|
218
|
+
obj.send(params[:setter], val)
|
|
215
219
|
end
|
|
216
220
|
end
|
|
217
221
|
|
|
@@ -230,10 +234,9 @@ module RubyXL
|
|
|
230
234
|
|
|
231
235
|
def initialize(params = nil)
|
|
232
236
|
@local_namespaces = nil
|
|
233
|
-
params ||= {}
|
|
234
237
|
|
|
235
238
|
obtain_class_variable(:@@ooxml_attributes).each_value { |v|
|
|
236
|
-
instance_variable_set(
|
|
239
|
+
instance_variable_set(v[:instance_var], params&.[](v[:accessor])) unless v[:computed]
|
|
237
240
|
}
|
|
238
241
|
|
|
239
242
|
init_child_nodes(params)
|
|
@@ -242,15 +245,14 @@ module RubyXL
|
|
|
242
245
|
def init_child_nodes(params)
|
|
243
246
|
obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
|
|
244
247
|
initial_value =
|
|
245
|
-
if params
|
|
248
|
+
if params&.has_key?(v[:accessor]) then params[v[:accessor]]
|
|
246
249
|
elsif v[:is_array] then []
|
|
247
250
|
else nil
|
|
248
251
|
end
|
|
249
252
|
|
|
250
|
-
instance_variable_set(
|
|
253
|
+
instance_variable_set(v[:instance_var], initial_value)
|
|
251
254
|
}
|
|
252
255
|
end
|
|
253
|
-
private :init_child_nodes
|
|
254
256
|
|
|
255
257
|
def preserve_whitespace
|
|
256
258
|
self.xml_space = (value.is_a?(String) && ((value =~ /\A\s/) || (value =~ /\s\Z/) || value.include?("\n"))) ? 'preserve' : nil
|
|
@@ -395,7 +397,7 @@ module RubyXL
|
|
|
395
397
|
def init_child_nodes(params)
|
|
396
398
|
obtain_class_variable(:@@ooxml_child_nodes).each_value { |v|
|
|
397
399
|
next if v[:is_array] # Only one collection node allowed per OOXMLContainerObject, and it is contained in itself.
|
|
398
|
-
instance_variable_set(
|
|
400
|
+
instance_variable_set(v[:instance_var], params[v[:accessor]])
|
|
399
401
|
}
|
|
400
402
|
end
|
|
401
403
|
protected :init_child_nodes
|
|
@@ -405,9 +407,7 @@ module RubyXL
|
|
|
405
407
|
end
|
|
406
408
|
|
|
407
409
|
def inspect
|
|
408
|
-
|
|
409
|
-
vars = self.instance_variables.each { |v| vars << "#{v}=#{instance_variable_get(v).inspect}" }
|
|
410
|
-
"<#{self.class}: #{super} #{vars.join(", ")}>"
|
|
410
|
+
"<#{self.class}: #{super} #{self.instance_variables.collect{ |v| "#{v}=#{instance_variable_get(v).inspect}" }.join(', ')}>"
|
|
411
411
|
end
|
|
412
412
|
|
|
413
413
|
class << self
|
|
@@ -430,7 +430,7 @@ module RubyXL
|
|
|
430
430
|
# Prototype method. For top-level OOXML object, returns the path at which the current object's XML file
|
|
431
431
|
# is located within the <tt>.xlsx</tt> zip container.
|
|
432
432
|
def xlsx_path
|
|
433
|
-
raise 'Subclass responsebility'
|
|
433
|
+
raise RuntimeError, 'Subclass responsebility'
|
|
434
434
|
end
|
|
435
435
|
|
|
436
436
|
# Sets the list of namespaces on this object to be added when writing out XML. Valid only on top-level objects.
|
|
@@ -3,8 +3,9 @@ module RubyXL
|
|
|
3
3
|
ROW_MAX = 1024 * 1024
|
|
4
4
|
COL_MAX = 16393
|
|
5
5
|
|
|
6
|
-
attr_reader :
|
|
6
|
+
attr_reader :first_row, :last_row, :first_col, :last_col
|
|
7
7
|
attr_reader :row_from_absolute, :row_to_absolute, :col_from_absolute, :col_to_absolute
|
|
8
|
+
attr_reader :sheet_name
|
|
8
9
|
|
|
9
10
|
# RubyXL::Reference.new(row, col)
|
|
10
11
|
# RubyXL::Reference.new(row_from, row_to, col_from, col_to)
|
|
@@ -33,56 +34,60 @@ module RubyXL
|
|
|
33
34
|
row_from, col_from, @row_from_absolute, @col_from_absolute = self.class.ref2ind(from)
|
|
34
35
|
row_to, col_to, @row_to_absolute, @col_to_absolute = self.class.ref2ind(to) unless to.nil?
|
|
35
36
|
else
|
|
36
|
-
raise
|
|
37
|
+
raise(ArgumentError, "Invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
|
|
37
38
|
end
|
|
38
39
|
end
|
|
39
40
|
|
|
40
|
-
@
|
|
41
|
-
@
|
|
41
|
+
@first_row = row_from || 0
|
|
42
|
+
@last_row = row_to || row_from || ROW_MAX
|
|
43
|
+
@first_col = col_from || 0
|
|
44
|
+
@last_col = col_to || col_from || COL_MAX
|
|
42
45
|
end
|
|
43
46
|
|
|
44
|
-
def
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
def valid?
|
|
49
|
-
!(row_range.begin.negative? || col_range.begin.negative?)
|
|
50
|
-
end
|
|
51
|
-
|
|
52
|
-
def first_row
|
|
53
|
-
@row_range.begin
|
|
47
|
+
def row_range
|
|
48
|
+
warn "[DEPRECATION] `row_range` is deprecated. Please use `first_row` and `last_row` instead."
|
|
49
|
+
@row_range ||= Range.new(@first_row, @last_row)
|
|
54
50
|
end
|
|
55
51
|
|
|
56
|
-
def
|
|
57
|
-
|
|
52
|
+
def col_range
|
|
53
|
+
warn "[DEPRECATION] `col_range` is deprecated. Please use `first_col` and `last_col` instead."
|
|
54
|
+
@col_range ||= Range.new(@first_col, @last_col)
|
|
58
55
|
end
|
|
59
56
|
|
|
60
|
-
def
|
|
61
|
-
@
|
|
57
|
+
def single_cell?
|
|
58
|
+
(@first_row == @last_row) && (@first_col == @last_col)
|
|
62
59
|
end
|
|
63
60
|
|
|
64
|
-
def
|
|
65
|
-
@
|
|
61
|
+
def valid?
|
|
62
|
+
!(@first_row.negative? || @first_col.negative?)
|
|
66
63
|
end
|
|
67
64
|
|
|
68
65
|
def ==(other)
|
|
69
|
-
|
|
70
|
-
|
|
66
|
+
return false unless other.is_a?(RubyXL::Reference)
|
|
67
|
+
return false unless @sheet_name == other.sheet_name
|
|
68
|
+
|
|
69
|
+
(@first_row == other.first_row) &&
|
|
70
|
+
(@last_row == other.last_row) &&
|
|
71
|
+
(@first_col == other.first_col) &&
|
|
72
|
+
(@last_col == other.last_col)
|
|
71
73
|
end
|
|
72
74
|
|
|
73
75
|
def cover?(other)
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
76
|
+
return false unless other.is_a?(RubyXL::Reference)
|
|
77
|
+
return false unless @sheet_name == other.sheet_name
|
|
78
|
+
|
|
79
|
+
(@first_row <= other.first_row) &&
|
|
80
|
+
(@last_row >= other.last_row) &&
|
|
81
|
+
(@first_col <= other.first_col) &&
|
|
82
|
+
(@last_col >= other.last_col)
|
|
78
83
|
end
|
|
79
84
|
|
|
80
85
|
def to_s
|
|
81
86
|
result = +''
|
|
82
87
|
|
|
83
88
|
if @sheet_name then
|
|
84
|
-
if @sheet_name.
|
|
85
|
-
result << "'
|
|
89
|
+
if @sheet_name.include?(' ') then
|
|
90
|
+
result << "'" << @sheet_name << "'"
|
|
86
91
|
else
|
|
87
92
|
result << @sheet_name
|
|
88
93
|
end
|
|
@@ -90,19 +95,19 @@ module RubyXL
|
|
|
90
95
|
end
|
|
91
96
|
|
|
92
97
|
if single_cell? then
|
|
93
|
-
result << self.class.ind2ref(@
|
|
98
|
+
result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
|
|
94
99
|
else
|
|
95
|
-
result << self.class.ind2ref(@
|
|
100
|
+
result << self.class.ind2ref(@first_row, @first_col, @row_from_absolute, @col_from_absolute)
|
|
96
101
|
result << ':'
|
|
97
|
-
result << self.class.ind2ref(@
|
|
102
|
+
result << self.class.ind2ref(@last_row, @last_col, @row_to_absolute, @col_to_absolute)
|
|
98
103
|
end
|
|
99
104
|
end
|
|
100
105
|
|
|
101
106
|
def inspect
|
|
102
107
|
if single_cell? then
|
|
103
|
-
"#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@
|
|
108
|
+
"#<#{self.class} @sheet_name=#{@sheet_name} @row=#{@first_row} @col=#{@first_col}>"
|
|
104
109
|
else
|
|
105
|
-
"#<#{self.class} @sheet_name=#{@sheet_name}
|
|
110
|
+
"#<#{self.class} @sheet_name=#{@sheet_name} rows=#{@first_row}..#{@last_row} cols=#{@first_col}..#{@last_col}>"
|
|
106
111
|
end
|
|
107
112
|
end
|
|
108
113
|
|