rubyXL 2.5.5 → 2.5.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/rubyXL/parser.rb +84 -77
- data/lib/rubyXL/worksheet.rb +22 -18
- data/rdoc/README_rdoc.html +1 -1
- data/rdoc/RubyXL.html +1 -1
- data/rdoc/RubyXL/AExtension.html +1 -1
- data/rdoc/RubyXL/AExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/AdjustHandleList.html +1 -1
- data/rdoc/RubyXL/Alignment.html +1 -1
- data/rdoc/RubyXL/AlternateContent.html +1 -1
- data/rdoc/RubyXL/AutoFilter.html +1 -1
- data/rdoc/RubyXL/AutoFilterColumn.html +1 -1
- data/rdoc/RubyXL/BodyProperties.html +1 -1
- data/rdoc/RubyXL/BooleanNode.html +1 -1
- data/rdoc/RubyXL/BooleanValue.html +1 -1
- data/rdoc/RubyXL/Border.html +1 -1
- data/rdoc/RubyXL/BorderEdge.html +1 -1
- data/rdoc/RubyXL/Borders.html +1 -1
- data/rdoc/RubyXL/Break.html +1 -1
- data/rdoc/RubyXL/BreakList.html +1 -1
- data/rdoc/RubyXL/CT_AdjPoint2D.html +1 -1
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +1 -1
- data/rdoc/RubyXL/CT_Backdrop.html +1 -1
- data/rdoc/RubyXL/CT_Bevel.html +1 -1
- data/rdoc/RubyXL/CT_BiLevelEffect.html +1 -1
- data/rdoc/RubyXL/CT_BlendEffect.html +1 -1
- data/rdoc/RubyXL/CT_Blip.html +1 -1
- data/rdoc/RubyXL/CT_BlipFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_BlurEffect.html +1 -1
- data/rdoc/RubyXL/CT_Camera.html +1 -1
- data/rdoc/RubyXL/CT_Color.html +1 -1
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +1 -1
- data/rdoc/RubyXL/CT_ColorMapping.html +1 -1
- data/rdoc/RubyXL/CT_ColorScheme.html +1 -1
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSite.html +1 -1
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +1 -1
- data/rdoc/RubyXL/CT_DashStop.html +1 -1
- data/rdoc/RubyXL/CT_DashStopList.html +1 -1
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +1 -1
- data/rdoc/RubyXL/CT_DuotoneEffect.html +1 -1
- data/rdoc/RubyXL/CT_EffectContainer.html +1 -1
- data/rdoc/RubyXL/CT_EffectList.html +1 -1
- data/rdoc/RubyXL/CT_EffectReference.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleItem.html +1 -1
- data/rdoc/RubyXL/CT_EffectStyleList.html +1 -1
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +1 -1
- data/rdoc/RubyXL/CT_FillEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +1 -1
- data/rdoc/RubyXL/CT_FillStyleList.html +1 -1
- data/rdoc/RubyXL/CT_FlatText.html +1 -1
- data/rdoc/RubyXL/CT_FontCollection.html +1 -1
- data/rdoc/RubyXL/CT_FontReference.html +1 -1
- data/rdoc/RubyXL/CT_GeomGuideList.html +1 -1
- data/rdoc/RubyXL/CT_GlowEffect.html +1 -1
- data/rdoc/RubyXL/CT_GradientFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_GradientStop.html +1 -1
- data/rdoc/RubyXL/CT_GradientStopList.html +1 -1
- data/rdoc/RubyXL/CT_HSLEffect.html +1 -1
- data/rdoc/RubyXL/CT_HslColor.html +1 -1
- data/rdoc/RubyXL/CT_Hyperlink.html +1 -1
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_LightRig.html +1 -1
- data/rdoc/RubyXL/CT_LineEndProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineProperties.html +1 -1
- data/rdoc/RubyXL/CT_LineStyleList.html +1 -1
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_LuminanceEffect.html +1 -1
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +1 -1
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_Path2D.html +1 -1
- data/rdoc/RubyXL/CT_Path2DArcTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DList.html +1 -1
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +1 -1
- data/rdoc/RubyXL/CT_Path2DTo.html +1 -1
- data/rdoc/RubyXL/CT_PathShadeProperties.html +1 -1
- data/rdoc/RubyXL/CT_PatternFillProperties.html +1 -1
- data/rdoc/RubyXL/CT_Point3D.html +1 -1
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CT_PresetColor.html +1 -1
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +1 -1
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +1 -1
- data/rdoc/RubyXL/CT_PresetTextShape.html +1 -1
- data/rdoc/RubyXL/CT_ReflectionEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +1 -1
- data/rdoc/RubyXL/CT_RelativeRect.html +1 -1
- data/rdoc/RubyXL/CT_SRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_ScRgbColor.html +1 -1
- data/rdoc/RubyXL/CT_Scene3D.html +1 -1
- data/rdoc/RubyXL/CT_SchemeColor.html +1 -1
- data/rdoc/RubyXL/CT_Shape3D.html +1 -1
- data/rdoc/RubyXL/CT_ShapeStyle.html +1 -1
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +1 -1
- data/rdoc/RubyXL/CT_SphereCoords.html +1 -1
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrix.html +1 -1
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +1 -1
- data/rdoc/RubyXL/CT_SupplementalFont.html +1 -1
- data/rdoc/RubyXL/CT_SystemColor.html +1 -1
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextBlipBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharBullet.html +1 -1
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextFont.html +1 -1
- data/rdoc/RubyXL/CT_TextListStyle.html +1 -1
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +1 -1
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +1 -1
- data/rdoc/RubyXL/CT_TextSpacing.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStop.html +1 -1
- data/rdoc/RubyXL/CT_TextTabStopList.html +1 -1
- data/rdoc/RubyXL/CT_TileInfoProperties.html +1 -1
- data/rdoc/RubyXL/CT_TintEffect.html +1 -1
- data/rdoc/RubyXL/CT_Transform2D.html +1 -1
- data/rdoc/RubyXL/CT_TransformEffect.html +1 -1
- data/rdoc/RubyXL/CT_Vector3D.html +1 -1
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +1 -1
- data/rdoc/RubyXL/CalculationChain.html +1 -1
- data/rdoc/RubyXL/CalculationChainCell.html +1 -1
- data/rdoc/RubyXL/CalculationProperties.html +1 -1
- data/rdoc/RubyXL/Cell.html +1 -1
- data/rdoc/RubyXL/CellSmartTag.html +1 -1
- data/rdoc/RubyXL/CellSmartTagProperty.html +1 -1
- data/rdoc/RubyXL/CellSmartTags.html +1 -1
- data/rdoc/RubyXL/CellStyle.html +1 -1
- data/rdoc/RubyXL/CellStyleXFs.html +1 -1
- data/rdoc/RubyXL/CellStyles.html +1 -1
- data/rdoc/RubyXL/CellValue.html +1 -1
- data/rdoc/RubyXL/CellWatch.html +1 -1
- data/rdoc/RubyXL/CellWatches.html +1 -1
- data/rdoc/RubyXL/CellXFs.html +1 -1
- data/rdoc/RubyXL/Chartsheet.html +1 -1
- data/rdoc/RubyXL/ChartsheetPageSetup.html +1 -1
- data/rdoc/RubyXL/ChartsheetProperties.html +1 -1
- data/rdoc/RubyXL/ChartsheetProtection.html +1 -1
- data/rdoc/RubyXL/ChartsheetView.html +1 -1
- data/rdoc/RubyXL/ChartsheetViews.html +1 -1
- data/rdoc/RubyXL/Color.html +1 -1
- data/rdoc/RubyXL/ColorFilter.html +1 -1
- data/rdoc/RubyXL/ColorScale.html +1 -1
- data/rdoc/RubyXL/ColorSet.html +1 -1
- data/rdoc/RubyXL/Colors.html +1 -1
- data/rdoc/RubyXL/ColumnRange.html +1 -1
- data/rdoc/RubyXL/ColumnRanges.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatValue.html +1 -1
- data/rdoc/RubyXL/ConditionalFormatting.html +1 -1
- data/rdoc/RubyXL/ConditionalFormattingRule.html +1 -1
- data/rdoc/RubyXL/ContentTypeDefault.html +1 -1
- data/rdoc/RubyXL/ContentTypeOverride.html +1 -1
- data/rdoc/RubyXL/ContentTypes.html +1 -1
- data/rdoc/RubyXL/CoreProperties.html +1 -1
- data/rdoc/RubyXL/CustomColor.html +1 -1
- data/rdoc/RubyXL/CustomColorList.html +1 -1
- data/rdoc/RubyXL/CustomFilter.html +1 -1
- data/rdoc/RubyXL/CustomFilters.html +1 -1
- data/rdoc/RubyXL/CustomGeometry.html +1 -1
- data/rdoc/RubyXL/CustomProperties.html +1 -1
- data/rdoc/RubyXL/CustomProperty.html +1 -1
- data/rdoc/RubyXL/CustomSheetView.html +1 -1
- data/rdoc/RubyXL/CustomSheetViews.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookView.html +1 -1
- data/rdoc/RubyXL/CustomWorkbookViews.html +1 -1
- data/rdoc/RubyXL/DXF.html +1 -1
- data/rdoc/RubyXL/DXFs.html +1 -1
- data/rdoc/RubyXL/DataBar.html +1 -1
- data/rdoc/RubyXL/DataConsolidate.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReference.html +1 -1
- data/rdoc/RubyXL/DataConsolidationReferences.html +1 -1
- data/rdoc/RubyXL/DataType.html +1 -1
- data/rdoc/RubyXL/DataValidation.html +1 -1
- data/rdoc/RubyXL/DataValidations.html +1 -1
- data/rdoc/RubyXL/DateGroupItem.html +1 -1
- data/rdoc/RubyXL/DefinedName.html +1 -1
- data/rdoc/RubyXL/DefinedNames.html +1 -1
- data/rdoc/RubyXL/DocumentProperties.html +1 -1
- data/rdoc/RubyXL/DynamicFilter.html +1 -1
- data/rdoc/RubyXL/EmbeddedControl.html +1 -1
- data/rdoc/RubyXL/EmbeddedControls.html +1 -1
- data/rdoc/RubyXL/Extension.html +1 -1
- data/rdoc/RubyXL/ExtensionStorageArea.html +1 -1
- data/rdoc/RubyXL/Extents.html +1 -1
- data/rdoc/RubyXL/ExternalReference.html +1 -1
- data/rdoc/RubyXL/ExternalReferences.html +1 -1
- data/rdoc/RubyXL/ExtraColorSchemeList.html +1 -1
- data/rdoc/RubyXL/FieldItem.html +1 -1
- data/rdoc/RubyXL/FileRecoveryProperties.html +1 -1
- data/rdoc/RubyXL/FileSharing.html +1 -1
- data/rdoc/RubyXL/FileVersion.html +1 -1
- data/rdoc/RubyXL/Fill.html +1 -1
- data/rdoc/RubyXL/Fills.html +1 -1
- data/rdoc/RubyXL/FilterContainer.html +1 -1
- data/rdoc/RubyXL/FloatNode.html +1 -1
- data/rdoc/RubyXL/FloatValue.html +1 -1
- data/rdoc/RubyXL/Font.html +1 -1
- data/rdoc/RubyXL/FontScheme.html +1 -1
- data/rdoc/RubyXL/Fonts.html +1 -1
- data/rdoc/RubyXL/Formula.html +1 -1
- data/rdoc/RubyXL/FunctionGroup.html +1 -1
- data/rdoc/RubyXL/FunctionGroups.html +1 -1
- data/rdoc/RubyXL/GenericStorage.html +1 -1
- data/rdoc/RubyXL/GradientFill.html +1 -1
- data/rdoc/RubyXL/HeaderFooterSettings.html +1 -1
- data/rdoc/RubyXL/Hyperlink.html +1 -1
- data/rdoc/RubyXL/Hyperlinks.html +1 -1
- data/rdoc/RubyXL/IconFilter.html +1 -1
- data/rdoc/RubyXL/IconSet.html +1 -1
- data/rdoc/RubyXL/IgnoredError.html +1 -1
- data/rdoc/RubyXL/IgnoredErrors.html +1 -1
- data/rdoc/RubyXL/IndexedColors.html +1 -1
- data/rdoc/RubyXL/InputCells.html +1 -1
- data/rdoc/RubyXL/IntegerNode.html +1 -1
- data/rdoc/RubyXL/IntegerValue.html +1 -1
- data/rdoc/RubyXL/LegacyCell.html +1 -1
- data/rdoc/RubyXL/LegacyWorkbook.html +1 -1
- data/rdoc/RubyXL/LegacyWorksheet.html +62 -59
- data/rdoc/RubyXL/MRUColors.html +1 -1
- data/rdoc/RubyXL/MergedCell.html +1 -1
- data/rdoc/RubyXL/MergedCells.html +1 -1
- data/rdoc/RubyXL/NumFmt.html +1 -1
- data/rdoc/RubyXL/NumberFormat.html +1 -1
- data/rdoc/RubyXL/NumberFormats.html +1 -1
- data/rdoc/RubyXL/OLEObject.html +1 -1
- data/rdoc/RubyXL/OLEObjects.html +1 -1
- data/rdoc/RubyXL/OLESize.html +1 -1
- data/rdoc/RubyXL/OOXMLContainerObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObject.html +1 -1
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +1 -1
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +1 -1
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +1 -1
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +1 -1
- data/rdoc/RubyXL/Offset.html +1 -1
- data/rdoc/RubyXL/OutlineProperties.html +1 -1
- data/rdoc/RubyXL/PageMargins.html +1 -1
- data/rdoc/RubyXL/PageSetup.html +1 -1
- data/rdoc/RubyXL/PageSetupProperties.html +1 -1
- data/rdoc/RubyXL/Pane.html +1 -1
- data/rdoc/RubyXL/Parser.html +90 -83
- data/rdoc/RubyXL/PatternFill.html +1 -1
- data/rdoc/RubyXL/PhoneticProperties.html +1 -1
- data/rdoc/RubyXL/PhoneticRun.html +1 -1
- data/rdoc/RubyXL/PivotArea.html +1 -1
- data/rdoc/RubyXL/PivotCache.html +1 -1
- data/rdoc/RubyXL/PivotCaches.html +1 -1
- data/rdoc/RubyXL/PivotReference.html +1 -1
- data/rdoc/RubyXL/PivotReferences.html +1 -1
- data/rdoc/RubyXL/PivotTableSelection.html +1 -1
- data/rdoc/RubyXL/PresetGeometry.html +1 -1
- data/rdoc/RubyXL/PrintOptions.html +1 -1
- data/rdoc/RubyXL/ProtectedRange.html +1 -1
- data/rdoc/RubyXL/ProtectedRanges.html +1 -1
- data/rdoc/RubyXL/Protection.html +1 -1
- data/rdoc/RubyXL/RID.html +1 -1
- data/rdoc/RubyXL/RawOOXML.html +1 -1
- data/rdoc/RubyXL/Reference.html +1 -1
- data/rdoc/RubyXL/Relationship.html +1 -1
- data/rdoc/RubyXL/RichText.html +1 -1
- data/rdoc/RubyXL/RichTextRun.html +1 -1
- data/rdoc/RubyXL/RootRelationships.html +1 -1
- data/rdoc/RubyXL/Row.html +1 -1
- data/rdoc/RubyXL/RunProperties.html +1 -1
- data/rdoc/RubyXL/Scenario.html +1 -1
- data/rdoc/RubyXL/Scenarios.html +1 -1
- data/rdoc/RubyXL/Selection.html +1 -1
- data/rdoc/RubyXL/ShapeGuide.html +1 -1
- data/rdoc/RubyXL/ShapeTextRectangle.html +1 -1
- data/rdoc/RubyXL/SharedStringsTable.html +1 -1
- data/rdoc/RubyXL/Sheet.html +1 -1
- data/rdoc/RubyXL/SheetCalculationProperties.html +1 -1
- data/rdoc/RubyXL/SheetData.html +1 -1
- data/rdoc/RubyXL/Sheets.html +1 -1
- data/rdoc/RubyXL/SmartTagProperties.html +1 -1
- data/rdoc/RubyXL/SmartTagType.html +1 -1
- data/rdoc/RubyXL/SmartTagTypes.html +1 -1
- data/rdoc/RubyXL/SmartTags.html +1 -1
- data/rdoc/RubyXL/SortCondition.html +1 -1
- data/rdoc/RubyXL/SortState.html +1 -1
- data/rdoc/RubyXL/Sqref.html +1 -1
- data/rdoc/RubyXL/Stop.html +1 -1
- data/rdoc/RubyXL/StringNode.html +1 -1
- data/rdoc/RubyXL/StringNodeW3C.html +1 -1
- data/rdoc/RubyXL/StringValue.html +1 -1
- data/rdoc/RubyXL/Stylesheet.html +1 -1
- data/rdoc/RubyXL/TableParts.html +1 -1
- data/rdoc/RubyXL/TableStyle.html +1 -1
- data/rdoc/RubyXL/TableStyles.html +1 -1
- data/rdoc/RubyXL/Text.html +1 -1
- data/rdoc/RubyXL/Theme.html +1 -1
- data/rdoc/RubyXL/ThemeElements.html +1 -1
- data/rdoc/RubyXL/Top10.html +1 -1
- data/rdoc/RubyXL/Variant.html +1 -1
- data/rdoc/RubyXL/Vector.html +1 -1
- data/rdoc/RubyXL/VectorValue.html +1 -1
- data/rdoc/RubyXL/VisualProperties.html +1 -1
- data/rdoc/RubyXL/WebPublishObject.html +1 -1
- data/rdoc/RubyXL/WebPublishObjects.html +1 -1
- data/rdoc/RubyXL/WebPublishingItem.html +1 -1
- data/rdoc/RubyXL/WebPublishingItems.html +1 -1
- data/rdoc/RubyXL/WebPublishingProperties.html +1 -1
- data/rdoc/RubyXL/Workbook.html +1 -1
- data/rdoc/RubyXL/WorkbookProperties.html +1 -1
- data/rdoc/RubyXL/WorkbookProtection.html +1 -1
- data/rdoc/RubyXL/WorkbookRelationships.html +1 -1
- data/rdoc/RubyXL/WorkbookView.html +1 -1
- data/rdoc/RubyXL/WorkbookViews.html +1 -1
- data/rdoc/RubyXL/Worksheet.html +1 -1
- data/rdoc/RubyXL/WorksheetDimensions.html +1 -1
- data/rdoc/RubyXL/WorksheetFormatProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProperties.html +1 -1
- data/rdoc/RubyXL/WorksheetProtection.html +1 -1
- data/rdoc/RubyXL/WorksheetView.html +1 -1
- data/rdoc/RubyXL/WorksheetViews.html +1 -1
- data/rdoc/RubyXL/XF.html +1 -1
- data/rdoc/created.rid +20 -20
- data/rdoc/index.html +2 -2
- data/rdoc/js/search_index.js +1 -1
- data/rdoc/table_of_contents.html +2 -2
- data/rubyXL.gemspec +3 -3
- data/spec/lib/worksheet_spec.rb +13 -0
- data/test/test_parse_write.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5d4de6685adea206ea016f0836086e35756a016
|
4
|
+
data.tar.gz: 808c2f74761873580278873b28644650244aa003
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c48ceac803b8088420747e52fff0700aab2ebfce5355bd128c0334f6da73327a509b2c7300560297463ad0663405df237941b69cfc4a78e874155e8a3a141540
|
7
|
+
data.tar.gz: e6cd7b075274dc1cd319ca32e56b4602acdbda72ae39a67a2d46bc2baae3c6881df57966decc8febaef3606fc010bc7e2ee23c0c827be8f778deabcc0f256577
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.5.
|
1
|
+
2.5.6
|
data/lib/rubyXL/parser.rb
CHANGED
@@ -10,11 +10,13 @@ module RubyXL
|
|
10
10
|
self.new(opts).parse(file_path)
|
11
11
|
end
|
12
12
|
|
13
|
-
#
|
14
|
-
#
|
13
|
+
# +keep_tempfiles_on_error+ prevents temp files to be erased if exception was thrown during parsing.
|
14
|
+
# +:data_only+ allows only the sheet data to be parsed, so as to speed up parsing.
|
15
|
+
# However, using this option will result in date-formatted cells being interpreted as numbers.
|
15
16
|
def initialize(opts = {})
|
16
17
|
@data_only = opts.is_a?(TrueClass) || opts[:data_only]
|
17
18
|
@skip_filename_check = opts[:skip_filename_check]
|
19
|
+
@delete_tempfiles_on_error = !opts[:keep_tempfiles_on_error]
|
18
20
|
end
|
19
21
|
|
20
22
|
def data_only
|
@@ -22,90 +24,95 @@ module RubyXL
|
|
22
24
|
self
|
23
25
|
end
|
24
26
|
|
25
|
-
def parse(xl_file_path
|
27
|
+
def parse(xl_file_path)
|
26
28
|
raise 'Not .xlsx or .xlsm excel file' unless @skip_filename_check ||
|
27
29
|
%w{.xlsx .xlsm}.include?(File.extname(xl_file_path))
|
28
30
|
|
29
31
|
dir_path = File.join(File.dirname(xl_file_path), Dir::Tmpname.make_tmpname(['rubyXL', '.tmp'], nil))
|
32
|
+
parse_success = false
|
33
|
+
|
34
|
+
begin
|
35
|
+
::Zip::File.open(xl_file_path) { |zip_file|
|
36
|
+
zip_file.each { |f|
|
37
|
+
fpath = File.join(dir_path, f.name)
|
38
|
+
FileUtils.mkdir_p(File.dirname(fpath))
|
39
|
+
zip_file.extract(f, fpath) unless File.exist?(fpath)
|
40
|
+
}
|
41
|
+
}
|
30
42
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
43
|
+
wb = RubyXL::Workbook.parse_file(dir_path)
|
44
|
+
wb.filepath = xl_file_path
|
45
|
+
|
46
|
+
wb.content_types = RubyXL::ContentTypes.parse_file(dir_path)
|
47
|
+
wb.relationship_container = RubyXL::WorkbookRelationships.parse_file(dir_path)
|
48
|
+
wb.root_relationship_container = RubyXL::RootRelationships.parse_file(dir_path)
|
49
|
+
wb.shared_strings_container = RubyXL::SharedStringsTable.parse_file(dir_path)
|
50
|
+
|
51
|
+
# We must always load the stylesheet because it tells us which values are actually dates/times.
|
52
|
+
wb.stylesheet = RubyXL::Stylesheet.parse_file(dir_path)
|
53
|
+
|
54
|
+
unless @data_only
|
55
|
+
wb.media.load_dir(dir_path)
|
56
|
+
wb.external_links.load_dir(dir_path)
|
57
|
+
wb.external_links_rels.load_dir(dir_path)
|
58
|
+
wb.drawings.load_dir(dir_path)
|
59
|
+
wb.drawings_rels.load_dir(dir_path)
|
60
|
+
wb.charts.load_dir(dir_path)
|
61
|
+
wb.chart_rels.load_dir(dir_path)
|
62
|
+
wb.printer_settings.load_dir(dir_path)
|
63
|
+
wb.worksheet_rels.load_dir(dir_path)
|
64
|
+
wb.chartsheet_rels.load_dir(dir_path)
|
65
|
+
wb.macros.load_file(dir_path, 'vbaProject.bin')
|
66
|
+
wb.thumbnail.load_file(dir_path, 'thumbnail.jpeg')
|
67
|
+
|
68
|
+
wb.theme = RubyXL::Theme.parse_file(dir_path)
|
69
|
+
wb.core_properties = RubyXL::CoreProperties.parse_file(dir_path)
|
70
|
+
wb.document_properties = RubyXL::DocumentProperties.parse_file(dir_path)
|
71
|
+
wb.calculation_chain = RubyXL::CalculationChain.parse_file(dir_path)
|
72
|
+
end
|
73
|
+
|
74
|
+
#fills out count information for each font, fill, and border
|
75
|
+
wb.cell_xfs.each { |style|
|
76
|
+
id = style.font_id
|
77
|
+
wb.fonts[id].count += 1 #unless id.nil?
|
78
|
+
|
79
|
+
id = style.fill_id
|
80
|
+
wb.fills[id].count += 1 #unless id.nil?
|
81
|
+
|
82
|
+
id = style.border_id
|
83
|
+
wb.borders[id].count += 1 #unless id.nil?
|
36
84
|
}
|
37
|
-
}
|
38
|
-
|
39
|
-
wb = RubyXL::Workbook.parse_file(dir_path)
|
40
|
-
wb.filepath = xl_file_path
|
41
|
-
|
42
|
-
wb.content_types = RubyXL::ContentTypes.parse_file(dir_path)
|
43
|
-
wb.relationship_container = RubyXL::WorkbookRelationships.parse_file(dir_path)
|
44
|
-
wb.root_relationship_container = RubyXL::RootRelationships.parse_file(dir_path)
|
45
|
-
wb.shared_strings_container = RubyXL::SharedStringsTable.parse_file(dir_path)
|
46
|
-
|
47
|
-
# We must always load the stylesheet because it tells us which values are actually dates/times.
|
48
|
-
wb.stylesheet = RubyXL::Stylesheet.parse_file(dir_path)
|
49
|
-
|
50
|
-
unless @data_only
|
51
|
-
wb.media.load_dir(dir_path)
|
52
|
-
wb.external_links.load_dir(dir_path)
|
53
|
-
wb.external_links_rels.load_dir(dir_path)
|
54
|
-
wb.drawings.load_dir(dir_path)
|
55
|
-
wb.drawings_rels.load_dir(dir_path)
|
56
|
-
wb.charts.load_dir(dir_path)
|
57
|
-
wb.chart_rels.load_dir(dir_path)
|
58
|
-
wb.printer_settings.load_dir(dir_path)
|
59
|
-
wb.worksheet_rels.load_dir(dir_path)
|
60
|
-
wb.chartsheet_rels.load_dir(dir_path)
|
61
|
-
wb.macros.load_file(dir_path, 'vbaProject.bin')
|
62
|
-
wb.thumbnail.load_file(dir_path, 'thumbnail.jpeg')
|
63
|
-
|
64
|
-
wb.theme = RubyXL::Theme.parse_file(dir_path)
|
65
|
-
wb.core_properties = RubyXL::CoreProperties.parse_file(dir_path)
|
66
|
-
wb.document_properties = RubyXL::DocumentProperties.parse_file(dir_path)
|
67
|
-
wb.calculation_chain = RubyXL::CalculationChain.parse_file(dir_path)
|
68
|
-
end
|
69
85
|
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
sheet_obj =
|
90
|
-
sheet_obj.
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
}
|
95
|
-
when 'chartsheet' then
|
96
|
-
sheet_obj = RubyXL::Chartsheet.parse(sheet_file)
|
97
|
-
end
|
98
|
-
|
99
|
-
sheet_obj.workbook = wb
|
100
|
-
sheet_obj.sheet_name = sheet.name
|
101
|
-
sheet_obj.sheet_id = sheet.sheet_id
|
102
|
-
sheet_obj.state = sheet.state
|
103
|
-
|
104
|
-
wb.worksheets[i] = sheet_obj
|
86
|
+
wb.sheets.each_with_index { |sheet, i|
|
87
|
+
sheet_rel = wb.relationship_container.find_by_rid(sheet.r_id)
|
88
|
+
|
89
|
+
# Making sure that the file will be automatically closed immediately after it has been read
|
90
|
+
File.open(File.join(dir_path, 'xl', sheet_rel.target)) { |sheet_file|
|
91
|
+
case File::basename(sheet_rel.type)
|
92
|
+
when 'worksheet' then
|
93
|
+
sheet_obj = RubyXL::Worksheet.parse(sheet_file)
|
94
|
+
sheet_obj.sheet_data.rows.each { |r|
|
95
|
+
next if r.nil?
|
96
|
+
r.worksheet = sheet
|
97
|
+
r.cells.each { |c| c.worksheet = sheet_obj unless c.nil? }
|
98
|
+
}
|
99
|
+
when 'chartsheet' then
|
100
|
+
sheet_obj = RubyXL::Chartsheet.parse(sheet_file)
|
101
|
+
end
|
102
|
+
|
103
|
+
sheet_obj.workbook = wb
|
104
|
+
sheet_obj.sheet_name = sheet.name
|
105
|
+
sheet_obj.sheet_id = sheet.sheet_id
|
106
|
+
sheet_obj.state = sheet.state
|
107
|
+
|
108
|
+
wb.worksheets[i] = sheet_obj
|
109
|
+
}
|
105
110
|
}
|
106
|
-
}
|
107
111
|
|
108
|
-
|
112
|
+
parse_success = true
|
113
|
+
ensure
|
114
|
+
FileUtils.remove_entry_secure(dir_path) if parse_success || @delete_tempfiles_on_error
|
115
|
+
end
|
109
116
|
|
110
117
|
return wb
|
111
118
|
end
|
data/lib/rubyXL/worksheet.rb
CHANGED
@@ -23,7 +23,7 @@ module LegacyWorksheet
|
|
23
23
|
#returns 2d array of just the cell values (without style or formula information)
|
24
24
|
def extract_data(args = {})
|
25
25
|
sheet_data.rows.map { |row|
|
26
|
-
row
|
26
|
+
row.cells.map { |c| c && c.value(args) } unless row.nil?
|
27
27
|
}
|
28
28
|
end
|
29
29
|
|
@@ -369,28 +369,33 @@ module LegacyWorksheet
|
|
369
369
|
end
|
370
370
|
|
371
371
|
# Inserts row at row_index, pushes down, copies style from the row above (that's what Excel 2013 does!)
|
372
|
-
#
|
372
|
+
# NOTE: use of this method will break formulas which reference cells which are being "pushed down"
|
373
373
|
def insert_row(row_index = 0)
|
374
374
|
validate_workbook
|
375
375
|
ensure_cell_exists(row_index)
|
376
376
|
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
old_row
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
377
|
+
old_row = new_cells = nil
|
378
|
+
|
379
|
+
if row_index > 0 then
|
380
|
+
old_row = sheet_data.rows[row_index - 1]
|
381
|
+
if old_row then
|
382
|
+
new_cells = old_row.cells.collect { |c|
|
383
|
+
if c.nil? then nil
|
384
|
+
else RubyXL::Cell.new(:style_index => c.style_index)
|
385
|
+
end }
|
386
|
+
end
|
386
387
|
end
|
387
388
|
|
389
|
+
row0 = sheet_data.rows[0]
|
390
|
+
new_cells ||= Array.new((row0 && row0.cells.size) || 0)
|
391
|
+
|
388
392
|
sheet_data.rows.insert(row_index, nil)
|
389
393
|
new_row = add_row(row_index, :cells => new_cells, :style_index => old_row && old_row.style_index)
|
390
394
|
|
391
|
-
#
|
395
|
+
# Update row values for all rows below
|
392
396
|
row_index.upto(sheet_data.rows.size - 1) { |i|
|
393
397
|
row = sheet_data.rows[i]
|
398
|
+
next if row.nil?
|
394
399
|
row.cells.each { |c| c.row = i unless c.nil? }
|
395
400
|
}
|
396
401
|
|
@@ -403,21 +408,20 @@ module LegacyWorksheet
|
|
403
408
|
|
404
409
|
return nil unless column_exists(column_index)
|
405
410
|
|
406
|
-
#delete column
|
407
411
|
sheet_data.rows.each { |row| row.cells.delete_at(column_index) }
|
408
412
|
|
409
|
-
#
|
413
|
+
# Change column numbers for cells to the right of the deleted column
|
410
414
|
sheet_data.rows.each_with_index { |row, row_index|
|
411
415
|
row.cells.each_with_index { |c, column_index|
|
412
|
-
c.column
|
416
|
+
c.column = column_index if c.is_a?(Cell)
|
413
417
|
}
|
414
418
|
}
|
415
419
|
|
416
420
|
cols.column_ranges.each { |range| range.delete_column(column_index) }
|
417
421
|
end
|
418
422
|
|
419
|
-
#
|
420
|
-
#
|
423
|
+
# Inserts column at +column_index+, pushes everything right, takes styles from column to left
|
424
|
+
# NOTE: use of this method will break formulas which reference cells which are being "pushed right"
|
421
425
|
def insert_column(column_index = 0)
|
422
426
|
validate_workbook
|
423
427
|
ensure_cell_exists(0, column_index)
|
@@ -816,7 +820,7 @@ module LegacyWorksheet
|
|
816
820
|
# with lower indices, filling them with +nil+s. But, we can't just write +nil+
|
817
821
|
# to +column_index+ because it may be less than +size+! So we read from that index
|
818
822
|
# (if it didn't exist, we will get nil) and write right back.
|
819
|
-
sheet_data.rows.each { |r| r.cells[column_index] = r.cells[column_index] }
|
823
|
+
sheet_data.rows.each { |r| r.cells[column_index] = r.cells[column_index] unless r.nil? }
|
820
824
|
|
821
825
|
first_row = sheet_data.rows.first
|
822
826
|
col_size = [ first_row && first_row.cells.size || 0, column_index ].max
|
data/rdoc/README_rdoc.html
CHANGED
data/rdoc/RubyXL.html
CHANGED
data/rdoc/RubyXL/AExtension.html
CHANGED
data/rdoc/RubyXL/Alignment.html
CHANGED
data/rdoc/RubyXL/AutoFilter.html
CHANGED
data/rdoc/RubyXL/Border.html
CHANGED
data/rdoc/RubyXL/BorderEdge.html
CHANGED
data/rdoc/RubyXL/Borders.html
CHANGED
data/rdoc/RubyXL/Break.html
CHANGED