rubyXL 3.4.25 → 3.4.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.rubocop.yml +124 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +2 -0
- data/README.rdoc +6 -4
- data/VERSION +1 -1
- data/lib/rubyXL/convenience_methods/cell.rb +1 -1
- data/lib/rubyXL/convenience_methods/color.rb +6 -6
- data/lib/rubyXL/convenience_methods/workbook.rb +1 -5
- data/lib/rubyXL/convenience_methods/worksheet.rb +26 -6
- data/lib/rubyXL/objects/color.rb +1 -1
- data/lib/rubyXL/objects/column_range.rb +16 -12
- data/lib/rubyXL/objects/document_properties.rb +1 -0
- data/lib/rubyXL/objects/external_links.rb +8 -0
- data/lib/rubyXL/objects/ooxml_object.rb +16 -14
- data/lib/rubyXL/objects/query_table.rb +4 -2
- data/lib/rubyXL/objects/reference.rb +21 -10
- data/lib/rubyXL/objects/relationships.rb +1 -1
- data/lib/rubyXL/objects/shared_strings.rb +1 -1
- data/lib/rubyXL/objects/sheet_data.rb +6 -6
- data/lib/rubyXL/objects/storage.rb +6 -1
- data/lib/rubyXL/objects/stylesheet.rb +2 -3
- data/lib/rubyXL/objects/text.rb +3 -3
- data/lib/rubyXL/objects/theme.rb +15 -17
- data/lib/rubyXL/objects/workbook.rb +10 -9
- data/lib/rubyXL/objects/worksheet.rb +2 -2
- data/lib/rubyXL/worksheet.rb +11 -3
- data/rdoc/README_rdoc.html +101 -49
- data/rdoc/RubyXL/AExtension.html +17 -13
- data/rdoc/RubyXL/AExtensionStorageArea.html +3 -3
- data/rdoc/RubyXL/ActiveX.html +10 -8
- data/rdoc/RubyXL/ActiveXBinary.html +3 -3
- data/rdoc/RubyXL/AdjustHandleList.html +3 -3
- data/rdoc/RubyXL/Alignment.html +3 -3
- data/rdoc/RubyXL/AlternateContent.html +3 -3
- data/rdoc/RubyXL/AlternateUrls.html +99 -0
- data/rdoc/RubyXL/Authors.html +3 -3
- data/rdoc/RubyXL/AutoFilter.html +3 -3
- data/rdoc/RubyXL/AutoFilterColumn.html +3 -3
- data/rdoc/RubyXL/BinaryImageFile.html +3 -3
- data/rdoc/RubyXL/BodyProperties.html +3 -3
- data/rdoc/RubyXL/BooleanNode.html +3 -3
- data/rdoc/RubyXL/BooleanValue.html +3 -3
- data/rdoc/RubyXL/Border.html +27 -19
- data/rdoc/RubyXL/BorderEdge.html +15 -11
- data/rdoc/RubyXL/Borders.html +9 -7
- data/rdoc/RubyXL/Break.html +3 -3
- data/rdoc/RubyXL/BreakList.html +3 -3
- data/rdoc/RubyXL/CT_AdjPoint2D.html +3 -3
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +3 -3
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +3 -3
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +3 -3
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +3 -3
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +3 -3
- data/rdoc/RubyXL/CT_Backdrop.html +3 -3
- data/rdoc/RubyXL/CT_Bevel.html +3 -3
- data/rdoc/RubyXL/CT_BiLevelEffect.html +3 -3
- data/rdoc/RubyXL/CT_BlendEffect.html +3 -3
- data/rdoc/RubyXL/CT_Blip.html +3 -3
- data/rdoc/RubyXL/CT_BlipFillProperties.html +3 -3
- data/rdoc/RubyXL/CT_BlurEffect.html +3 -3
- data/rdoc/RubyXL/CT_Camera.html +3 -3
- data/rdoc/RubyXL/CT_Color.html +3 -3
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +3 -3
- data/rdoc/RubyXL/CT_ColorMapping.html +3 -3
- data/rdoc/RubyXL/CT_ColorScheme.html +3 -3
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +3 -3
- data/rdoc/RubyXL/CT_ConnectionSite.html +3 -3
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +3 -3
- data/rdoc/RubyXL/CT_DashStop.html +3 -3
- data/rdoc/RubyXL/CT_DashStopList.html +3 -3
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +3 -3
- data/rdoc/RubyXL/CT_DuotoneEffect.html +3 -3
- data/rdoc/RubyXL/CT_EffectContainer.html +3 -3
- data/rdoc/RubyXL/CT_EffectList.html +3 -3
- data/rdoc/RubyXL/CT_EffectReference.html +3 -3
- data/rdoc/RubyXL/CT_EffectStyleItem.html +3 -3
- data/rdoc/RubyXL/CT_EffectStyleList.html +3 -3
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +3 -3
- data/rdoc/RubyXL/CT_FillEffect.html +3 -3
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +3 -3
- data/rdoc/RubyXL/CT_FillStyleList.html +3 -3
- data/rdoc/RubyXL/CT_FlatText.html +3 -3
- data/rdoc/RubyXL/CT_FontCollection.html +3 -3
- data/rdoc/RubyXL/CT_FontReference.html +3 -3
- data/rdoc/RubyXL/CT_GeomGuideList.html +3 -3
- data/rdoc/RubyXL/CT_GlowEffect.html +3 -3
- data/rdoc/RubyXL/CT_GradientFillProperties.html +3 -3
- data/rdoc/RubyXL/CT_GradientStop.html +3 -3
- data/rdoc/RubyXL/CT_GradientStopList.html +3 -3
- data/rdoc/RubyXL/CT_HSLEffect.html +3 -3
- data/rdoc/RubyXL/CT_HslColor.html +3 -3
- data/rdoc/RubyXL/CT_Hyperlink.html +3 -3
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +3 -3
- data/rdoc/RubyXL/CT_LightRig.html +3 -3
- data/rdoc/RubyXL/CT_LineEndProperties.html +3 -3
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +3 -3
- data/rdoc/RubyXL/CT_LineProperties.html +3 -3
- data/rdoc/RubyXL/CT_LineStyleList.html +3 -3
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +3 -3
- data/rdoc/RubyXL/CT_LuminanceEffect.html +3 -3
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +3 -3
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +3 -3
- data/rdoc/RubyXL/CT_Path2D.html +3 -3
- data/rdoc/RubyXL/CT_Path2DArcTo.html +3 -3
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +3 -3
- data/rdoc/RubyXL/CT_Path2DList.html +3 -3
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +3 -3
- data/rdoc/RubyXL/CT_Path2DTo.html +3 -3
- data/rdoc/RubyXL/CT_PathShadeProperties.html +3 -3
- data/rdoc/RubyXL/CT_PatternFillProperties.html +3 -3
- data/rdoc/RubyXL/CT_Point3D.html +3 -3
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +3 -3
- data/rdoc/RubyXL/CT_PresetColor.html +3 -3
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +3 -3
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +3 -3
- data/rdoc/RubyXL/CT_PresetTextShape.html +3 -3
- data/rdoc/RubyXL/CT_ReflectionEffect.html +3 -3
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +3 -3
- data/rdoc/RubyXL/CT_RelativeRect.html +3 -3
- data/rdoc/RubyXL/CT_SRgbColor.html +3 -3
- data/rdoc/RubyXL/CT_ScRgbColor.html +3 -3
- data/rdoc/RubyXL/CT_Scene3D.html +3 -3
- data/rdoc/RubyXL/CT_SchemeColor.html +3 -3
- data/rdoc/RubyXL/CT_Shape3D.html +3 -3
- data/rdoc/RubyXL/CT_ShapeStyle.html +3 -3
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +3 -3
- data/rdoc/RubyXL/CT_SphereCoords.html +3 -3
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +3 -3
- data/rdoc/RubyXL/CT_StyleMatrix.html +3 -3
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +3 -3
- data/rdoc/RubyXL/CT_SupplementalFont.html +3 -3
- data/rdoc/RubyXL/CT_SystemColor.html +3 -3
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +3 -3
- data/rdoc/RubyXL/CT_TextBlipBullet.html +3 -3
- data/rdoc/RubyXL/CT_TextCharBullet.html +3 -3
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +3 -3
- data/rdoc/RubyXL/CT_TextFont.html +3 -3
- data/rdoc/RubyXL/CT_TextListStyle.html +3 -3
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +3 -3
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +3 -3
- data/rdoc/RubyXL/CT_TextSpacing.html +3 -3
- data/rdoc/RubyXL/CT_TextTabStop.html +3 -3
- data/rdoc/RubyXL/CT_TextTabStopList.html +3 -3
- data/rdoc/RubyXL/CT_TileInfoProperties.html +3 -3
- data/rdoc/RubyXL/CT_TintEffect.html +3 -3
- data/rdoc/RubyXL/CT_Transform2D.html +3 -3
- data/rdoc/RubyXL/CT_TransformEffect.html +3 -3
- data/rdoc/RubyXL/CT_Vector3D.html +3 -3
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +3 -3
- data/rdoc/RubyXL/CalculationChain.html +9 -7
- data/rdoc/RubyXL/CalculationChainCell.html +3 -3
- data/rdoc/RubyXL/CalculationProperties.html +3 -3
- data/rdoc/RubyXL/Cell.html +93 -65
- data/rdoc/RubyXL/CellConvenienceMethods.html +220 -148
- data/rdoc/RubyXL/CellExt.html +3 -3
- data/rdoc/RubyXL/CellSmartTag.html +3 -3
- data/rdoc/RubyXL/CellSmartTagProperty.html +3 -3
- data/rdoc/RubyXL/CellSmartTags.html +3 -3
- data/rdoc/RubyXL/CellStyle.html +3 -3
- data/rdoc/RubyXL/CellStyleXFs.html +9 -7
- data/rdoc/RubyXL/CellStyles.html +10 -8
- data/rdoc/RubyXL/CellValue.html +9 -7
- data/rdoc/RubyXL/CellWatch.html +3 -3
- data/rdoc/RubyXL/CellWatches.html +3 -3
- data/rdoc/RubyXL/CellXFs.html +11 -10
- data/rdoc/RubyXL/ChartColorsFile.html +3 -3
- data/rdoc/RubyXL/ChartFile.html +9 -7
- data/rdoc/RubyXL/ChartStyleFile.html +3 -3
- data/rdoc/RubyXL/ChartUserShapesFile.html +3 -3
- data/rdoc/RubyXL/Chartsheet.html +9 -7
- data/rdoc/RubyXL/ChartsheetPageSetup.html +3 -3
- data/rdoc/RubyXL/ChartsheetProperties.html +3 -3
- data/rdoc/RubyXL/ChartsheetProtection.html +3 -3
- data/rdoc/RubyXL/ChartsheetView.html +3 -3
- data/rdoc/RubyXL/ChartsheetViews.html +3 -3
- data/rdoc/RubyXL/Color.html +9 -7
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +17 -13
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +23 -17
- data/rdoc/RubyXL/ColorConvenienceClasses.html +3 -3
- data/rdoc/RubyXL/ColorConvenienceMethods.html +9 -7
- data/rdoc/RubyXL/ColorFilter.html +3 -3
- data/rdoc/RubyXL/ColorScale.html +3 -3
- data/rdoc/RubyXL/ColorSet.html +3 -3
- data/rdoc/RubyXL/Colors.html +3 -3
- data/rdoc/RubyXL/ColumnRange.html +57 -20
- data/rdoc/RubyXL/ColumnRanges.html +37 -29
- data/rdoc/RubyXL/Comment.html +3 -3
- data/rdoc/RubyXL/CommentList.html +3 -3
- data/rdoc/RubyXL/CommentsFile.html +9 -7
- data/rdoc/RubyXL/ConditionalFormatValue.html +3 -3
- data/rdoc/RubyXL/ConditionalFormatting.html +3 -3
- data/rdoc/RubyXL/ConditionalFormattingRule.html +3 -3
- data/rdoc/RubyXL/Connection.html +3 -3
- data/rdoc/RubyXL/ConnectionTable.html +3 -3
- data/rdoc/RubyXL/ConnectionTables.html +3 -3
- data/rdoc/RubyXL/ConnectionTextField.html +3 -3
- data/rdoc/RubyXL/ConnectionTextFields.html +3 -3
- data/rdoc/RubyXL/Connections.html +9 -7
- data/rdoc/RubyXL/ContentTypeDefault.html +3 -3
- data/rdoc/RubyXL/ContentTypeOverride.html +3 -3
- data/rdoc/RubyXL/ContentTypes.html +15 -11
- data/rdoc/RubyXL/ControlPropertiesFile.html +3 -3
- data/rdoc/RubyXL/CorePropertiesFile.html +66 -48
- data/rdoc/RubyXL/CustomColor.html +3 -3
- data/rdoc/RubyXL/CustomColorList.html +3 -3
- data/rdoc/RubyXL/CustomFilter.html +3 -3
- data/rdoc/RubyXL/CustomFilters.html +3 -3
- data/rdoc/RubyXL/CustomGeometry.html +3 -3
- data/rdoc/RubyXL/CustomProperties.html +3 -3
- data/rdoc/RubyXL/CustomPropertiesFile.html +3 -3
- data/rdoc/RubyXL/CustomProperty.html +3 -3
- data/rdoc/RubyXL/CustomPropertyFile.html +3 -3
- data/rdoc/RubyXL/CustomSheetView.html +3 -3
- data/rdoc/RubyXL/CustomSheetViews.html +3 -3
- data/rdoc/RubyXL/CustomWorkbookView.html +3 -3
- data/rdoc/RubyXL/CustomWorkbookViews.html +3 -3
- data/rdoc/RubyXL/CustomXMLFile.html +3 -3
- data/rdoc/RubyXL/DXF.html +3 -3
- data/rdoc/RubyXL/DXFs.html +3 -3
- data/rdoc/RubyXL/DataBar.html +3 -3
- data/rdoc/RubyXL/DataConsolidate.html +3 -3
- data/rdoc/RubyXL/DataConsolidationReference.html +3 -3
- data/rdoc/RubyXL/DataConsolidationReferences.html +3 -3
- data/rdoc/RubyXL/DataType.html +3 -3
- data/rdoc/RubyXL/DataValidation.html +3 -3
- data/rdoc/RubyXL/DataValidations.html +3 -3
- data/rdoc/RubyXL/DateGroupItem.html +3 -3
- data/rdoc/RubyXL/DefinedName.html +3 -3
- data/rdoc/RubyXL/DefinedNameExt.html +3 -3
- data/rdoc/RubyXL/DefinedNames.html +3 -3
- data/rdoc/RubyXL/DefinedNamesExt.html +3 -3
- data/rdoc/RubyXL/DocumentPropertiesFile.html +17 -12
- data/rdoc/RubyXL/DrawingFile.html +9 -7
- data/rdoc/RubyXL/DynamicFilter.html +3 -3
- data/rdoc/RubyXL/EmbeddedControl.html +3 -3
- data/rdoc/RubyXL/EmbeddedControls.html +3 -3
- data/rdoc/RubyXL/Extension.html +3 -3
- data/rdoc/RubyXL/ExtensionStorageArea.html +3 -3
- data/rdoc/RubyXL/Extents.html +3 -3
- data/rdoc/RubyXL/ExternalBook.html +3 -3
- data/rdoc/RubyXL/ExternalLinksFile.html +10 -8
- data/rdoc/RubyXL/ExternalReference.html +3 -3
- data/rdoc/RubyXL/ExternalReferences.html +3 -3
- data/rdoc/RubyXL/ExtraColorSchemeList.html +3 -3
- data/rdoc/RubyXL/FieldItem.html +3 -3
- data/rdoc/RubyXL/FileRecoveryProperties.html +3 -3
- data/rdoc/RubyXL/FileSharing.html +3 -3
- data/rdoc/RubyXL/FileVersion.html +3 -3
- data/rdoc/RubyXL/Fill.html +9 -7
- data/rdoc/RubyXL/Fills.html +9 -7
- data/rdoc/RubyXL/FilterContainer.html +3 -3
- data/rdoc/RubyXL/FloatNode.html +3 -3
- data/rdoc/RubyXL/FloatValue.html +3 -3
- data/rdoc/RubyXL/Font.html +9 -7
- data/rdoc/RubyXL/FontConvenienceMethods.html +87 -59
- data/rdoc/RubyXL/FontScheme.html +3 -3
- data/rdoc/RubyXL/Fonts.html +9 -7
- data/rdoc/RubyXL/Formula.html +3 -3
- data/rdoc/RubyXL/FunctionGroup.html +3 -3
- data/rdoc/RubyXL/FunctionGroups.html +3 -3
- data/rdoc/RubyXL/GenericStorageObject.html +22 -16
- data/rdoc/RubyXL/GradientFill.html +3 -3
- data/rdoc/RubyXL/HeaderFooterSettings.html +3 -3
- data/rdoc/RubyXL/Hyperlink.html +3 -3
- data/rdoc/RubyXL/HyperlinkRelFile.html +3 -3
- data/rdoc/RubyXL/Hyperlinks.html +3 -3
- data/rdoc/RubyXL/IconFilter.html +3 -3
- data/rdoc/RubyXL/IconSet.html +3 -3
- data/rdoc/RubyXL/IgnoredError.html +3 -3
- data/rdoc/RubyXL/IgnoredErrors.html +3 -3
- data/rdoc/RubyXL/IndexedColors.html +3 -3
- data/rdoc/RubyXL/InputCells.html +3 -3
- data/rdoc/RubyXL/IntegerNode.html +3 -3
- data/rdoc/RubyXL/IntegerValue.html +3 -3
- data/rdoc/RubyXL/LegacyCell.html +9 -7
- data/rdoc/RubyXL/LegacyWorksheet.html +55 -30
- data/rdoc/RubyXL/MRUColors.html +3 -3
- data/rdoc/RubyXL/MacrosFile.html +3 -3
- data/rdoc/RubyXL/MergedCell.html +3 -3
- data/rdoc/RubyXL/MergedCells.html +3 -3
- data/rdoc/RubyXL/NumFmt.html +3 -3
- data/rdoc/RubyXL/NumberFormat.html +9 -7
- data/rdoc/RubyXL/NumberFormats.html +9 -7
- data/rdoc/RubyXL/OLEObject.html +3 -3
- data/rdoc/RubyXL/OLEObjectFile.html +3 -3
- data/rdoc/RubyXL/OLEObjects.html +3 -3
- data/rdoc/RubyXL/OLESize.html +3 -3
- data/rdoc/RubyXL/OOXMLContainerObject.html +46 -34
- data/rdoc/RubyXL/OOXMLIgnored.html +15 -11
- data/rdoc/RubyXL/OOXMLObject.html +3 -3
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +46 -31
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +67 -52
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +64 -44
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +38 -28
- data/rdoc/RubyXL/OdbcOleDbProperties.html +3 -3
- data/rdoc/RubyXL/Offset.html +3 -3
- data/rdoc/RubyXL/OlapProperties.html +3 -3
- data/rdoc/RubyXL/OleItem.html +3 -3
- data/rdoc/RubyXL/OleItems.html +3 -3
- data/rdoc/RubyXL/OleLink.html +3 -3
- data/rdoc/RubyXL/OutlineProperties.html +3 -3
- data/rdoc/RubyXL/PageMargins.html +3 -3
- data/rdoc/RubyXL/PageSetup.html +3 -3
- data/rdoc/RubyXL/PageSetupProperties.html +3 -3
- data/rdoc/RubyXL/Pane.html +3 -3
- data/rdoc/RubyXL/Parser.html +15 -11
- data/rdoc/RubyXL/PatternFill.html +3 -3
- data/rdoc/RubyXL/PersonMetadata.html +108 -0
- data/rdoc/RubyXL/PhoneticProperties.html +3 -3
- data/rdoc/RubyXL/PhoneticRun.html +3 -3
- data/rdoc/RubyXL/PivotArea.html +3 -3
- data/rdoc/RubyXL/PivotCache.html +3 -3
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +3 -3
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +3 -3
- data/rdoc/RubyXL/PivotCaches.html +3 -3
- data/rdoc/RubyXL/PivotReference.html +3 -3
- data/rdoc/RubyXL/PivotReferences.html +3 -3
- data/rdoc/RubyXL/PivotTableFile.html +3 -3
- data/rdoc/RubyXL/PivotTableSelection.html +3 -3
- data/rdoc/RubyXL/PresetGeometry.html +3 -3
- data/rdoc/RubyXL/PrintOptions.html +3 -3
- data/rdoc/RubyXL/PrinterSettingsFile.html +3 -3
- data/rdoc/RubyXL/ProtectedRange.html +3 -3
- data/rdoc/RubyXL/ProtectedRanges.html +3 -3
- data/rdoc/RubyXL/Protection.html +3 -3
- data/rdoc/RubyXL/QueryParameter.html +3 -3
- data/rdoc/RubyXL/QueryParameters.html +3 -3
- data/rdoc/RubyXL/QueryTable.html +10 -8
- data/rdoc/RubyXL/QueryTableDeletedField.html +3 -3
- data/rdoc/RubyXL/QueryTableDeletedFields.html +3 -3
- data/rdoc/RubyXL/QueryTableField.html +3 -3
- data/rdoc/RubyXL/QueryTableFields.html +3 -3
- data/rdoc/RubyXL/QueryTableRefresh.html +3 -3
- data/rdoc/RubyXL/RID.html +3 -3
- data/rdoc/RubyXL/RawOOXML.html +15 -11
- data/rdoc/RubyXL/Reference.html +113 -77
- data/rdoc/RubyXL/Relationship.html +3 -3
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +9 -7
- data/rdoc/RubyXL/RelationshipSupport.html +39 -27
- data/rdoc/RubyXL/RevisionPointer.html +3 -3
- data/rdoc/RubyXL/RichText.html +11 -9
- data/rdoc/RubyXL/RichTextRun.html +9 -7
- data/rdoc/RubyXL/Row.html +57 -39
- data/rdoc/RubyXL/RowExt.html +3 -3
- data/rdoc/RubyXL/RunProperties.html +3 -3
- data/rdoc/RubyXL/Scenario.html +3 -3
- data/rdoc/RubyXL/Scenarios.html +3 -3
- data/rdoc/RubyXL/Selection.html +9 -7
- data/rdoc/RubyXL/ShapeGuide.html +3 -3
- data/rdoc/RubyXL/ShapeTextRectangle.html +3 -3
- data/rdoc/RubyXL/SharedStringsTable.html +46 -32
- data/rdoc/RubyXL/Sheet.html +3 -3
- data/rdoc/RubyXL/SheetCalculationProperties.html +3 -3
- data/rdoc/RubyXL/SheetData.html +15 -11
- data/rdoc/RubyXL/SheetDataExt.html +3 -3
- data/rdoc/RubyXL/SheetDataSet.html +3 -3
- data/rdoc/RubyXL/SheetMetadata.html +3 -3
- data/rdoc/RubyXL/SheetName.html +3 -3
- data/rdoc/RubyXL/SheetNames.html +3 -3
- data/rdoc/RubyXL/Sheets.html +3 -3
- data/rdoc/RubyXL/SlicerCacheFile.html +3 -3
- data/rdoc/RubyXL/SlicerFile.html +3 -3
- data/rdoc/RubyXL/SmartTagProperties.html +3 -3
- data/rdoc/RubyXL/SmartTagType.html +3 -3
- data/rdoc/RubyXL/SmartTagTypes.html +3 -3
- data/rdoc/RubyXL/SmartTags.html +3 -3
- data/rdoc/RubyXL/SortCondition.html +3 -3
- data/rdoc/RubyXL/SortState.html +3 -3
- data/rdoc/RubyXL/Sqref.html +18 -14
- data/rdoc/RubyXL/Stop.html +3 -3
- data/rdoc/RubyXL/StringNode.html +3 -3
- data/rdoc/RubyXL/StringNodeW3C.html +15 -11
- data/rdoc/RubyXL/StringValue.html +3 -3
- data/rdoc/RubyXL/Stylesheet.html +38 -28
- data/rdoc/RubyXL/TableFile.html +3 -3
- data/rdoc/RubyXL/TableParts.html +3 -3
- data/rdoc/RubyXL/TableStyle.html +3 -3
- data/rdoc/RubyXL/TableStyles.html +3 -3
- data/rdoc/RubyXL/Text.html +16 -12
- data/rdoc/RubyXL/TextImportSettings.html +3 -3
- data/rdoc/RubyXL/Theme.html +39 -33
- data/rdoc/RubyXL/ThemeElements.html +3 -3
- data/rdoc/RubyXL/ThumbnailFile.html +3 -3
- data/rdoc/RubyXL/Top10.html +3 -3
- data/rdoc/RubyXL/VMLDrawingFile.html +3 -3
- data/rdoc/RubyXL/Variant.html +3 -3
- data/rdoc/RubyXL/Vector.html +9 -7
- data/rdoc/RubyXL/VectorValue.html +3 -3
- data/rdoc/RubyXL/VisualProperties.html +3 -3
- data/rdoc/RubyXL/WebPublishObject.html +3 -3
- data/rdoc/RubyXL/WebPublishObjects.html +3 -3
- data/rdoc/RubyXL/WebPublishingItem.html +3 -3
- data/rdoc/RubyXL/WebPublishingItems.html +3 -3
- data/rdoc/RubyXL/WebPublishingProperties.html +3 -3
- data/rdoc/RubyXL/WebQueryProperties.html +3 -3
- data/rdoc/RubyXL/Workbook.html +202 -146
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +124 -92
- data/rdoc/RubyXL/WorkbookProperties.html +3 -3
- data/rdoc/RubyXL/WorkbookProtection.html +3 -3
- data/rdoc/RubyXL/WorkbookRoot.html +33 -23
- data/rdoc/RubyXL/WorkbookView.html +3 -3
- data/rdoc/RubyXL/WorkbookViews.html +3 -3
- data/rdoc/RubyXL/Worksheet.html +45 -31
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +443 -288
- data/rdoc/RubyXL/WorksheetDimensions.html +3 -3
- data/rdoc/RubyXL/WorksheetFormatProperties.html +3 -3
- data/rdoc/RubyXL/WorksheetProperties.html +3 -3
- data/rdoc/RubyXL/WorksheetProtection.html +3 -3
- data/rdoc/RubyXL/WorksheetView.html +3 -3
- data/rdoc/RubyXL/WorksheetViews.html +3 -3
- data/rdoc/RubyXL/XF.html +3 -3
- data/rdoc/RubyXL.html +9 -7
- data/rdoc/created.rid +35 -35
- data/rdoc/css/rdoc.css +55 -7
- data/rdoc/index.html +395 -388
- data/rdoc/js/darkfish.js +14 -1
- data/rdoc/js/navigation.js +8 -8
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +4 -4
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +14 -3
- data/rubyXL.gemspec +10 -5
- data/spec/lib/cell_spec.rb +30 -4
- data/spec/lib/color_spec.rb +7 -0
- data/spec/lib/parser_spec.rb +8 -5
- data/spec/lib/reference_spec.rb +35 -5
- data/spec/lib/rgb_color_spec.rb +2 -0
- data/spec/lib/stylesheet_spec.rb +2 -0
- data/spec/lib/text_spec.rb +3 -1
- data/spec/lib/workbook_spec.rb +6 -4
- data/spec/lib/worksheet_spec.rb +29 -17
- metadata +21 -4
- data/Gemfile.lock +0 -124
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 14119a8af99822bbe1fd209a060d5374e92fe921750766cc83fa2cebdf586963
|
4
|
+
data.tar.gz: a3870a59650bd9b32c82bd6ad950aa720cb9f50370b96956eecb522d1c8e8fce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 27f8bf50de4801721703c78a73b156626998d37a7fa1ce76a05e2848d9bf233a29ed91044567b2b02a8cd29487872f2a5ed2eeeb65c45ae6b3fed8b4bfccea25
|
7
|
+
data.tar.gz: 7ba264f255d544ba9efb9bb5aaa272a2ba84442930bf41eb72c6a63571b0ed21a69255975c843b796725ce17ca29c81950b1784a0c027a54dc35e4801ea0870e
|
data/.circleci/config.yml
CHANGED
data/.rubocop.yml
ADDED
@@ -0,0 +1,124 @@
|
|
1
|
+
#inherit_from: .rubocop_todo.yml
|
2
|
+
|
3
|
+
#require:
|
4
|
+
# - rubocop-rspec
|
5
|
+
|
6
|
+
AllCops:
|
7
|
+
NewCops: enable
|
8
|
+
SuggestExtensions: false
|
9
|
+
TargetRubyVersion: 2.6
|
10
|
+
DisplayCopNames: true
|
11
|
+
DisplayStyleGuide: true
|
12
|
+
Exclude:
|
13
|
+
- test/**/*
|
14
|
+
- tmp/*
|
15
|
+
- vendor/**/*
|
16
|
+
- Gemfile
|
17
|
+
- rubyXL.gemspec
|
18
|
+
|
19
|
+
# "Excessive" parentheses are your friend. You will understand it in time, Luke.
|
20
|
+
Style/TernaryParentheses:
|
21
|
+
Enabled: false
|
22
|
+
|
23
|
+
# Implicity is evil. Unwilingness to type a couple extra characters is laziness.
|
24
|
+
Style/RedundantConstantBase:
|
25
|
+
Enabled: false
|
26
|
+
|
27
|
+
# I don't see a good reason in this. Unless you are paid per line.
|
28
|
+
Style/CommentedKeyword:
|
29
|
+
Enabled: false
|
30
|
+
|
31
|
+
# Yes, some things are "redundant" but they are there exactly to drive home some point...
|
32
|
+
Style/RedundantSelf:
|
33
|
+
Enabled: false
|
34
|
+
|
35
|
+
Naming/AccessorMethodName:
|
36
|
+
Enabled: false
|
37
|
+
|
38
|
+
Layout/FirstArrayElementIndentation:
|
39
|
+
Enabled: false
|
40
|
+
|
41
|
+
Style/Documentation:
|
42
|
+
Enabled: false
|
43
|
+
|
44
|
+
Layout/LeadingCommentSpace:
|
45
|
+
Enabled: false
|
46
|
+
|
47
|
+
Style/BlockDelimiters:
|
48
|
+
Enabled: false
|
49
|
+
|
50
|
+
Style/HashSyntax:
|
51
|
+
Enabled: false
|
52
|
+
|
53
|
+
Style/MultilineIfThen:
|
54
|
+
Enabled: false
|
55
|
+
|
56
|
+
Style/ParenthesesAroundCondition:
|
57
|
+
Enabled: false
|
58
|
+
|
59
|
+
Style/MultilineWhenThen:
|
60
|
+
Enabled: false
|
61
|
+
|
62
|
+
Style/RedundantPercentQ:
|
63
|
+
Enabled: false
|
64
|
+
|
65
|
+
Style/PercentLiteralDelimiters:
|
66
|
+
Enabled: false
|
67
|
+
|
68
|
+
Style/NumericLiterals:
|
69
|
+
Enabled: false
|
70
|
+
|
71
|
+
Style/ExponentialNotation:
|
72
|
+
Enabled: false
|
73
|
+
|
74
|
+
Layout/SpaceInsideArrayLiteralBrackets:
|
75
|
+
EnforcedStyle: space
|
76
|
+
Enabled: false
|
77
|
+
|
78
|
+
Layout/SpaceBeforeBlockBraces:
|
79
|
+
Enabled: false
|
80
|
+
|
81
|
+
Layout/EmptyLineAfterGuardClause:
|
82
|
+
Enabled: false
|
83
|
+
|
84
|
+
Naming/MethodParameterName:
|
85
|
+
Enabled: false
|
86
|
+
|
87
|
+
Naming/ClassAndModuleCamelCase:
|
88
|
+
Enabled: false
|
89
|
+
|
90
|
+
Naming/ConstantName:
|
91
|
+
Enabled: false
|
92
|
+
|
93
|
+
|
94
|
+
|
95
|
+
Layout/HashAlignment:
|
96
|
+
EnforcedHashRocketStyle: table
|
97
|
+
|
98
|
+
Layout/SpaceInsidePercentLiteralDelimiters:
|
99
|
+
Enabled: false
|
100
|
+
|
101
|
+
|
102
|
+
|
103
|
+
Metrics/BlockLength:
|
104
|
+
Enabled: false
|
105
|
+
|
106
|
+
Metrics/ClassLength:
|
107
|
+
Enabled: false
|
108
|
+
|
109
|
+
Metrics/MethodLength:
|
110
|
+
Enabled: false
|
111
|
+
|
112
|
+
|
113
|
+
|
114
|
+
Metrics/PerceivedComplexity:
|
115
|
+
Enabled: false
|
116
|
+
|
117
|
+
Metrics/ParameterLists:
|
118
|
+
Enabled: false
|
119
|
+
|
120
|
+
Metrics/CyclomaticComplexity:
|
121
|
+
Enabled: false
|
122
|
+
|
123
|
+
Metrics/ModuleLength:
|
124
|
+
Enabled: false
|
data/CHANGELOG.md
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
# v3.4.25 (May 19, 2022)
|
2
|
+
|
3
|
+
* Improve code style and consistently (@weshatheleopard)
|
4
|
+
* Update `Gemfile.lock`, dependency versions used when developing the gem (@weshatheleopard)
|
5
|
+
|
6
|
+
# v3.4.24 (May 16, 2022)
|
7
|
+
|
8
|
+
* Add `Cell#add_hyperlink` for adding a hyperlink to a cell (@weshatheleopard)
|
9
|
+
* Add `Reference#valid?` for checking if a cell reference is valid (@weshatheleopard)
|
10
|
+
* Add `Worksheet#cell_at` for finding a cell by its Excel-style reference (@weshatheleopard)
|
11
|
+
* Prevent creation of sheets with reserved names (specifically, `History`) (@weshatheleopard)
|
12
|
+
* Update `Gemfile.lock`, dependency versions used when developing the gem (@weshatheleopard)
|
data/Gemfile
CHANGED
data/README.rdoc
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
= rubyXL
|
2
|
-
{
|
3
|
-
{
|
4
|
-
{
|
2
|
+
{rdoc-image:https://badge.fury.io/rb/rubyXL.svg}[http://badge.fury.io/rb/rubyXL]
|
3
|
+
{rdoc-image:https://codeclimate.com/github/weshatheleopard/rubyXL.png}[https://codeclimate.com/github/weshatheleopard/rubyXL]
|
4
|
+
{rdoc-image:https://circleci.com/gh/weshatheleopard/rubyXL.svg?style=svg}[https://circleci.com/gh/weshatheleopard/rubyXL]
|
5
5
|
|
6
6
|
This gem supports operating on +xlsx+ files (Open XML format). While it is capable
|
7
7
|
of properly parsing the entire OOXML structure, its current main emphasis is on
|
@@ -168,7 +168,9 @@ Please note: these methods are being phased out in favor of the OOXML object mod
|
|
168
168
|
worksheet.change_column_width(0, 30) # Sets first column width to 30
|
169
169
|
|
170
170
|
==== Merging Cells
|
171
|
-
worksheet.merge_cells(0,
|
171
|
+
worksheet.merge_cells(0, 1, 2, 3) # Merges B1:D3
|
172
|
+
worksheet.merge_cells('A2:C4') # Merges A2:C4
|
173
|
+
worksheet.merge_cells(row_from: 0, row_to: 1, col_from 2:, col_to: 3) # Merges C1:D2
|
172
174
|
|
173
175
|
==== Insert Row
|
174
176
|
This method will insert a row at specified index, pushing all rows below it down. It also copies styles from row above.
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
3.4.
|
1
|
+
3.4.33
|
@@ -48,8 +48,8 @@ module RubyXL
|
|
48
48
|
end
|
49
49
|
|
50
50
|
hls_color.h = (g - b) / delta if (r == max)
|
51
|
-
hls_color.h = 2.0 + (b - r) / delta if (g == max)
|
52
|
-
hls_color.h = 4.0 + (r - g) / delta if (b == max)
|
51
|
+
hls_color.h = 2.0 + ((b - r) / delta) if (g == max)
|
52
|
+
hls_color.h = 4.0 + ((r - g) / delta) if (b == max)
|
53
53
|
|
54
54
|
hls_color.h *= 60;
|
55
55
|
hls_color.h += 360 if hls_color.h < 0
|
@@ -95,7 +95,7 @@ module RubyXL
|
|
95
95
|
t1 = l + s - (l * s)
|
96
96
|
end
|
97
97
|
|
98
|
-
t2 = 2.0 * l - t1;
|
98
|
+
t2 = (2.0 * l) - t1;
|
99
99
|
h = self.h / 360.0
|
100
100
|
|
101
101
|
t_r = h + (1.0 / 3.0)
|
@@ -124,11 +124,11 @@ module RubyXL
|
|
124
124
|
t3 -= 1.0 if (t3 > 1)
|
125
125
|
|
126
126
|
if (6.0 * t3 < 1) then
|
127
|
-
color = t2 + (t1 - t2) * 6.0 * t3;
|
127
|
+
color = t2 + ((t1 - t2) * 6.0 * t3);
|
128
128
|
elsif (2.0 * t3 < 1) then
|
129
129
|
color = t1;
|
130
130
|
elsif (3.0 * t3 < 2) then
|
131
|
-
color = t2 + (t1 - t2) * ((2.0 / 3.0) - t3) * 6.0;
|
131
|
+
color = t2 + ((t1 - t2) * ((2.0 / 3.0) - t3) * 6.0);
|
132
132
|
else
|
133
133
|
color = t2;
|
134
134
|
end
|
@@ -143,7 +143,7 @@ module RubyXL
|
|
143
143
|
if tint < 0 then
|
144
144
|
self.l = l * (1.0 + tint);
|
145
145
|
else
|
146
|
-
self.l = l * (1.0 - tint) + tint;
|
146
|
+
self.l = (l * (1.0 - tint)) + tint;
|
147
147
|
end
|
148
148
|
|
149
149
|
self
|
@@ -21,11 +21,7 @@ module RubyXL
|
|
21
21
|
end
|
22
22
|
|
23
23
|
def get_fill_color(xf)
|
24
|
-
|
25
|
-
pattern = fill && fill.pattern_fill
|
26
|
-
color = pattern && pattern.fg_color
|
27
|
-
color = color && color.get_rgb(self)
|
28
|
-
color && color.to_s || 'ffffff'
|
24
|
+
fills[xf.fill_id]&.pattern_fill&.fg_color&.get_rgb(self)&.to_s || 'ffffff'
|
29
25
|
end
|
30
26
|
|
31
27
|
def register_new_fill(new_fill, old_xf)
|
@@ -206,10 +206,10 @@ module RubyXL
|
|
206
206
|
validate_nonnegative(column_index)
|
207
207
|
|
208
208
|
# Delete column
|
209
|
-
sheet_data.rows.each { |row| row
|
209
|
+
sheet_data.rows.each { |row| row&.cells&.delete_at(column_index) }
|
210
210
|
|
211
211
|
# Update column numbers for cells to the right of the deleted column
|
212
|
-
sheet_data.rows.
|
212
|
+
sheet_data.rows.each { |row|
|
213
213
|
next if row.nil?
|
214
214
|
row.cells.each_with_index { |c, ci|
|
215
215
|
c.column = ci if c.is_a?(Cell)
|
@@ -280,7 +280,7 @@ module RubyXL
|
|
280
280
|
validate_workbook
|
281
281
|
validate_nonnegative(row)
|
282
282
|
row = sheet_data.rows[row]
|
283
|
-
row && row.ht || RubyXL::Row::DEFAULT_HEIGHT
|
283
|
+
(row && row.ht) || RubyXL::Row::DEFAULT_HEIGHT
|
284
284
|
end
|
285
285
|
|
286
286
|
def get_row_border(row, border_direction)
|
@@ -382,7 +382,7 @@ module RubyXL
|
|
382
382
|
# Get column width measured in number of digits, as per
|
383
383
|
# http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.column%28v=office.14%29.aspx
|
384
384
|
def change_column_width(column_index, width_in_chars = RubyXL::ColumnRange::DEFAULT_WIDTH)
|
385
|
-
change_column_width_raw(column_index,
|
385
|
+
change_column_width_raw(column_index, RubyXL::ColumnRange::chars2raw(width_in_chars))
|
386
386
|
end
|
387
387
|
|
388
388
|
# Helper method to get the style index for a column
|
@@ -689,12 +689,32 @@ module RubyXL
|
|
689
689
|
end
|
690
690
|
|
691
691
|
# Merges cells within a rectangular area
|
692
|
-
|
692
|
+
# #merge_cells(row_from, col_from, row_to, col_to)
|
693
|
+
# #merge_cells(reference_string)
|
694
|
+
# #merge_cells(row_from:, row_to:, col_from:, col_to:)
|
695
|
+
def merge_cells(*params)
|
693
696
|
validate_workbook
|
694
697
|
|
698
|
+
row_from = col_from = row_to = col_to = nil
|
699
|
+
case params.size
|
700
|
+
when 4 then row_from, col_from, row_to, col_to = params
|
701
|
+
when 1 then
|
702
|
+
case params.first
|
703
|
+
when Hash then
|
704
|
+
row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
|
705
|
+
when String then
|
706
|
+
from, to = params[0].split(':')
|
707
|
+
raise ArgumentError.new("reference for merging cells must be a range") if to.nil?
|
708
|
+
row_from, col_from = RubyXL::Reference.ref2ind(from)
|
709
|
+
row_to, col_to = RubyXL::Reference.ref2ind(to)
|
710
|
+
else
|
711
|
+
raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
|
712
|
+
end
|
713
|
+
end
|
714
|
+
|
695
715
|
self.merged_cells ||= RubyXL::MergedCells.new
|
696
716
|
# TODO: add validation to make sure ranges are not intersecting with existing ones
|
697
|
-
merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(
|
717
|
+
merged_cells << RubyXL::MergedCell.new(:ref => RubyXL::Reference.new(row_from, row_to, col_from, col_to))
|
698
718
|
end
|
699
719
|
|
700
720
|
def add_validation_list(ref, list_arr)
|
data/lib/rubyXL/objects/color.rb
CHANGED
@@ -4,7 +4,7 @@ require 'rubyXL/objects/simple_types'
|
|
4
4
|
module RubyXL
|
5
5
|
# http://www.datypic.com/sc/ooxml/e-ssml_color-4.html
|
6
6
|
class Color < OOXMLObject
|
7
|
-
COLOR_REGEXP = /\A([a-
|
7
|
+
COLOR_REGEXP = /\A(?:[a-f0-9]{6}|[a-f0-9]{8})\Z/i
|
8
8
|
|
9
9
|
define_attribute(:auto, :bool)
|
10
10
|
define_attribute(:indexed, :uint)
|
@@ -17,21 +17,25 @@ module RubyXL
|
|
17
17
|
|
18
18
|
def delete_column(col_index)
|
19
19
|
col = col_index + 1
|
20
|
-
self.min -=1 if min >= col
|
21
|
-
self.max -=1 if max >= col
|
20
|
+
self.min -= 1 if min >= col
|
21
|
+
self.max -= 1 if max >= col
|
22
22
|
end
|
23
23
|
|
24
24
|
def insert_column(col_index)
|
25
25
|
col = col_index + 1
|
26
|
-
self.min +=1 if min >= col
|
27
|
-
self.max +=1 if max >= col - 1
|
26
|
+
self.min += 1 if min >= col
|
27
|
+
self.max += 1 if max >= col - 1
|
28
28
|
end
|
29
29
|
|
30
30
|
def include?(col_index)
|
31
|
-
((min-1)..(max-1)).include?(col_index)
|
31
|
+
((min - 1)..(max - 1)).include?(col_index)
|
32
32
|
end
|
33
33
|
|
34
|
-
|
34
|
+
def self.chars2raw(width_in_chars)
|
35
|
+
((width_in_chars + (5.0 / RubyXL::Font::MAX_DIGIT_WIDTH)) * 256).to_i / 256.0
|
36
|
+
end
|
37
|
+
|
38
|
+
DEFAULT_WIDTH = 8
|
35
39
|
end
|
36
40
|
|
37
41
|
class ColumnRanges < OOXMLContainerObject
|
@@ -47,7 +51,7 @@ module RubyXL
|
|
47
51
|
old_range = self.locate_range(col_index)
|
48
52
|
|
49
53
|
if old_range.nil? then
|
50
|
-
new_range = RubyXL::ColumnRange.new
|
54
|
+
new_range = RubyXL::ColumnRange.new(width: RubyXL::ColumnRange.chars2raw(RubyXL::ColumnRange::DEFAULT_WIDTH))
|
51
55
|
else
|
52
56
|
if old_range.min == col_num && old_range.max == col_num then
|
53
57
|
return old_range # Single column range, OK to change in place
|
@@ -58,9 +62,9 @@ module RubyXL
|
|
58
62
|
new_range = old_range.dup
|
59
63
|
old_range.max -= 1
|
60
64
|
else
|
61
|
-
|
62
|
-
|
63
|
-
self <<
|
65
|
+
prior_range = old_range.dup
|
66
|
+
prior_range.max = col_index # col_num - 1
|
67
|
+
self << prior_range
|
64
68
|
|
65
69
|
old_range.min = col_num + 1
|
66
70
|
|
@@ -82,8 +86,8 @@ module RubyXL
|
|
82
86
|
end
|
83
87
|
|
84
88
|
def before_write_xml
|
85
|
-
self.sort_by!
|
86
|
-
!
|
89
|
+
self.sort_by!(&:min)
|
90
|
+
!self.empty?
|
87
91
|
end
|
88
92
|
end
|
89
93
|
end
|
@@ -55,11 +55,19 @@ module RubyXL
|
|
55
55
|
define_element_name 'sheetDataSet'
|
56
56
|
end
|
57
57
|
|
58
|
+
# https://learn.microsoft.com/en-us/openspecs/office_standards/ms-xlsx/452524b4-b22f-45a9-aac1-81fdd1f1db6c
|
59
|
+
class AlternateUrls < OOXMLObject
|
60
|
+
define_attribute(:absoluteUrl, :string, :required => false)
|
61
|
+
define_attribute(:relativeUrl, :string, :required => false)
|
62
|
+
define_element_name 'xxl21:alternateUrls'
|
63
|
+
end
|
64
|
+
|
58
65
|
# http://www.datypic.com/sc/ooxml/e-ssml_externalBook-1.html
|
59
66
|
class ExternalBook < OOXMLObject
|
60
67
|
define_child_node(RubyXL::SheetNames)
|
61
68
|
define_child_node(RubyXL::DefinedNamesExt)
|
62
69
|
define_child_node(RubyXL::SheetDataSet)
|
70
|
+
define_child_node(RubyXL::AlternateUrls)
|
63
71
|
define_relationship(:required => true)
|
64
72
|
define_element_name 'externalBook'
|
65
73
|
end
|
@@ -21,7 +21,7 @@ module RubyXL
|
|
21
21
|
# Defines an attribute of OOXML object.
|
22
22
|
# === Parameters
|
23
23
|
# * +attribute_name+ - Name of the element attribute as seen in the source XML. Can be either <tt>"String"</tt> or <tt>:Symbol</tt>
|
24
|
-
# * Special
|
24
|
+
# * Special attribute name <tt>'_'</tt> (underscore) denotes the value of the element rather than attribute.
|
25
25
|
# * +attribute_type+ - Specifies the conversion type for the attribute when parsing. Available options are:
|
26
26
|
# * +:int+ - <tt>Integer</tt>
|
27
27
|
# * +:uint+ - Unsigned <tt>Integer</tt>
|
@@ -123,7 +123,9 @@ module RubyXL
|
|
123
123
|
end
|
124
124
|
|
125
125
|
obj = self.new
|
126
|
-
|
126
|
+
hsh = {}
|
127
|
+
node.namespace_definitions.each { |ns| hsh[ns.href] = ns.prefix }
|
128
|
+
obj.local_namespaces = hsh
|
127
129
|
|
128
130
|
known_attributes = obtain_class_variable(:@@ooxml_attributes)
|
129
131
|
|
@@ -149,8 +151,9 @@ module RubyXL
|
|
149
151
|
|
150
152
|
node.element_children.each { |child_node|
|
151
153
|
ns = child_node.namespace
|
152
|
-
|
153
|
-
|
154
|
+
|
155
|
+
prefix = if known_namespaces.has_key?(ns&.href) then known_namespaces[ns&.href]
|
156
|
+
else ns&.prefix
|
154
157
|
end
|
155
158
|
|
156
159
|
child_node_name = case prefix
|
@@ -254,8 +257,8 @@ module RubyXL
|
|
254
257
|
|
255
258
|
def ==(other)
|
256
259
|
other.is_a?(self.class) &&
|
257
|
-
obtain_class_variable(:@@ooxml_attributes).all? { |
|
258
|
-
obtain_class_variable(:@@ooxml_child_nodes).all? { |
|
260
|
+
obtain_class_variable(:@@ooxml_attributes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) } &&
|
261
|
+
obtain_class_variable(:@@ooxml_child_nodes).all? { |_k, v| self.send(v[:accessor]) == other.send(v[:accessor]) }
|
259
262
|
end
|
260
263
|
|
261
264
|
# Recursively write the OOXML object and all its children out as Nokogiri::XML. Immediately before the actual
|
@@ -312,12 +315,11 @@ module RubyXL
|
|
312
315
|
element_text = attrs.delete('_')
|
313
316
|
elem = xml.create_element(node_name_override || obtain_class_variable(:@@ooxml_tag_name), attrs, element_text)
|
314
317
|
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
end
|
318
|
+
# First, populate namespaces from the original document
|
319
|
+
@local_namespaces&.each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
|
320
|
+
|
321
|
+
# Then, add defaults. Note that if some namespace prefix was already set, Nokogiri will NOT change that namespace.
|
322
|
+
obtain_class_variable(:@@ooxml_namespaces).each_pair { |href, prefix| elem.add_namespace_definition(prefix, href) }
|
321
323
|
|
322
324
|
child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
|
323
325
|
child_nodes.each_pair { |child_node_name, child_node_params|
|
@@ -355,7 +357,7 @@ module RubyXL
|
|
355
357
|
def before_write_xml
|
356
358
|
#TODO# This will go away once containers are fully implemented.
|
357
359
|
child_nodes = obtain_class_variable(:@@ooxml_child_nodes)
|
358
|
-
child_nodes.each_pair { |
|
360
|
+
child_nodes.each_pair { |_child_node_name, child_node_params|
|
359
361
|
self.count = self.send(child_node_params[:accessor]).size if child_node_params[:is_array] == :with_count
|
360
362
|
}
|
361
363
|
true
|
@@ -369,7 +371,7 @@ module RubyXL
|
|
369
371
|
include OOXMLObjectInstanceMethods
|
370
372
|
end
|
371
373
|
|
372
|
-
# Parent class for OOXML
|
374
|
+
# Parent class for OOXML container objects (for example,
|
373
375
|
# <tt><fonts><font>...</font><font>...</font></fonts></tt>
|
374
376
|
# that obscures the top-level container, allowing direct access to the contents as +Array+.
|
375
377
|
class OOXMLContainerObject < Array
|
@@ -25,7 +25,8 @@ module RubyXL
|
|
25
25
|
|
26
26
|
# http://www.datypic.com/sc/ooxml/e-ssml_queryTableFields-1.html
|
27
27
|
class QueryTableFields < OOXMLObject
|
28
|
-
define_child_node(RubyXL::QueryTableField, :collection => :with_count,
|
28
|
+
define_child_node(RubyXL::QueryTableField, :collection => :with_count,
|
29
|
+
:accessor => :fields, :node_name => :queryTableField)
|
29
30
|
define_element_name 'queryTableFields'
|
30
31
|
end
|
31
32
|
|
@@ -38,7 +39,8 @@ module RubyXL
|
|
38
39
|
|
39
40
|
# http://www.datypic.com/sc/ooxml/e-ssml_queryTableDeletedFields-1.html
|
40
41
|
class QueryTableDeletedFields < OOXMLObject
|
41
|
-
define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count,
|
42
|
+
define_child_node(RubyXL::QueryTableDeletedField, :collection => :with_count,
|
43
|
+
:accessor => :deleted_fields, :node_name => :deletedField)
|
42
44
|
define_element_name 'queryTableDeletedFields'
|
43
45
|
end
|
44
46
|
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module RubyXL
|
2
2
|
class Reference
|
3
|
-
ROW_MAX = 1024*1024
|
3
|
+
ROW_MAX = 1024 * 1024
|
4
4
|
COL_MAX = 16393
|
5
5
|
|
6
6
|
attr_reader :row_range, :col_range
|
@@ -8,6 +8,7 @@ module RubyXL
|
|
8
8
|
# RubyXL::Reference.new(row, col)
|
9
9
|
# RubyXL::Reference.new(row_from, row_to, col_from, col_to)
|
10
10
|
# RubyXL::Reference.new(reference_string)
|
11
|
+
# RubyXL::Reference.new(row_from:, row_to:, col_from:, col_to:)
|
11
12
|
def initialize(*params)
|
12
13
|
row_from = row_to = col_from = col_to = nil
|
13
14
|
|
@@ -15,10 +16,16 @@ module RubyXL
|
|
15
16
|
when 4 then row_from, row_to, col_from, col_to = params
|
16
17
|
when 2 then row_from, col_from = params
|
17
18
|
when 1 then
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
19
|
+
case params.first
|
20
|
+
when Hash then
|
21
|
+
row_from, row_to, col_from, col_to = params.first.fetch_values(:row_from, :row_to, :col_from, :col_to)
|
22
|
+
when String then
|
23
|
+
from, to = params[0].split(':')
|
24
|
+
row_from, col_from = self.class.ref2ind(from)
|
25
|
+
row_to, col_to = self.class.ref2ind(to) unless to.nil?
|
26
|
+
else
|
27
|
+
raise ArgumentError.new("invalid value for #{self.class}: #{params[0].inspect}") unless params[0].is_a?(String)
|
28
|
+
end
|
22
29
|
end
|
23
30
|
|
24
31
|
@row_range = Range.new(row_from || 0, row_to || row_from || ROW_MAX)
|
@@ -54,15 +61,18 @@ module RubyXL
|
|
54
61
|
end
|
55
62
|
|
56
63
|
def cover?(other)
|
57
|
-
!other.nil? && (@row_range.cover?(other.row_range.begin) &&
|
58
|
-
@
|
64
|
+
!other.nil? && (@row_range.cover?(other.row_range.begin) &&
|
65
|
+
@row_range.cover?(other.row_range.end) &&
|
66
|
+
@col_range.cover?(other.col_range.begin) &&
|
67
|
+
@col_range.cover?(other.col_range.end))
|
59
68
|
end
|
60
69
|
|
61
70
|
def to_s
|
62
71
|
if single_cell? then
|
63
72
|
self.class.ind2ref(@row_range.begin, @col_range.begin)
|
64
73
|
else
|
65
|
-
self.class.ind2ref(@row_range.begin, @col_range.begin) + ':' +
|
74
|
+
self.class.ind2ref(@row_range.begin, @col_range.begin) + ':' +
|
75
|
+
self.class.ind2ref(@row_range.end, @col_range.end)
|
66
76
|
end
|
67
77
|
end
|
68
78
|
|
@@ -92,7 +102,8 @@ module RubyXL
|
|
92
102
|
# Converts Excel-style cell reference to +row+ and +col+ zero-based indices.
|
93
103
|
def self.ref2ind(str)
|
94
104
|
return [ -1, -1 ] unless str =~ /\A([A-Z]+)(\d+)\Z/
|
95
|
-
[ Regexp.last_match(2).to_i - 1,
|
105
|
+
[ Regexp.last_match(2).to_i - 1,
|
106
|
+
Regexp.last_match(1).each_byte.inject(0) { |col, chr| (col * 26) + (chr - 64) } - 1 ]
|
96
107
|
end
|
97
108
|
end
|
98
109
|
|
@@ -102,7 +113,7 @@ module RubyXL
|
|
102
113
|
end
|
103
114
|
|
104
115
|
def to_s
|
105
|
-
self.collect
|
116
|
+
self.collect(&:to_s).join(' ')
|
106
117
|
end
|
107
118
|
end
|
108
119
|
end
|
@@ -20,7 +20,7 @@ module RubyXL
|
|
20
20
|
super
|
21
21
|
# So far, going by the structure that the original creator had in mind. However,
|
22
22
|
# since the actual implementation is now extracted into a separate class,
|
23
|
-
# we will be able to
|
23
|
+
# we will be able to transparently change it later if needs be.
|
24
24
|
@index_by_content = {}
|
25
25
|
end
|
26
26
|
|