rubyXL 3.3.29 → 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 +5 -5
- data/.circleci/config.yml +60 -0
- data/.rubocop.yml +124 -0
- data/CHANGELOG.md +12 -0
- data/Gemfile +11 -8
- data/LICENSE.txt +1 -1
- data/README.rdoc +57 -19
- data/Rakefile +29 -29
- data/VERSION +1 -1
- data/lib/rubyXL/cell.rb +2 -29
- data/lib/rubyXL/convenience_methods/cell.rb +276 -0
- data/lib/rubyXL/convenience_methods/color.rb +156 -0
- data/lib/rubyXL/convenience_methods/font.rb +63 -0
- data/lib/rubyXL/convenience_methods/workbook.rb +137 -0
- data/lib/rubyXL/convenience_methods/worksheet.rb +734 -0
- data/lib/rubyXL/convenience_methods.rb +5 -1122
- data/lib/rubyXL/objects/border.rb +0 -3
- data/lib/rubyXL/objects/calculation_chain.rb +2 -2
- data/lib/rubyXL/objects/cell_style.rb +4 -6
- data/lib/rubyXL/objects/chartsheet.rb +8 -12
- data/lib/rubyXL/objects/color.rb +4 -6
- data/lib/rubyXL/objects/column_range.rb +16 -15
- data/lib/rubyXL/objects/comments.rb +1 -4
- data/lib/rubyXL/objects/connection.rb +175 -0
- data/lib/rubyXL/objects/container_nodes.rb +1 -5
- data/lib/rubyXL/objects/content_types.rb +3 -6
- data/lib/rubyXL/objects/data_validation.rb +2 -2
- data/lib/rubyXL/objects/document_properties.rb +12 -15
- data/lib/rubyXL/objects/extensions.rb +0 -2
- data/lib/rubyXL/objects/external_links.rb +38 -8
- data/lib/rubyXL/objects/fill.rb +2 -5
- data/lib/rubyXL/objects/filters.rb +5 -7
- data/lib/rubyXL/objects/font.rb +2 -7
- data/lib/rubyXL/objects/formula.rb +3 -5
- data/lib/rubyXL/objects/ooxml_object.rb +40 -31
- data/lib/rubyXL/objects/query_table.rb +106 -0
- data/lib/rubyXL/objects/reference.rb +26 -17
- data/lib/rubyXL/objects/relationships.rb +14 -14
- data/lib/rubyXL/objects/root.rb +0 -2
- data/lib/rubyXL/objects/shared_strings.rb +4 -7
- data/lib/rubyXL/objects/sheet_common.rb +1 -3
- data/lib/rubyXL/objects/sheet_data.rb +44 -17
- data/lib/rubyXL/objects/simple_types.rb +19 -2
- data/lib/rubyXL/objects/storage.rb +60 -49
- data/lib/rubyXL/objects/stylesheet.rb +9 -17
- data/lib/rubyXL/objects/text.rb +6 -8
- data/lib/rubyXL/objects/theme.rb +23 -9
- data/lib/rubyXL/objects/workbook.rb +144 -36
- data/lib/rubyXL/objects/worksheet.rb +48 -34
- data/lib/rubyXL/parser.rb +1 -3
- data/lib/rubyXL/worksheet.rb +86 -86
- data/lib/rubyXL.rb +1 -1
- data/rdoc/README_rdoc.html +212 -153
- data/rdoc/RubyXL/AExtension.html +33 -69
- data/rdoc/RubyXL/AExtensionStorageArea.html +12 -18
- data/rdoc/RubyXL/ActiveX.html +26 -52
- data/rdoc/RubyXL/ActiveXBinary.html +12 -23
- data/rdoc/RubyXL/AdjustHandleList.html +13 -20
- data/rdoc/RubyXL/Alignment.html +13 -20
- data/rdoc/RubyXL/AlternateContent.html +12 -18
- data/rdoc/RubyXL/AlternateUrls.html +99 -0
- data/rdoc/RubyXL/Authors.html +13 -20
- data/rdoc/RubyXL/AutoFilter.html +13 -20
- data/rdoc/RubyXL/AutoFilterColumn.html +13 -20
- data/rdoc/RubyXL/BinaryImageFile.html +12 -26
- data/rdoc/RubyXL/BodyProperties.html +13 -20
- data/rdoc/RubyXL/BooleanNode.html +12 -18
- data/rdoc/RubyXL/BooleanValue.html +12 -18
- data/rdoc/RubyXL/Border.html +49 -101
- data/rdoc/RubyXL/BorderEdge.html +32 -61
- data/rdoc/RubyXL/Borders.html +25 -44
- data/rdoc/RubyXL/Break.html +13 -20
- data/rdoc/RubyXL/BreakList.html +13 -20
- data/rdoc/RubyXL/CT_AdjPoint2D.html +13 -20
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +13 -20
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +13 -20
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +13 -20
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +13 -20
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +13 -20
- data/rdoc/RubyXL/CT_Backdrop.html +13 -20
- data/rdoc/RubyXL/CT_Bevel.html +13 -20
- data/rdoc/RubyXL/CT_BiLevelEffect.html +13 -20
- data/rdoc/RubyXL/CT_BlendEffect.html +13 -20
- data/rdoc/RubyXL/CT_Blip.html +13 -20
- data/rdoc/RubyXL/CT_BlipFillProperties.html +13 -20
- data/rdoc/RubyXL/CT_BlurEffect.html +13 -20
- data/rdoc/RubyXL/CT_Camera.html +13 -20
- data/rdoc/RubyXL/CT_Color.html +13 -20
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +13 -20
- data/rdoc/RubyXL/CT_ColorMapping.html +13 -20
- data/rdoc/RubyXL/CT_ColorScheme.html +13 -20
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +13 -20
- data/rdoc/RubyXL/CT_ConnectionSite.html +13 -20
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +13 -20
- data/rdoc/RubyXL/CT_DashStop.html +13 -20
- data/rdoc/RubyXL/CT_DashStopList.html +13 -20
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +13 -20
- data/rdoc/RubyXL/CT_DuotoneEffect.html +13 -20
- data/rdoc/RubyXL/CT_EffectContainer.html +13 -20
- data/rdoc/RubyXL/CT_EffectList.html +13 -20
- data/rdoc/RubyXL/CT_EffectReference.html +13 -20
- data/rdoc/RubyXL/CT_EffectStyleItem.html +13 -20
- data/rdoc/RubyXL/CT_EffectStyleList.html +13 -20
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +13 -20
- data/rdoc/RubyXL/CT_FillEffect.html +13 -20
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +13 -20
- data/rdoc/RubyXL/CT_FillStyleList.html +13 -20
- data/rdoc/RubyXL/CT_FlatText.html +13 -20
- data/rdoc/RubyXL/CT_FontCollection.html +13 -20
- data/rdoc/RubyXL/CT_FontReference.html +13 -20
- data/rdoc/RubyXL/CT_GeomGuideList.html +13 -20
- data/rdoc/RubyXL/CT_GlowEffect.html +13 -20
- data/rdoc/RubyXL/CT_GradientFillProperties.html +13 -20
- data/rdoc/RubyXL/CT_GradientStop.html +13 -20
- data/rdoc/RubyXL/CT_GradientStopList.html +13 -20
- data/rdoc/RubyXL/CT_HSLEffect.html +13 -20
- data/rdoc/RubyXL/CT_HslColor.html +13 -20
- data/rdoc/RubyXL/CT_Hyperlink.html +13 -20
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +13 -20
- data/rdoc/RubyXL/CT_LightRig.html +13 -20
- data/rdoc/RubyXL/CT_LineEndProperties.html +13 -20
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +13 -20
- data/rdoc/RubyXL/CT_LineProperties.html +13 -20
- data/rdoc/RubyXL/CT_LineStyleList.html +13 -20
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +13 -20
- data/rdoc/RubyXL/CT_LuminanceEffect.html +13 -20
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +13 -20
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +13 -20
- data/rdoc/RubyXL/CT_Path2D.html +13 -20
- data/rdoc/RubyXL/CT_Path2DArcTo.html +13 -20
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +13 -20
- data/rdoc/RubyXL/CT_Path2DList.html +13 -20
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +13 -20
- data/rdoc/RubyXL/CT_Path2DTo.html +13 -20
- data/rdoc/RubyXL/CT_PathShadeProperties.html +13 -20
- data/rdoc/RubyXL/CT_PatternFillProperties.html +13 -20
- data/rdoc/RubyXL/CT_Point3D.html +13 -20
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +13 -20
- data/rdoc/RubyXL/CT_PresetColor.html +13 -20
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +13 -20
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +13 -20
- data/rdoc/RubyXL/CT_PresetTextShape.html +13 -20
- data/rdoc/RubyXL/CT_ReflectionEffect.html +13 -20
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +13 -20
- data/rdoc/RubyXL/CT_RelativeRect.html +13 -20
- data/rdoc/RubyXL/CT_SRgbColor.html +13 -20
- data/rdoc/RubyXL/CT_ScRgbColor.html +13 -20
- data/rdoc/RubyXL/CT_Scene3D.html +13 -20
- data/rdoc/RubyXL/CT_SchemeColor.html +13 -20
- data/rdoc/RubyXL/CT_Shape3D.html +13 -20
- data/rdoc/RubyXL/CT_ShapeStyle.html +13 -20
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +13 -20
- data/rdoc/RubyXL/CT_SphereCoords.html +13 -20
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +13 -20
- data/rdoc/RubyXL/CT_StyleMatrix.html +13 -20
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +13 -20
- data/rdoc/RubyXL/CT_SupplementalFont.html +13 -20
- data/rdoc/RubyXL/CT_SystemColor.html +13 -20
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +13 -20
- data/rdoc/RubyXL/CT_TextBlipBullet.html +13 -20
- data/rdoc/RubyXL/CT_TextCharBullet.html +13 -20
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +13 -20
- data/rdoc/RubyXL/CT_TextFont.html +13 -20
- data/rdoc/RubyXL/CT_TextListStyle.html +13 -20
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +13 -20
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +13 -20
- data/rdoc/RubyXL/CT_TextSpacing.html +13 -20
- data/rdoc/RubyXL/CT_TextTabStop.html +13 -20
- data/rdoc/RubyXL/CT_TextTabStopList.html +13 -20
- data/rdoc/RubyXL/CT_TileInfoProperties.html +13 -20
- data/rdoc/RubyXL/CT_TintEffect.html +13 -20
- data/rdoc/RubyXL/CT_Transform2D.html +13 -20
- data/rdoc/RubyXL/CT_TransformEffect.html +13 -20
- data/rdoc/RubyXL/CT_Vector3D.html +13 -20
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +13 -20
- data/rdoc/RubyXL/CalculationChain.html +23 -50
- data/rdoc/RubyXL/CalculationChainCell.html +13 -20
- data/rdoc/RubyXL/CalculationProperties.html +13 -20
- data/rdoc/RubyXL/Cell.html +210 -258
- data/rdoc/RubyXL/CellConvenienceMethods.html +438 -572
- data/rdoc/RubyXL/CellExt.html +13 -20
- data/rdoc/RubyXL/CellSmartTag.html +13 -20
- data/rdoc/RubyXL/CellSmartTagProperty.html +13 -20
- data/rdoc/RubyXL/CellSmartTags.html +13 -20
- data/rdoc/RubyXL/CellStyle.html +13 -20
- data/rdoc/RubyXL/CellStyleXFs.html +25 -44
- data/rdoc/RubyXL/CellStyles.html +25 -44
- data/rdoc/RubyXL/CellValue.html +24 -43
- data/rdoc/RubyXL/CellWatch.html +13 -20
- data/rdoc/RubyXL/CellWatches.html +13 -20
- data/rdoc/RubyXL/CellXFs.html +26 -48
- data/rdoc/RubyXL/ChartColorsFile.html +12 -26
- data/rdoc/RubyXL/ChartFile.html +25 -54
- data/rdoc/RubyXL/ChartStyleFile.html +12 -26
- data/rdoc/RubyXL/ChartUserShapesFile.html +12 -26
- data/rdoc/RubyXL/Chartsheet.html +26 -73
- data/rdoc/RubyXL/ChartsheetPageSetup.html +13 -20
- data/rdoc/RubyXL/ChartsheetProperties.html +13 -20
- data/rdoc/RubyXL/ChartsheetProtection.html +13 -20
- data/rdoc/RubyXL/ChartsheetView.html +13 -20
- data/rdoc/RubyXL/ChartsheetViews.html +13 -20
- data/rdoc/RubyXL/Color.html +24 -48
- data/rdoc/RubyXL/ColorConvenienceClasses/HlsColor.html +246 -0
- data/rdoc/RubyXL/ColorConvenienceClasses/RgbColor.html +285 -0
- data/rdoc/RubyXL/ColorConvenienceClasses.html +91 -0
- data/rdoc/RubyXL/ColorConvenienceMethods.html +139 -0
- data/rdoc/RubyXL/ColorFilter.html +13 -20
- data/rdoc/RubyXL/ColorScale.html +13 -20
- data/rdoc/RubyXL/ColorSet.html +13 -20
- data/rdoc/RubyXL/Colors.html +13 -20
- data/rdoc/RubyXL/ColumnRange.html +76 -91
- data/rdoc/RubyXL/ColumnRanges.html +54 -106
- data/rdoc/RubyXL/Comment.html +13 -20
- data/rdoc/RubyXL/CommentList.html +13 -20
- data/rdoc/RubyXL/CommentsFile.html +24 -56
- data/rdoc/RubyXL/ConditionalFormatValue.html +13 -20
- data/rdoc/RubyXL/ConditionalFormatting.html +13 -20
- data/rdoc/RubyXL/ConditionalFormattingRule.html +13 -20
- data/rdoc/RubyXL/Connection.html +99 -0
- data/rdoc/RubyXL/ConnectionTable.html +99 -0
- data/rdoc/RubyXL/ConnectionTables.html +99 -0
- data/rdoc/RubyXL/ConnectionTextField.html +99 -0
- data/rdoc/RubyXL/ConnectionTextFields.html +99 -0
- data/rdoc/RubyXL/Connections.html +149 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +12 -18
- data/rdoc/RubyXL/ContentTypeOverride.html +12 -18
- data/rdoc/RubyXL/ContentTypes.html +35 -72
- data/rdoc/RubyXL/ControlPropertiesFile.html +14 -23
- data/rdoc/RubyXL/CorePropertiesFile.html +89 -208
- data/rdoc/RubyXL/CustomColor.html +13 -20
- data/rdoc/RubyXL/CustomColorList.html +13 -20
- data/rdoc/RubyXL/CustomFilter.html +13 -20
- data/rdoc/RubyXL/CustomFilters.html +13 -20
- data/rdoc/RubyXL/CustomGeometry.html +13 -20
- data/rdoc/RubyXL/CustomProperties.html +13 -20
- data/rdoc/RubyXL/CustomPropertiesFile.html +12 -26
- data/rdoc/RubyXL/CustomProperty.html +13 -20
- data/rdoc/RubyXL/CustomPropertyFile.html +108 -0
- data/rdoc/RubyXL/CustomSheetView.html +13 -20
- data/rdoc/RubyXL/CustomSheetViews.html +13 -20
- data/rdoc/RubyXL/CustomWorkbookView.html +13 -20
- data/rdoc/RubyXL/CustomWorkbookViews.html +13 -20
- data/rdoc/RubyXL/CustomXMLFile.html +12 -23
- data/rdoc/RubyXL/DXF.html +13 -20
- data/rdoc/RubyXL/DXFs.html +13 -20
- data/rdoc/RubyXL/DataBar.html +13 -20
- data/rdoc/RubyXL/DataConsolidate.html +13 -20
- data/rdoc/RubyXL/DataConsolidationReference.html +13 -20
- data/rdoc/RubyXL/DataConsolidationReferences.html +13 -20
- data/rdoc/RubyXL/DataType.html +11 -40
- data/rdoc/RubyXL/DataValidation.html +13 -20
- data/rdoc/RubyXL/DataValidations.html +13 -20
- data/rdoc/RubyXL/DateGroupItem.html +13 -20
- data/rdoc/RubyXL/DefinedName.html +13 -20
- data/rdoc/RubyXL/DefinedNameExt.html +13 -20
- data/rdoc/RubyXL/DefinedNames.html +13 -20
- data/rdoc/RubyXL/DefinedNamesExt.html +13 -20
- data/rdoc/RubyXL/DocumentPropertiesFile.html +34 -76
- data/rdoc/RubyXL/DrawingFile.html +25 -54
- data/rdoc/RubyXL/DynamicFilter.html +13 -20
- data/rdoc/RubyXL/EmbeddedControl.html +13 -20
- data/rdoc/RubyXL/EmbeddedControls.html +13 -20
- data/rdoc/RubyXL/Extension.html +13 -20
- data/rdoc/RubyXL/ExtensionStorageArea.html +13 -20
- data/rdoc/RubyXL/Extents.html +13 -20
- data/rdoc/RubyXL/ExternalBook.html +13 -20
- data/rdoc/RubyXL/ExternalLinksFile.html +25 -54
- data/rdoc/RubyXL/ExternalReference.html +13 -20
- data/rdoc/RubyXL/ExternalReferences.html +13 -20
- data/rdoc/RubyXL/ExtraColorSchemeList.html +13 -20
- data/rdoc/RubyXL/FieldItem.html +13 -20
- data/rdoc/RubyXL/FileRecoveryProperties.html +13 -20
- data/rdoc/RubyXL/FileSharing.html +13 -20
- data/rdoc/RubyXL/FileVersion.html +13 -20
- data/rdoc/RubyXL/Fill.html +25 -44
- data/rdoc/RubyXL/Fills.html +25 -44
- data/rdoc/RubyXL/FilterContainer.html +13 -20
- data/rdoc/RubyXL/FloatNode.html +12 -18
- data/rdoc/RubyXL/FloatValue.html +12 -18
- data/rdoc/RubyXL/Font.html +28 -64
- data/rdoc/RubyXL/FontConvenienceMethods.html +133 -294
- data/rdoc/RubyXL/FontScheme.html +13 -20
- data/rdoc/RubyXL/Fonts.html +25 -44
- data/rdoc/RubyXL/Formula.html +13 -20
- data/rdoc/RubyXL/FunctionGroup.html +13 -20
- data/rdoc/RubyXL/FunctionGroups.html +13 -20
- data/rdoc/RubyXL/GenericStorageObject.html +41 -98
- data/rdoc/RubyXL/GradientFill.html +13 -20
- data/rdoc/RubyXL/HeaderFooterSettings.html +13 -20
- data/rdoc/RubyXL/Hyperlink.html +13 -20
- data/rdoc/RubyXL/HyperlinkRelFile.html +12 -23
- data/rdoc/RubyXL/Hyperlinks.html +13 -20
- data/rdoc/RubyXL/IconFilter.html +13 -20
- data/rdoc/RubyXL/IconSet.html +13 -20
- data/rdoc/RubyXL/IgnoredError.html +13 -20
- data/rdoc/RubyXL/IgnoredErrors.html +13 -20
- data/rdoc/RubyXL/IndexedColors.html +13 -20
- data/rdoc/RubyXL/InputCells.html +13 -20
- data/rdoc/RubyXL/IntegerNode.html +12 -18
- data/rdoc/RubyXL/IntegerValue.html +12 -18
- data/rdoc/RubyXL/LegacyCell.html +20 -71
- data/rdoc/RubyXL/LegacyWorksheet.html +77 -126
- data/rdoc/RubyXL/MRUColors.html +13 -20
- data/rdoc/RubyXL/MacrosFile.html +12 -26
- data/rdoc/RubyXL/MergedCell.html +13 -20
- data/rdoc/RubyXL/MergedCells.html +13 -20
- data/rdoc/RubyXL/NumFmt.html +13 -20
- data/rdoc/RubyXL/NumberFormat.html +25 -44
- data/rdoc/RubyXL/NumberFormats.html +25 -50
- data/rdoc/RubyXL/OLEObject.html +13 -20
- data/rdoc/RubyXL/OLEObjectFile.html +12 -26
- data/rdoc/RubyXL/OLEObjects.html +13 -20
- data/rdoc/RubyXL/OLESize.html +13 -20
- data/rdoc/RubyXL/OOXMLContainerObject.html +72 -157
- data/rdoc/RubyXL/OOXMLIgnored.html +32 -62
- data/rdoc/RubyXL/OOXMLObject.html +15 -26
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +126 -203
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +104 -226
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +109 -242
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +67 -154
- data/rdoc/RubyXL/OdbcOleDbProperties.html +99 -0
- data/rdoc/RubyXL/Offset.html +13 -20
- data/rdoc/RubyXL/OlapProperties.html +99 -0
- data/rdoc/RubyXL/OleItem.html +99 -0
- data/rdoc/RubyXL/OleItems.html +99 -0
- data/rdoc/RubyXL/OleLink.html +99 -0
- data/rdoc/RubyXL/OutlineProperties.html +13 -20
- data/rdoc/RubyXL/PageMargins.html +13 -20
- data/rdoc/RubyXL/PageSetup.html +13 -20
- data/rdoc/RubyXL/PageSetupProperties.html +13 -20
- data/rdoc/RubyXL/Pane.html +13 -20
- data/rdoc/RubyXL/Parser.html +35 -65
- data/rdoc/RubyXL/PatternFill.html +13 -20
- data/rdoc/RubyXL/PersonMetadata.html +108 -0
- data/rdoc/RubyXL/PhoneticProperties.html +13 -20
- data/rdoc/RubyXL/PhoneticRun.html +13 -20
- data/rdoc/RubyXL/PivotArea.html +13 -20
- data/rdoc/RubyXL/PivotCache.html +13 -20
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +14 -31
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +12 -26
- data/rdoc/RubyXL/PivotCaches.html +13 -20
- data/rdoc/RubyXL/PivotReference.html +13 -20
- data/rdoc/RubyXL/PivotReferences.html +13 -20
- data/rdoc/RubyXL/PivotTableFile.html +14 -31
- data/rdoc/RubyXL/PivotTableSelection.html +13 -20
- data/rdoc/RubyXL/PresetGeometry.html +13 -20
- data/rdoc/RubyXL/PrintOptions.html +13 -20
- data/rdoc/RubyXL/PrinterSettingsFile.html +12 -26
- data/rdoc/RubyXL/ProtectedRange.html +13 -20
- data/rdoc/RubyXL/ProtectedRanges.html +13 -20
- data/rdoc/RubyXL/Protection.html +13 -20
- data/rdoc/RubyXL/QueryParameter.html +99 -0
- data/rdoc/RubyXL/QueryParameters.html +99 -0
- data/rdoc/RubyXL/QueryTable.html +157 -0
- data/rdoc/RubyXL/QueryTableDeletedField.html +99 -0
- data/rdoc/RubyXL/QueryTableDeletedFields.html +99 -0
- data/rdoc/RubyXL/QueryTableField.html +99 -0
- data/rdoc/RubyXL/QueryTableFields.html +99 -0
- data/rdoc/RubyXL/QueryTableRefresh.html +99 -0
- data/rdoc/RubyXL/RID.html +12 -18
- data/rdoc/RubyXL/RawOOXML.html +33 -69
- data/rdoc/RubyXL/Reference.html +156 -286
- data/rdoc/RubyXL/Relationship.html +12 -18
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +20 -37
- data/rdoc/RubyXL/RelationshipSupport.html +62 -145
- data/rdoc/RubyXL/RevisionPointer.html +13 -23
- data/rdoc/RubyXL/RichText.html +27 -45
- data/rdoc/RubyXL/RichTextRun.html +24 -43
- data/rdoc/RubyXL/Row.html +88 -205
- data/rdoc/RubyXL/RowExt.html +13 -20
- data/rdoc/RubyXL/RunProperties.html +13 -20
- data/rdoc/RubyXL/Scenario.html +13 -20
- data/rdoc/RubyXL/Scenarios.html +13 -20
- data/rdoc/RubyXL/Selection.html +23 -42
- data/rdoc/RubyXL/ShapeGuide.html +13 -20
- data/rdoc/RubyXL/ShapeTextRectangle.html +13 -20
- data/rdoc/RubyXL/SharedStringsTable.html +81 -177
- data/rdoc/RubyXL/Sheet.html +13 -20
- data/rdoc/RubyXL/SheetCalculationProperties.html +13 -20
- data/rdoc/RubyXL/SheetData.html +32 -62
- data/rdoc/RubyXL/SheetDataExt.html +13 -20
- data/rdoc/RubyXL/SheetDataSet.html +13 -20
- data/rdoc/RubyXL/SheetMetadata.html +108 -0
- data/rdoc/RubyXL/SheetName.html +13 -20
- data/rdoc/RubyXL/SheetNames.html +13 -20
- data/rdoc/RubyXL/Sheets.html +13 -20
- data/rdoc/RubyXL/SlicerCacheFile.html +12 -26
- data/rdoc/RubyXL/SlicerFile.html +12 -26
- data/rdoc/RubyXL/SmartTagProperties.html +13 -20
- data/rdoc/RubyXL/SmartTagType.html +13 -20
- data/rdoc/RubyXL/SmartTagTypes.html +13 -20
- data/rdoc/RubyXL/SmartTags.html +13 -20
- data/rdoc/RubyXL/SortCondition.html +13 -20
- data/rdoc/RubyXL/SortState.html +13 -20
- data/rdoc/RubyXL/Sqref.html +33 -63
- data/rdoc/RubyXL/Stop.html +13 -20
- data/rdoc/RubyXL/StringNode.html +12 -18
- data/rdoc/RubyXL/StringNodeW3C.html +33 -63
- data/rdoc/RubyXL/StringValue.html +12 -18
- data/rdoc/RubyXL/Stylesheet.html +65 -138
- data/rdoc/RubyXL/TableFile.html +12 -26
- data/rdoc/RubyXL/TableParts.html +12 -18
- data/rdoc/RubyXL/TableStyle.html +13 -20
- data/rdoc/RubyXL/TableStyles.html +13 -20
- data/rdoc/RubyXL/Text.html +35 -76
- data/rdoc/RubyXL/TextImportSettings.html +99 -0
- data/rdoc/RubyXL/Theme.html +72 -72
- data/rdoc/RubyXL/ThemeElements.html +13 -20
- data/rdoc/RubyXL/ThumbnailFile.html +12 -26
- data/rdoc/RubyXL/Top10.html +13 -20
- data/rdoc/RubyXL/VMLDrawingFile.html +15 -33
- data/rdoc/RubyXL/Variant.html +13 -20
- data/rdoc/RubyXL/Vector.html +24 -43
- data/rdoc/RubyXL/VectorValue.html +12 -18
- data/rdoc/RubyXL/VisualProperties.html +13 -20
- data/rdoc/RubyXL/WebPublishObject.html +13 -20
- data/rdoc/RubyXL/WebPublishObjects.html +13 -20
- data/rdoc/RubyXL/WebPublishingItem.html +13 -20
- data/rdoc/RubyXL/WebPublishingItems.html +13 -20
- data/rdoc/RubyXL/WebPublishingProperties.html +13 -20
- data/rdoc/RubyXL/WebQueryProperties.html +99 -0
- data/rdoc/RubyXL/Workbook.html +581 -266
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +226 -951
- data/rdoc/RubyXL/WorkbookProperties.html +13 -20
- data/rdoc/RubyXL/WorkbookProtection.html +13 -20
- data/rdoc/RubyXL/WorkbookRoot.html +58 -135
- data/rdoc/RubyXL/WorkbookView.html +13 -20
- data/rdoc/RubyXL/WorkbookViews.html +13 -20
- data/rdoc/RubyXL/Worksheet.html +122 -137
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +717 -1373
- data/rdoc/RubyXL/WorksheetDimensions.html +13 -20
- data/rdoc/RubyXL/WorksheetFormatProperties.html +12 -18
- data/rdoc/RubyXL/WorksheetProperties.html +13 -20
- data/rdoc/RubyXL/WorksheetProtection.html +13 -20
- data/rdoc/RubyXL/WorksheetView.html +13 -20
- data/rdoc/RubyXL/WorksheetViews.html +13 -20
- data/rdoc/RubyXL/XF.html +13 -20
- data/rdoc/RubyXL.html +46 -306
- data/rdoc/created.rid +45 -38
- data/rdoc/css/rdoc.css +109 -12
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/index.html +403 -726
- data/rdoc/js/darkfish.js +33 -97
- data/rdoc/js/navigation.js +12 -49
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +35 -34
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +6 -6
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +287 -45
- data/rubyXL.gemspec +77 -43
- data/spec/lib/cell_spec.rb +119 -6
- data/spec/lib/color_spec.rb +9 -1
- data/spec/lib/parser_spec.rb +28 -28
- data/spec/lib/reference_spec.rb +41 -5
- data/spec/lib/rgb_color_spec.rb +29 -0
- data/spec/lib/stylesheet_spec.rb +10 -11
- data/spec/lib/text_spec.rb +4 -6
- data/spec/lib/workbook_spec.rb +31 -8
- data/spec/lib/worksheet_spec.rb +886 -480
- data/spec/spec_helper.rb +2 -0
- data/test/test_parse_write.rb +15 -15
- metadata +76 -10
- data/rdoc/js/jquery.js +0 -4
@@ -2,9 +2,8 @@ require 'pathname'
|
|
2
2
|
require 'rubyXL/objects/ooxml_object'
|
3
3
|
|
4
4
|
module RubyXL
|
5
|
-
|
6
5
|
class RID < OOXMLObject
|
7
|
-
|
6
|
+
define_relationship(:required => true)
|
8
7
|
end
|
9
8
|
|
10
9
|
class Relationship < OOXMLObject
|
@@ -16,7 +15,7 @@ module RubyXL
|
|
16
15
|
end
|
17
16
|
|
18
17
|
class OOXMLRelationshipsFile < OOXMLTopLevelObject
|
19
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-package.relationships+xml'
|
18
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-package.relationships+xml'.freeze
|
20
19
|
SAVE_ORDER = 100
|
21
20
|
|
22
21
|
define_child_node(RubyXL::Relationship, :collection => true, :accessor => :relationships)
|
@@ -28,8 +27,8 @@ module RubyXL
|
|
28
27
|
@@debug_indent = ($DEBUG ? 0 : nil)
|
29
28
|
|
30
29
|
def new_relationship(target, type)
|
31
|
-
RubyXL::Relationship.new(:id
|
32
|
-
:type
|
30
|
+
RubyXL::Relationship.new(:id => "rId#{relationships.size + 1}",
|
31
|
+
:type => type,
|
33
32
|
:target => target)
|
34
33
|
end
|
35
34
|
protected :new_relationship
|
@@ -37,8 +36,8 @@ module RubyXL
|
|
37
36
|
def add_relationship(obj)
|
38
37
|
return if obj.nil? || !defined?(obj.class::REL_TYPE) || (obj.respond_to?(:empty?) && obj.empty?)
|
39
38
|
|
40
|
-
relationships << RubyXL::Relationship.new(:id
|
41
|
-
:type
|
39
|
+
relationships << RubyXL::Relationship.new(:id => "rId#{relationships.size + 1}",
|
40
|
+
:type => obj.class::REL_TYPE,
|
42
41
|
:target => obj.xlsx_path.relative_path_from(owner.xlsx_path.dirname))
|
43
42
|
end
|
44
43
|
protected :add_relationship
|
@@ -82,7 +81,10 @@ module RubyXL
|
|
82
81
|
klass = RubyXL::OOXMLRelationshipsFile.get_class_by_rel_type(rel.type)
|
83
82
|
|
84
83
|
if klass.nil? then
|
85
|
-
|
84
|
+
if !RubyXL.class_variable_get(:@@suppress_warnings) then
|
85
|
+
puts "*** WARNING: storage class not found for #{rel.target} (#{rel.type})"
|
86
|
+
end
|
87
|
+
|
86
88
|
klass = GenericStorageObject
|
87
89
|
end
|
88
90
|
|
@@ -93,7 +95,7 @@ module RubyXL
|
|
93
95
|
self.related_files[rel.id] = obj
|
94
96
|
}
|
95
97
|
|
96
|
-
@@debug_indent -=2 if @@debug_indent
|
98
|
+
@@debug_indent -= 2 if @@debug_indent
|
97
99
|
|
98
100
|
related_files
|
99
101
|
end
|
@@ -128,12 +130,10 @@ module RubyXL
|
|
128
130
|
basename = base_file_path.root? ? '' : base_file_path.basename
|
129
131
|
base_file_path.dirname.join('_rels', "#{basename}.rels").cleanpath
|
130
132
|
end
|
131
|
-
|
132
133
|
end
|
133
134
|
|
134
135
|
# +RelationshipSupport+ module enables automatic loading and saving of _rels for the respective file
|
135
136
|
module RelationshipSupport
|
136
|
-
|
137
137
|
module ClassMehods
|
138
138
|
def define_relationship(klass, accessor = nil)
|
139
139
|
class_variable_get(:@@ooxml_relationships)[klass] = accessor
|
@@ -204,10 +204,10 @@ module RubyXL
|
|
204
204
|
|
205
205
|
def store_relationship(related_file, unknown = false)
|
206
206
|
self.generic_storage ||= []
|
207
|
-
|
207
|
+
if unknown && !RubyXL.class_variable_get(:@@suppress_warnings) then
|
208
|
+
puts "WARNING: #{self.class} is not aware how to process #{related_file.class}"
|
209
|
+
end
|
208
210
|
self.generic_storage << related_file
|
209
211
|
end
|
210
|
-
|
211
212
|
end
|
212
|
-
|
213
213
|
end
|
data/lib/rubyXL/objects/root.rb
CHANGED
@@ -3,15 +3,14 @@ require 'rubyXL/objects/text'
|
|
3
3
|
require 'rubyXL/objects/extensions'
|
4
4
|
|
5
5
|
module RubyXL
|
6
|
-
|
7
6
|
# http://www.datypic.com/sc/ooxml/e-ssml_sst.html
|
8
7
|
class SharedStringsTable < OOXMLTopLevelObject
|
9
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'
|
10
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings'
|
8
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml'.freeze
|
9
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings'.freeze
|
11
10
|
|
12
11
|
# According to http://msdn.microsoft.com/en-us/library/office/gg278314.aspx,
|
13
12
|
# +count+ and +uniqueCount+ may be either both missing, or both present. Need to validate.
|
14
|
-
define_attribute(:uniqueCount,
|
13
|
+
define_attribute(:uniqueCount, :int)
|
15
14
|
define_child_node(RubyXL::RichText, :collection => :with_count, :node_name => 'si', :accessor => :strings)
|
16
15
|
define_child_node(RubyXL::ExtensionStorageArea)
|
17
16
|
define_element_name 'sst'
|
@@ -21,7 +20,7 @@ module RubyXL
|
|
21
20
|
super
|
22
21
|
# So far, going by the structure that the original creator had in mind. However,
|
23
22
|
# since the actual implementation is now extracted into a separate class,
|
24
|
-
# we will be able to
|
23
|
+
# we will be able to transparently change it later if needs be.
|
25
24
|
@index_by_content = {}
|
26
25
|
end
|
27
26
|
|
@@ -64,7 +63,5 @@ module RubyXL
|
|
64
63
|
def xlsx_path
|
65
64
|
ROOT.join('xl', 'sharedStrings.xml')
|
66
65
|
end
|
67
|
-
|
68
66
|
end
|
69
|
-
|
70
67
|
end
|
@@ -2,7 +2,6 @@ require 'rubyXL/objects/ooxml_object'
|
|
2
2
|
require 'rubyXL/objects/storage'
|
3
3
|
|
4
4
|
module RubyXL
|
5
|
-
|
6
5
|
# http://www.datypic.com/sc/ooxml/e-ssml_webPublishItem-1.html
|
7
6
|
class WebPublishingItem < OOXMLObject
|
8
7
|
define_attribute(:id, :int, :required => true)
|
@@ -12,7 +11,7 @@ module RubyXL
|
|
12
11
|
define_attribute(:sourceObject, :string)
|
13
12
|
define_attribute(:destinationFile, :string, :required => true)
|
14
13
|
define_attribute(:title, :string)
|
15
|
-
define_attribute(:autoRepublish, :bool,
|
14
|
+
define_attribute(:autoRepublish, :bool, :default => false)
|
16
15
|
define_element_name 'webPublishItem'
|
17
16
|
end
|
18
17
|
|
@@ -47,5 +46,4 @@ module RubyXL
|
|
47
46
|
define_child_node(RubyXL::StringNode, :node_name => :firstFooter)
|
48
47
|
define_element_name 'headerFooter'
|
49
48
|
end
|
50
|
-
|
51
49
|
end
|
@@ -3,9 +3,18 @@ require 'rubyXL/objects/simple_types'
|
|
3
3
|
require 'rubyXL/objects/text'
|
4
4
|
require 'rubyXL/objects/formula'
|
5
5
|
require 'rubyXL/cell'
|
6
|
-
require 'rubyXL/convenience_methods'
|
7
6
|
|
8
7
|
module RubyXL
|
8
|
+
# http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cellvalues(v=office.14).aspx
|
9
|
+
module DataType
|
10
|
+
SHARED_STRING = 's'
|
11
|
+
RAW_STRING = 'str'
|
12
|
+
INLINE_STRING = 'inlineStr'
|
13
|
+
ERROR = 'e'
|
14
|
+
BOOLEAN = 'b'
|
15
|
+
NUMBER = 'n'
|
16
|
+
DATE = 'd' # Only available in Office2010.
|
17
|
+
end
|
9
18
|
|
10
19
|
# http://www.datypic.com/sc/ooxml/e-ssml_v-1.html
|
11
20
|
class CellValue < OOXMLObject
|
@@ -25,21 +34,23 @@ module RubyXL
|
|
25
34
|
|
26
35
|
define_attribute(:r, :ref)
|
27
36
|
define_attribute(:s, :int, :default => 0, :accessor => :style_index)
|
28
|
-
define_attribute(:t, RubyXL::ST_CellType, :accessor => :datatype, :default => 'n'
|
37
|
+
define_attribute(:t, RubyXL::ST_CellType, :accessor => :datatype, :default => 'n')
|
29
38
|
define_attribute(:cm, :int, :default => 0)
|
30
39
|
define_attribute(:vm, :int, :default => 0)
|
31
40
|
define_attribute(:ph, :bool, :default => false)
|
32
41
|
define_child_node(RubyXL::Formula, :accessor => :formula)
|
33
42
|
define_child_node(RubyXL::CellValue, :accessor => :value_container)
|
34
|
-
define_child_node(RubyXL::RichText)
|
43
|
+
define_child_node(RubyXL::RichText) # is
|
35
44
|
define_element_name 'c'
|
36
45
|
|
46
|
+
attr_accessor :worksheet
|
47
|
+
|
37
48
|
def index_in_collection
|
38
49
|
r.col_range.begin
|
39
50
|
end
|
40
51
|
|
41
52
|
def row
|
42
|
-
r
|
53
|
+
r&.first_row
|
43
54
|
end
|
44
55
|
|
45
56
|
def row=(v)
|
@@ -47,7 +58,7 @@ module RubyXL
|
|
47
58
|
end
|
48
59
|
|
49
60
|
def column
|
50
|
-
r
|
61
|
+
r&.first_col
|
51
62
|
end
|
52
63
|
|
53
64
|
def column=(v)
|
@@ -55,7 +66,7 @@ module RubyXL
|
|
55
66
|
end
|
56
67
|
|
57
68
|
def raw_value
|
58
|
-
value_container
|
69
|
+
value_container&.value
|
59
70
|
end
|
60
71
|
|
61
72
|
def raw_value=(v)
|
@@ -63,14 +74,31 @@ module RubyXL
|
|
63
74
|
value_container.value = v
|
64
75
|
end
|
65
76
|
|
77
|
+
def get_cell_xf
|
78
|
+
workbook.stylesheet.cell_xfs[self.style_index || 0]
|
79
|
+
end
|
80
|
+
|
81
|
+
def get_cell_font
|
82
|
+
workbook.stylesheet.fonts[get_cell_xf.font_id]
|
83
|
+
end
|
84
|
+
|
85
|
+
def get_cell_border
|
86
|
+
workbook.stylesheet.borders[get_cell_xf.border_id]
|
87
|
+
end
|
88
|
+
|
66
89
|
def number_format
|
67
90
|
workbook.stylesheet.get_number_format_by_id(get_cell_xf.num_fmt_id)
|
68
91
|
end
|
69
92
|
|
70
93
|
def is_date?
|
71
|
-
return false unless
|
72
|
-
|
73
|
-
|
94
|
+
return false unless # Only fully numeric values can be dates
|
95
|
+
case raw_value
|
96
|
+
when Numeric then true
|
97
|
+
when String then raw_value =~ NUMBER_REGEXP
|
98
|
+
else false
|
99
|
+
end
|
100
|
+
|
101
|
+
self.number_format&.is_date_format?
|
74
102
|
end
|
75
103
|
|
76
104
|
# Gets massaged value of the cell, converting datatypes to those known to Ruby (that includes
|
@@ -82,10 +110,12 @@ module RubyXL
|
|
82
110
|
when RubyXL::DataType::SHARED_STRING then workbook.shared_strings_container[r.to_i].to_s
|
83
111
|
when RubyXL::DataType::INLINE_STRING then is.to_s
|
84
112
|
when RubyXL::DataType::RAW_STRING then raw_value
|
113
|
+
when RubyXL::DataType::DATE then raw_value && DateTime.parse(raw_value)
|
85
114
|
else
|
86
|
-
if
|
115
|
+
if is then is.to_s
|
116
|
+
elsif is_date? then workbook.num_to_date(r.to_f)
|
87
117
|
elsif r.is_a?(String) && (r =~ NUMBER_REGEXP) then # Numeric
|
88
|
-
if
|
118
|
+
if Regexp.last_match(1) != '' then r.to_f
|
89
119
|
else r.to_i
|
90
120
|
end
|
91
121
|
else r
|
@@ -95,16 +125,15 @@ module RubyXL
|
|
95
125
|
|
96
126
|
def inspect
|
97
127
|
str = "#<#{self.class}(#{row},#{column}): #{raw_value.inspect}"
|
98
|
-
str
|
99
|
-
str
|
128
|
+
str << " =#{self.formula.expression}" if self.formula
|
129
|
+
str << ", datatype=#{self.datatype.inspect}, style_index=#{self.style_index.inspect}>"
|
100
130
|
return str
|
101
131
|
end
|
102
132
|
|
103
133
|
include LegacyCell
|
104
|
-
include CellConvenienceMethods
|
105
134
|
end
|
106
135
|
|
107
|
-
#TODO
|
136
|
+
#TODO# <row r="1" spans="1:1" x14ac:dyDescent="0.25">
|
108
137
|
|
109
138
|
# http://www.datypic.com/sc/ooxml/e-ssml_row-1.html
|
110
139
|
class Row < OOXMLObject
|
@@ -186,7 +215,5 @@ module RubyXL
|
|
186
215
|
def size
|
187
216
|
rows.size
|
188
217
|
end
|
189
|
-
|
190
218
|
end
|
191
|
-
|
192
219
|
end
|
@@ -140,7 +140,7 @@ module RubyXL
|
|
140
140
|
ST_TextHorzOverflowType = %w{ overflow clip }
|
141
141
|
ST_TextVerticalType = %w{ horz vert vert270 wordArtVert eaVert mongolianVert wordArtVertRtl }
|
142
142
|
ST_TextWrappingType = %w{ none square }
|
143
|
-
ST_TextAnchoringType
|
143
|
+
ST_TextAnchoringType = %w{ t ctr b just dist }
|
144
144
|
ST_TextShapeType = %w{ textNoShape textPlain textStop textTriangle textTriangleInverted textChevron
|
145
145
|
textChevronInverted textRingInside textRingOutside textArchUp textArchDown
|
146
146
|
textCircle textButton textArchUpPour textArchDownPour textCirclePour textButtonPour
|
@@ -223,10 +223,27 @@ module RubyXL
|
|
223
223
|
|
224
224
|
ST_TextUnderlineType = %w{ none words sng dbl heavy dotted dottedHeavy dash dashHeavy dashLong dashLongHeavy
|
225
225
|
dotDash dotDashHeavy dotDotDash dotDotDashHeavy wavy wavyHeavy wavyDbl }
|
226
|
+
ST_UnderlineValues = %w{ single double singleAccounting doubleAccounting none }
|
227
|
+
|
226
228
|
ST_TextStrikeType = %w{ noStrike sngStrike dblStrike }
|
227
229
|
ST_TextCapsType = %w{ none small all }
|
228
230
|
|
231
|
+
# TODO: http://www.datypic.com/sc/ooxml/t-ssml_ST_UnsignedIntHex.html
|
232
|
+
ST_UnsignedIntHex = :string # length = 4
|
229
233
|
# TODO: http://www.datypic.com/sc/ooxml/t-ssml_ST_UnsignedShortHex.html
|
230
|
-
ST_UnsignedShortHex = :string
|
234
|
+
ST_UnsignedShortHex = :string # length = 2
|
235
|
+
|
236
|
+
ST_Xstring = :string
|
237
|
+
|
238
|
+
# Query Tables
|
239
|
+
ST_GrowShrinkType = %w{ insertDelete insertClear overwriteClear }
|
240
|
+
|
241
|
+
# Connections
|
242
|
+
ST_CredMethod = %w{ integrated none stored prompt }
|
243
|
+
ST_ParameterType = %w{ prompt value cell }
|
244
|
+
ST_FileType = %w{ mac win dos }
|
245
|
+
ST_Qualifier = %w{ doubleQuote singleQuote none }
|
246
|
+
ST_ExternalConnectionType = %w{ general text MDY DMY YMD MYD DYM YDM skip EMD }
|
231
247
|
|
248
|
+
ST_HtmlFmt = %w{ none rtf all }
|
232
249
|
end
|
@@ -1,5 +1,4 @@
|
|
1
1
|
module RubyXL
|
2
|
-
|
3
2
|
class GenericStorageObject
|
4
3
|
SAVE_ORDER = 0
|
5
4
|
|
@@ -12,7 +11,7 @@ module RubyXL
|
|
12
11
|
end
|
13
12
|
|
14
13
|
def self.parse_file(zip_file, file_path)
|
15
|
-
(entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream
|
14
|
+
(entry = zip_file.find_entry(RubyXL::from_root(file_path))) && self.new(file_path, entry.get_input_stream(&:read))
|
16
15
|
end
|
17
16
|
|
18
17
|
def add_to_zip(zip_stream)
|
@@ -24,13 +23,18 @@ module RubyXL
|
|
24
23
|
end
|
25
24
|
|
26
25
|
class PrinterSettingsFile < GenericStorageObject
|
27
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings'
|
28
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings'
|
26
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.printerSettings'.freeze
|
27
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/printerSettings'.freeze
|
28
|
+
end
|
29
|
+
|
30
|
+
class CustomPropertyFile < GenericStorageObject
|
31
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.customProperty'.freeze
|
32
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customProperty'.freeze
|
29
33
|
end
|
30
34
|
|
31
35
|
class DrawingFile < GenericStorageObject
|
32
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawing+xml'
|
33
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing'
|
36
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawing+xml'.freeze
|
37
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/drawing'.freeze
|
34
38
|
|
35
39
|
include RubyXL::RelationshipSupport
|
36
40
|
|
@@ -41,12 +45,11 @@ module RubyXL
|
|
41
45
|
else store_relationship(rf, :unknown)
|
42
46
|
end
|
43
47
|
end
|
44
|
-
|
45
48
|
end
|
46
49
|
|
47
50
|
class ChartFile < GenericStorageObject
|
48
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
|
49
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'
|
51
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'.freeze
|
52
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chart'.freeze
|
50
53
|
|
51
54
|
include RubyXL::RelationshipSupport
|
52
55
|
|
@@ -58,18 +61,17 @@ module RubyXL
|
|
58
61
|
else store_relationship(rf, :unknown)
|
59
62
|
end
|
60
63
|
end
|
61
|
-
|
62
64
|
end
|
63
65
|
|
64
66
|
class BinaryImageFile < GenericStorageObject
|
65
|
-
CONTENT_TYPE = 'image/jpeg'
|
66
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'
|
67
|
+
CONTENT_TYPE = 'image/jpeg'.freeze
|
68
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/image'.freeze
|
67
69
|
end
|
68
70
|
|
69
71
|
class VMLDrawingFile < GenericStorageObject
|
70
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.vmlDrawing'
|
71
|
-
# CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'
|
72
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing'
|
72
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.vmlDrawing'.freeze
|
73
|
+
# CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chart+xml'.freeze
|
74
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/vmlDrawing'.freeze
|
73
75
|
|
74
76
|
include RubyXL::RelationshipSupport
|
75
77
|
|
@@ -77,32 +79,33 @@ module RubyXL
|
|
77
79
|
end
|
78
80
|
|
79
81
|
class ChartColorsFile < GenericStorageObject
|
80
|
-
CONTENT_TYPE = 'application/vnd.ms-office.chartcolorstyle+xml'
|
81
|
-
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartColorStyle'
|
82
|
+
CONTENT_TYPE = 'application/vnd.ms-office.chartcolorstyle+xml'.freeze
|
83
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartColorStyle'.freeze
|
82
84
|
end
|
83
85
|
|
84
86
|
class ChartStyleFile < GenericStorageObject
|
85
|
-
CONTENT_TYPE = 'application/vnd.ms-office.chartstyle+xml'
|
86
|
-
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartStyle'
|
87
|
+
CONTENT_TYPE = 'application/vnd.ms-office.chartstyle+xml'.freeze
|
88
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2011/relationships/chartStyle'.freeze
|
87
89
|
end
|
88
90
|
|
89
91
|
class TableFile < GenericStorageObject
|
90
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml'
|
91
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table'
|
92
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.table+xml'.freeze
|
93
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/table'.freeze
|
92
94
|
end
|
93
95
|
|
94
96
|
class ControlPropertiesFile < GenericStorageObject
|
95
|
-
|
97
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.controlproperties+xml'.freeze
|
98
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/ctrlProp'.freeze
|
96
99
|
end
|
97
100
|
|
98
101
|
class PivotCacheRecordsFile < GenericStorageObject
|
99
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml'
|
100
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords'
|
102
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheRecords+xml'.freeze
|
103
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheRecords'.freeze
|
101
104
|
end
|
102
105
|
|
103
106
|
class PivotCacheDefinitionFile < GenericStorageObject
|
104
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml'
|
105
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition'
|
107
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotCacheDefinition+xml'.freeze
|
108
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotCacheDefinition'.freeze
|
106
109
|
|
107
110
|
include RubyXL::RelationshipSupport
|
108
111
|
|
@@ -110,8 +113,8 @@ module RubyXL
|
|
110
113
|
end
|
111
114
|
|
112
115
|
class PivotTableFile < GenericStorageObject
|
113
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml'
|
114
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable'
|
116
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.pivotTable+xml'.freeze
|
117
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/pivotTable'.freeze
|
115
118
|
|
116
119
|
include RubyXL::RelationshipSupport
|
117
120
|
|
@@ -119,64 +122,72 @@ module RubyXL
|
|
119
122
|
end
|
120
123
|
|
121
124
|
class HyperlinkRelFile < GenericStorageObject
|
122
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink'
|
125
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/hyperlink'.freeze
|
123
126
|
end
|
124
127
|
|
125
128
|
class ThumbnailFile < GenericStorageObject
|
126
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail'
|
127
|
-
CONTENT_TYPE = 'image/x-wmf'
|
129
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/package/2006/relationships/metadata/thumbnail'.freeze
|
130
|
+
CONTENT_TYPE = 'image/x-wmf'.freeze
|
128
131
|
end
|
129
132
|
|
130
133
|
class ChartUserShapesFile < GenericStorageObject
|
131
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml'
|
132
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes'
|
134
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.drawingml.chartshapes+xml'.freeze
|
135
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/chartUserShapes'.freeze
|
133
136
|
end
|
134
137
|
|
135
138
|
class CustomPropertiesFile < GenericStorageObject
|
136
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.custom-properties+xml'
|
137
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties'
|
139
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.custom-properties+xml'.freeze
|
140
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/custom-properties'.freeze
|
138
141
|
end
|
139
142
|
|
140
143
|
class MacrosFile < GenericStorageObject
|
141
|
-
CONTENT_TYPE = 'application/vnd.ms-office.vbaProject'
|
142
|
-
REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'
|
144
|
+
CONTENT_TYPE = 'application/vnd.ms-office.vbaProject'.freeze
|
145
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/vbaProject'.freeze
|
143
146
|
end
|
144
147
|
|
145
148
|
class CustomXMLFile < GenericStorageObject
|
146
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml'
|
149
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/customXml'.freeze
|
147
150
|
end
|
148
151
|
|
149
152
|
class SlicerFile < GenericStorageObject
|
150
|
-
CONTENT_TYPE = 'application/vnd.ms-excel.slicer+xml'
|
151
|
-
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicer'
|
153
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.slicer+xml'.freeze
|
154
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicer'.freeze
|
152
155
|
end
|
153
156
|
|
154
157
|
class SlicerCacheFile < GenericStorageObject
|
155
|
-
CONTENT_TYPE = 'application/vnd.ms-excel.slicerCache+xml'
|
156
|
-
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicerCache'
|
158
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.slicerCache+xml'.freeze
|
159
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2007/relationships/slicerCache'.freeze
|
157
160
|
end
|
158
161
|
|
159
162
|
class OLEObjectFile < GenericStorageObject
|
160
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.oleObject'
|
161
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject'
|
163
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.oleObject'.freeze
|
164
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/oleObject'.freeze
|
165
|
+
end
|
166
|
+
|
167
|
+
class SheetMetadata < GenericStorageObject
|
168
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheetMetadata+xml'.freeze
|
169
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/sheetMetadata'.freeze
|
170
|
+
end
|
171
|
+
|
172
|
+
class PersonMetadata < GenericStorageObject
|
173
|
+
CONTENT_TYPE = 'application/vnd.ms-excel.person+xml'.freeze
|
174
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2017/10/relationships/person'.freeze
|
162
175
|
end
|
163
176
|
|
164
177
|
class ActiveX < GenericStorageObject
|
165
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control'
|
178
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/control'.freeze
|
166
179
|
|
167
180
|
include RubyXL::RelationshipSupport
|
168
181
|
|
169
182
|
def attach_relationship(rid, rf)
|
170
183
|
case rf
|
171
|
-
when RubyXL::ChartFile
|
184
|
+
when RubyXL::ChartFile then store_relationship(rf) # TODO
|
172
185
|
else store_relationship(rf, :unknown)
|
173
186
|
end
|
174
187
|
end
|
175
|
-
|
176
188
|
end
|
177
189
|
|
178
190
|
class ActiveXBinary < GenericStorageObject
|
179
|
-
REL_TYPE
|
191
|
+
REL_TYPE = 'http://schemas.microsoft.com/office/2006/relationships/activeXControlBinary'.freeze
|
180
192
|
end
|
181
|
-
|
182
193
|
end
|
@@ -6,7 +6,6 @@ require 'rubyXL/objects/border'
|
|
6
6
|
require 'rubyXL/objects/extensions'
|
7
7
|
|
8
8
|
module RubyXL
|
9
|
-
|
10
9
|
# http://www.datypic.com/sc/ooxml/e-ssml_numFmt-1.html
|
11
10
|
class NumberFormat < OOXMLObject
|
12
11
|
define_attribute(:numFmtId, :int, :required => true)
|
@@ -15,9 +14,8 @@ module RubyXL
|
|
15
14
|
|
16
15
|
def is_date_format?
|
17
16
|
# v-------- Toss all the escaped chars -------v v--- and see if any date-related remained
|
18
|
-
!!(format_code.gsub(/(
|
17
|
+
!!(format_code.gsub(/("[^"]*"|\[[^\]]*\]|[\\_*].)/i, '') =~ /[dmyhs]/i)
|
19
18
|
end
|
20
|
-
|
21
19
|
end
|
22
20
|
|
23
21
|
# http://www.datypic.com/sc/ooxml/e-ssml_numFmts-1.html
|
@@ -63,7 +61,6 @@ module RubyXL
|
|
63
61
|
def find_by_format_id(format_id)
|
64
62
|
self.find { |fmt| fmt.num_fmt_id == format_id }
|
65
63
|
end
|
66
|
-
|
67
64
|
end
|
68
65
|
|
69
66
|
# http://www.datypic.com/sc/ooxml/e-ssml_cellStyleXfs-1.html
|
@@ -82,11 +79,8 @@ module RubyXL
|
|
82
79
|
define_element_name 'cellXfs'
|
83
80
|
|
84
81
|
def self.default
|
85
|
-
self.new(:_ => [
|
86
|
-
|
87
|
-
:num_fmt_id => 0, :font_id => 0, :fill_id => 0, :border_id => 0, :xfId => 0
|
88
|
-
)
|
89
|
-
])
|
82
|
+
self.new(:_ => [ RubyXL::XF.new(:num_fmt_id => 0, :font_id => 0, :fill_id => 0,
|
83
|
+
:border_id => 0, :xfId => 0) ])
|
90
84
|
end
|
91
85
|
end
|
92
86
|
|
@@ -161,8 +155,8 @@ module RubyXL
|
|
161
155
|
|
162
156
|
# http://www.datypic.com/sc/ooxml/e-ssml_styleSheet.html
|
163
157
|
class Stylesheet < OOXMLTopLevelObject
|
164
|
-
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'
|
165
|
-
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles'
|
158
|
+
CONTENT_TYPE = 'application/vnd.openxmlformats-officedocument.spreadsheetml.styles+xml'.freeze
|
159
|
+
REL_TYPE = 'http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles'.freeze
|
166
160
|
|
167
161
|
define_child_node(RubyXL::NumberFormats, :accessor => :number_formats)
|
168
162
|
define_child_node(RubyXL::Fonts)
|
@@ -176,11 +170,11 @@ module RubyXL
|
|
176
170
|
define_child_node(RubyXL::Colors)
|
177
171
|
define_child_node(RubyXL::ExtensionStorageArea)
|
178
172
|
define_element_name 'styleSheet'
|
179
|
-
set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main'
|
173
|
+
set_namespaces('http://schemas.openxmlformats.org/spreadsheetml/2006/main' => nil,
|
180
174
|
'http://schemas.openxmlformats.org/officeDocument/2006/relationships' => 'r',
|
181
|
-
'http://schemas.openxmlformats.org/markup-compatibility/2006'
|
182
|
-
'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac'
|
183
|
-
'urn:schemas-microsoft-com:mac:vml'
|
175
|
+
'http://schemas.openxmlformats.org/markup-compatibility/2006' => 'mc',
|
176
|
+
'http://schemas.microsoft.com/office/spreadsheetml/2009/9/ac' => 'x14ac',
|
177
|
+
'urn:schemas-microsoft-com:mac:vml' => 'mv')
|
184
178
|
|
185
179
|
def initialize(*args)
|
186
180
|
super
|
@@ -226,7 +220,5 @@ module RubyXL
|
|
226
220
|
|
227
221
|
return max_fmt_id
|
228
222
|
end
|
229
|
-
|
230
223
|
end
|
231
|
-
|
232
224
|
end
|