rubyXL-ptr 3.3.27
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +17 -0
- data/LICENSE.txt +20 -0
- data/README.rdoc +229 -0
- data/Rakefile +103 -0
- data/VERSION +1 -0
- data/lib/rubyXL.rb +12 -0
- data/lib/rubyXL/cell.rb +54 -0
- data/lib/rubyXL/convenience_methods.rb +1122 -0
- data/lib/rubyXL/objects/border.rb +74 -0
- data/lib/rubyXL/objects/calculation_chain.rb +31 -0
- data/lib/rubyXL/objects/cell_style.rb +65 -0
- data/lib/rubyXL/objects/chartsheet.rb +92 -0
- data/lib/rubyXL/objects/color.rb +27 -0
- data/lib/rubyXL/objects/column_range.rb +92 -0
- data/lib/rubyXL/objects/comments.rb +47 -0
- data/lib/rubyXL/objects/container_nodes.rb +135 -0
- data/lib/rubyXL/objects/content_types.rb +77 -0
- data/lib/rubyXL/objects/data_validation.rb +37 -0
- data/lib/rubyXL/objects/document_properties.rb +159 -0
- data/lib/rubyXL/objects/extensions.rb +40 -0
- data/lib/rubyXL/objects/external_links.rb +85 -0
- data/lib/rubyXL/objects/fill.rb +55 -0
- data/lib/rubyXL/objects/filters.rb +120 -0
- data/lib/rubyXL/objects/font.rb +48 -0
- data/lib/rubyXL/objects/formula.rb +24 -0
- data/lib/rubyXL/objects/ooxml_object.rb +460 -0
- data/lib/rubyXL/objects/reference.rb +110 -0
- data/lib/rubyXL/objects/relationships.rb +213 -0
- data/lib/rubyXL/objects/root.rb +86 -0
- data/lib/rubyXL/objects/shared_strings.rb +70 -0
- data/lib/rubyXL/objects/sheet_common.rb +51 -0
- data/lib/rubyXL/objects/sheet_data.rb +188 -0
- data/lib/rubyXL/objects/simple_types.rb +232 -0
- data/lib/rubyXL/objects/storage.rb +182 -0
- data/lib/rubyXL/objects/stylesheet.rb +232 -0
- data/lib/rubyXL/objects/text.rb +94 -0
- data/lib/rubyXL/objects/theme.rb +1716 -0
- data/lib/rubyXL/objects/workbook.rb +464 -0
- data/lib/rubyXL/objects/worksheet.rb +748 -0
- data/lib/rubyXL/parser.rb +29 -0
- data/lib/rubyXL/worksheet.rb +105 -0
- data/rdoc/README_rdoc.html +475 -0
- data/rdoc/RubyXL.html +598 -0
- data/rdoc/RubyXL/AExtension.html +223 -0
- data/rdoc/RubyXL/AExtensionStorageArea.html +103 -0
- data/rdoc/RubyXL/ActiveX.html +182 -0
- data/rdoc/RubyXL/ActiveXBinary.html +117 -0
- data/rdoc/RubyXL/AdjustHandleList.html +106 -0
- data/rdoc/RubyXL/Alignment.html +106 -0
- data/rdoc/RubyXL/AlternateContent.html +103 -0
- data/rdoc/RubyXL/Authors.html +106 -0
- data/rdoc/RubyXL/AutoFilter.html +106 -0
- data/rdoc/RubyXL/AutoFilterColumn.html +106 -0
- data/rdoc/RubyXL/BinaryImageFile.html +122 -0
- data/rdoc/RubyXL/BodyProperties.html +106 -0
- data/rdoc/RubyXL/BooleanNode.html +103 -0
- data/rdoc/RubyXL/BooleanValue.html +103 -0
- data/rdoc/RubyXL/Border.html +275 -0
- data/rdoc/RubyXL/BorderEdge.html +189 -0
- data/rdoc/RubyXL/Borders.html +157 -0
- data/rdoc/RubyXL/Break.html +106 -0
- data/rdoc/RubyXL/BreakList.html +106 -0
- data/rdoc/RubyXL/CT_AdjPoint2D.html +106 -0
- data/rdoc/RubyXL/CT_AlphaBiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaModulateFixedEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaOutsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_AlphaReplaceEffect.html +106 -0
- data/rdoc/RubyXL/CT_Backdrop.html +106 -0
- data/rdoc/RubyXL/CT_Bevel.html +106 -0
- data/rdoc/RubyXL/CT_BiLevelEffect.html +106 -0
- data/rdoc/RubyXL/CT_BlendEffect.html +106 -0
- data/rdoc/RubyXL/CT_Blip.html +106 -0
- data/rdoc/RubyXL/CT_BlipFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_BlurEffect.html +106 -0
- data/rdoc/RubyXL/CT_Camera.html +106 -0
- data/rdoc/RubyXL/CT_Color.html +106 -0
- data/rdoc/RubyXL/CT_ColorChangeEffect.html +106 -0
- data/rdoc/RubyXL/CT_ColorMapping.html +106 -0
- data/rdoc/RubyXL/CT_ColorScheme.html +106 -0
- data/rdoc/RubyXL/CT_ColorSchemeAndMapping.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSite.html +106 -0
- data/rdoc/RubyXL/CT_ConnectionSiteList.html +106 -0
- data/rdoc/RubyXL/CT_DashStop.html +106 -0
- data/rdoc/RubyXL/CT_DashStopList.html +106 -0
- data/rdoc/RubyXL/CT_DefaultShapeDefinition.html +106 -0
- data/rdoc/RubyXL/CT_DuotoneEffect.html +106 -0
- data/rdoc/RubyXL/CT_EffectContainer.html +106 -0
- data/rdoc/RubyXL/CT_EffectList.html +106 -0
- data/rdoc/RubyXL/CT_EffectReference.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleItem.html +106 -0
- data/rdoc/RubyXL/CT_EffectStyleList.html +106 -0
- data/rdoc/RubyXL/CT_EmbeddedWAVAudioFile.html +106 -0
- data/rdoc/RubyXL/CT_FillEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillOverlayEffect.html +106 -0
- data/rdoc/RubyXL/CT_FillStyleList.html +106 -0
- data/rdoc/RubyXL/CT_FlatText.html +106 -0
- data/rdoc/RubyXL/CT_FontCollection.html +106 -0
- data/rdoc/RubyXL/CT_FontReference.html +106 -0
- data/rdoc/RubyXL/CT_GeomGuideList.html +106 -0
- data/rdoc/RubyXL/CT_GlowEffect.html +106 -0
- data/rdoc/RubyXL/CT_GradientFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_GradientStop.html +106 -0
- data/rdoc/RubyXL/CT_GradientStopList.html +106 -0
- data/rdoc/RubyXL/CT_HSLEffect.html +106 -0
- data/rdoc/RubyXL/CT_HslColor.html +106 -0
- data/rdoc/RubyXL/CT_Hyperlink.html +106 -0
- data/rdoc/RubyXL/CT_InnerShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_LightRig.html +106 -0
- data/rdoc/RubyXL/CT_LineEndProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineJoinMiterProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineProperties.html +106 -0
- data/rdoc/RubyXL/CT_LineStyleList.html +106 -0
- data/rdoc/RubyXL/CT_LinearShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_LuminanceEffect.html +106 -0
- data/rdoc/RubyXL/CT_ObjectStyleDefaults.html +106 -0
- data/rdoc/RubyXL/CT_OuterShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_Path2D.html +106 -0
- data/rdoc/RubyXL/CT_Path2DArcTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DCubicBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DList.html +106 -0
- data/rdoc/RubyXL/CT_Path2DQuadBezierTo.html +106 -0
- data/rdoc/RubyXL/CT_Path2DTo.html +106 -0
- data/rdoc/RubyXL/CT_PathShadeProperties.html +106 -0
- data/rdoc/RubyXL/CT_PatternFillProperties.html +106 -0
- data/rdoc/RubyXL/CT_Point3D.html +106 -0
- data/rdoc/RubyXL/CT_PolarAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CT_PresetColor.html +106 -0
- data/rdoc/RubyXL/CT_PresetLineDashProperties.html +106 -0
- data/rdoc/RubyXL/CT_PresetShadowEffect.html +106 -0
- data/rdoc/RubyXL/CT_PresetTextShape.html +106 -0
- data/rdoc/RubyXL/CT_ReflectionEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeOffsetEffect.html +106 -0
- data/rdoc/RubyXL/CT_RelativeRect.html +106 -0
- data/rdoc/RubyXL/CT_SRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_ScRgbColor.html +106 -0
- data/rdoc/RubyXL/CT_Scene3D.html +106 -0
- data/rdoc/RubyXL/CT_SchemeColor.html +106 -0
- data/rdoc/RubyXL/CT_Shape3D.html +106 -0
- data/rdoc/RubyXL/CT_ShapeStyle.html +106 -0
- data/rdoc/RubyXL/CT_SoftEdgesEffect.html +106 -0
- data/rdoc/RubyXL/CT_SphereCoords.html +106 -0
- data/rdoc/RubyXL/CT_StretchInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrix.html +106 -0
- data/rdoc/RubyXL/CT_StyleMatrixReference.html +106 -0
- data/rdoc/RubyXL/CT_SupplementalFont.html +106 -0
- data/rdoc/RubyXL/CT_SystemColor.html +106 -0
- data/rdoc/RubyXL/CT_TextAutonumberBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextBlipBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharBullet.html +106 -0
- data/rdoc/RubyXL/CT_TextCharacterProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextFont.html +106 -0
- data/rdoc/RubyXL/CT_TextListStyle.html +106 -0
- data/rdoc/RubyXL/CT_TextNormalAutofit.html +106 -0
- data/rdoc/RubyXL/CT_TextParagraphProperties.html +106 -0
- data/rdoc/RubyXL/CT_TextSpacing.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStop.html +106 -0
- data/rdoc/RubyXL/CT_TextTabStopList.html +106 -0
- data/rdoc/RubyXL/CT_TileInfoProperties.html +106 -0
- data/rdoc/RubyXL/CT_TintEffect.html +106 -0
- data/rdoc/RubyXL/CT_Transform2D.html +106 -0
- data/rdoc/RubyXL/CT_TransformEffect.html +106 -0
- data/rdoc/RubyXL/CT_Vector3D.html +106 -0
- data/rdoc/RubyXL/CT_XYAdjustHandle.html +106 -0
- data/rdoc/RubyXL/CalculationChain.html +176 -0
- data/rdoc/RubyXL/CalculationChainCell.html +106 -0
- data/rdoc/RubyXL/CalculationProperties.html +106 -0
- data/rdoc/RubyXL/Cell.html +558 -0
- data/rdoc/RubyXL/CellConvenienceMethods.html +1211 -0
- data/rdoc/RubyXL/CellExt.html +106 -0
- data/rdoc/RubyXL/CellSmartTag.html +106 -0
- data/rdoc/RubyXL/CellSmartTagProperty.html +106 -0
- data/rdoc/RubyXL/CellSmartTags.html +106 -0
- data/rdoc/RubyXL/CellStyle.html +106 -0
- data/rdoc/RubyXL/CellStyleXFs.html +157 -0
- data/rdoc/RubyXL/CellStyles.html +157 -0
- data/rdoc/RubyXL/CellValue.html +158 -0
- data/rdoc/RubyXL/CellWatch.html +106 -0
- data/rdoc/RubyXL/CellWatches.html +106 -0
- data/rdoc/RubyXL/CellXFs.html +161 -0
- data/rdoc/RubyXL/ChartColorsFile.html +122 -0
- data/rdoc/RubyXL/ChartFile.html +189 -0
- data/rdoc/RubyXL/ChartStyleFile.html +122 -0
- data/rdoc/RubyXL/ChartUserShapesFile.html +122 -0
- data/rdoc/RubyXL/Chartsheet.html +260 -0
- data/rdoc/RubyXL/ChartsheetPageSetup.html +106 -0
- data/rdoc/RubyXL/ChartsheetProperties.html +106 -0
- data/rdoc/RubyXL/ChartsheetProtection.html +106 -0
- data/rdoc/RubyXL/ChartsheetView.html +106 -0
- data/rdoc/RubyXL/ChartsheetViews.html +106 -0
- data/rdoc/RubyXL/Color.html +175 -0
- data/rdoc/RubyXL/ColorFilter.html +106 -0
- data/rdoc/RubyXL/ColorScale.html +106 -0
- data/rdoc/RubyXL/ColorSet.html +106 -0
- data/rdoc/RubyXL/Colors.html +106 -0
- data/rdoc/RubyXL/ColumnRange.html +245 -0
- data/rdoc/RubyXL/ColumnRanges.html +289 -0
- data/rdoc/RubyXL/Comment.html +106 -0
- data/rdoc/RubyXL/CommentList.html +106 -0
- data/rdoc/RubyXL/CommentsFile.html +197 -0
- data/rdoc/RubyXL/ConditionalFormatValue.html +106 -0
- data/rdoc/RubyXL/ConditionalFormatting.html +106 -0
- data/rdoc/RubyXL/ConditionalFormattingRule.html +106 -0
- data/rdoc/RubyXL/ContentTypeDefault.html +103 -0
- data/rdoc/RubyXL/ContentTypeOverride.html +103 -0
- data/rdoc/RubyXL/ContentTypes.html +248 -0
- data/rdoc/RubyXL/ControlPropertiesFile.html +117 -0
- data/rdoc/RubyXL/CorePropertiesFile.html +474 -0
- data/rdoc/RubyXL/CustomColor.html +106 -0
- data/rdoc/RubyXL/CustomColorList.html +106 -0
- data/rdoc/RubyXL/CustomFilter.html +106 -0
- data/rdoc/RubyXL/CustomFilters.html +106 -0
- data/rdoc/RubyXL/CustomGeometry.html +106 -0
- data/rdoc/RubyXL/CustomProperties.html +106 -0
- data/rdoc/RubyXL/CustomPropertiesFile.html +122 -0
- data/rdoc/RubyXL/CustomProperty.html +106 -0
- data/rdoc/RubyXL/CustomSheetView.html +106 -0
- data/rdoc/RubyXL/CustomSheetViews.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookView.html +106 -0
- data/rdoc/RubyXL/CustomWorkbookViews.html +106 -0
- data/rdoc/RubyXL/CustomXMLFile.html +117 -0
- data/rdoc/RubyXL/DXF.html +106 -0
- data/rdoc/RubyXL/DXFs.html +106 -0
- data/rdoc/RubyXL/DataBar.html +106 -0
- data/rdoc/RubyXL/DataConsolidate.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReference.html +106 -0
- data/rdoc/RubyXL/DataConsolidationReferences.html +106 -0
- data/rdoc/RubyXL/DataType.html +143 -0
- data/rdoc/RubyXL/DataValidation.html +106 -0
- data/rdoc/RubyXL/DataValidations.html +106 -0
- data/rdoc/RubyXL/DateGroupItem.html +106 -0
- data/rdoc/RubyXL/DefinedName.html +106 -0
- data/rdoc/RubyXL/DefinedNameExt.html +106 -0
- data/rdoc/RubyXL/DefinedNames.html +106 -0
- data/rdoc/RubyXL/DefinedNamesExt.html +106 -0
- data/rdoc/RubyXL/DocumentPropertiesFile.html +255 -0
- data/rdoc/RubyXL/DrawingFile.html +188 -0
- data/rdoc/RubyXL/DynamicFilter.html +106 -0
- data/rdoc/RubyXL/EmbeddedControl.html +106 -0
- data/rdoc/RubyXL/EmbeddedControls.html +106 -0
- data/rdoc/RubyXL/Extension.html +106 -0
- data/rdoc/RubyXL/ExtensionStorageArea.html +106 -0
- data/rdoc/RubyXL/Extents.html +106 -0
- data/rdoc/RubyXL/ExternalBook.html +106 -0
- data/rdoc/RubyXL/ExternalLinksFile.html +184 -0
- data/rdoc/RubyXL/ExternalReference.html +106 -0
- data/rdoc/RubyXL/ExternalReferences.html +106 -0
- data/rdoc/RubyXL/ExtraColorSchemeList.html +106 -0
- data/rdoc/RubyXL/FieldItem.html +106 -0
- data/rdoc/RubyXL/FileRecoveryProperties.html +106 -0
- data/rdoc/RubyXL/FileSharing.html +106 -0
- data/rdoc/RubyXL/FileVersion.html +106 -0
- data/rdoc/RubyXL/Fill.html +157 -0
- data/rdoc/RubyXL/Fills.html +157 -0
- data/rdoc/RubyXL/FilterContainer.html +106 -0
- data/rdoc/RubyXL/FloatNode.html +103 -0
- data/rdoc/RubyXL/FloatValue.html +103 -0
- data/rdoc/RubyXL/Font.html +184 -0
- data/rdoc/RubyXL/FontConvenienceMethods.html +603 -0
- data/rdoc/RubyXL/FontScheme.html +106 -0
- data/rdoc/RubyXL/Fonts.html +157 -0
- data/rdoc/RubyXL/Formula.html +106 -0
- data/rdoc/RubyXL/FunctionGroup.html +106 -0
- data/rdoc/RubyXL/FunctionGroups.html +106 -0
- data/rdoc/RubyXL/GenericStorageObject.html +298 -0
- data/rdoc/RubyXL/GradientFill.html +106 -0
- data/rdoc/RubyXL/HeaderFooterSettings.html +106 -0
- data/rdoc/RubyXL/Hyperlink.html +106 -0
- data/rdoc/RubyXL/HyperlinkRelFile.html +117 -0
- data/rdoc/RubyXL/Hyperlinks.html +106 -0
- data/rdoc/RubyXL/IconFilter.html +106 -0
- data/rdoc/RubyXL/IconSet.html +106 -0
- data/rdoc/RubyXL/IgnoredError.html +106 -0
- data/rdoc/RubyXL/IgnoredErrors.html +106 -0
- data/rdoc/RubyXL/IndexedColors.html +106 -0
- data/rdoc/RubyXL/InputCells.html +106 -0
- data/rdoc/RubyXL/IntegerNode.html +103 -0
- data/rdoc/RubyXL/IntegerValue.html +103 -0
- data/rdoc/RubyXL/LegacyCell.html +181 -0
- data/rdoc/RubyXL/LegacyWorksheet.html +355 -0
- data/rdoc/RubyXL/MRUColors.html +106 -0
- data/rdoc/RubyXL/MacrosFile.html +122 -0
- data/rdoc/RubyXL/MergedCell.html +106 -0
- data/rdoc/RubyXL/MergedCells.html +106 -0
- data/rdoc/RubyXL/NumFmt.html +106 -0
- data/rdoc/RubyXL/NumberFormat.html +158 -0
- data/rdoc/RubyXL/NumberFormats.html +172 -0
- data/rdoc/RubyXL/OLEObject.html +106 -0
- data/rdoc/RubyXL/OLEObjectFile.html +122 -0
- data/rdoc/RubyXL/OLEObjects.html +106 -0
- data/rdoc/RubyXL/OLESize.html +106 -0
- data/rdoc/RubyXL/OOXMLContainerObject.html +394 -0
- data/rdoc/RubyXL/OOXMLObject.html +118 -0
- data/rdoc/RubyXL/OOXMLObjectClassMethods.html +532 -0
- data/rdoc/RubyXL/OOXMLObjectInstanceMethods.html +564 -0
- data/rdoc/RubyXL/OOXMLRelationshipsFile.html +603 -0
- data/rdoc/RubyXL/OOXMLTopLevelObject.html +384 -0
- data/rdoc/RubyXL/Offset.html +106 -0
- data/rdoc/RubyXL/OutlineProperties.html +106 -0
- data/rdoc/RubyXL/PageMargins.html +106 -0
- data/rdoc/RubyXL/PageSetup.html +106 -0
- data/rdoc/RubyXL/PageSetupProperties.html +106 -0
- data/rdoc/RubyXL/Pane.html +106 -0
- data/rdoc/RubyXL/Parser.html +204 -0
- data/rdoc/RubyXL/PatternFill.html +106 -0
- data/rdoc/RubyXL/PhoneticProperties.html +106 -0
- data/rdoc/RubyXL/PhoneticRun.html +106 -0
- data/rdoc/RubyXL/PivotArea.html +106 -0
- data/rdoc/RubyXL/PivotCache.html +106 -0
- data/rdoc/RubyXL/PivotCacheDefinitionFile.html +133 -0
- data/rdoc/RubyXL/PivotCacheRecordsFile.html +122 -0
- data/rdoc/RubyXL/PivotCaches.html +106 -0
- data/rdoc/RubyXL/PivotReference.html +106 -0
- data/rdoc/RubyXL/PivotReferences.html +106 -0
- data/rdoc/RubyXL/PivotTableFile.html +133 -0
- data/rdoc/RubyXL/PivotTableSelection.html +106 -0
- data/rdoc/RubyXL/PresetGeometry.html +106 -0
- data/rdoc/RubyXL/PrintOptions.html +106 -0
- data/rdoc/RubyXL/PrinterSettingsFile.html +122 -0
- data/rdoc/RubyXL/ProtectedRange.html +106 -0
- data/rdoc/RubyXL/ProtectedRanges.html +106 -0
- data/rdoc/RubyXL/Protection.html +106 -0
- data/rdoc/RubyXL/RID.html +103 -0
- data/rdoc/RubyXL/RawOOXML.html +223 -0
- data/rdoc/RubyXL/Reference.html +640 -0
- data/rdoc/RubyXL/Relationship.html +103 -0
- data/rdoc/RubyXL/RelationshipSupport.html +419 -0
- data/rdoc/RubyXL/RelationshipSupport/ClassMehods.html +148 -0
- data/rdoc/RubyXL/RichText.html +159 -0
- data/rdoc/RubyXL/RichTextRun.html +157 -0
- data/rdoc/RubyXL/Row.html +439 -0
- data/rdoc/RubyXL/RowExt.html +106 -0
- data/rdoc/RubyXL/RunProperties.html +106 -0
- data/rdoc/RubyXL/Scenario.html +106 -0
- data/rdoc/RubyXL/Scenarios.html +106 -0
- data/rdoc/RubyXL/Selection.html +165 -0
- data/rdoc/RubyXL/ShapeGuide.html +106 -0
- data/rdoc/RubyXL/ShapeTextRectangle.html +106 -0
- data/rdoc/RubyXL/SharedStringsTable.html +424 -0
- data/rdoc/RubyXL/Sheet.html +106 -0
- data/rdoc/RubyXL/SheetCalculationProperties.html +106 -0
- data/rdoc/RubyXL/SheetData.html +192 -0
- data/rdoc/RubyXL/SheetDataExt.html +106 -0
- data/rdoc/RubyXL/SheetDataSet.html +106 -0
- data/rdoc/RubyXL/SheetName.html +106 -0
- data/rdoc/RubyXL/SheetNames.html +106 -0
- data/rdoc/RubyXL/Sheets.html +106 -0
- data/rdoc/RubyXL/SlicerCacheFile.html +122 -0
- data/rdoc/RubyXL/SlicerFile.html +122 -0
- data/rdoc/RubyXL/SmartTagProperties.html +106 -0
- data/rdoc/RubyXL/SmartTagType.html +106 -0
- data/rdoc/RubyXL/SmartTagTypes.html +106 -0
- data/rdoc/RubyXL/SmartTags.html +106 -0
- data/rdoc/RubyXL/SortCondition.html +106 -0
- data/rdoc/RubyXL/SortState.html +106 -0
- data/rdoc/RubyXL/Sqref.html +197 -0
- data/rdoc/RubyXL/Stop.html +106 -0
- data/rdoc/RubyXL/StringNode.html +103 -0
- data/rdoc/RubyXL/StringNodeW3C.html +197 -0
- data/rdoc/RubyXL/StringValue.html +103 -0
- data/rdoc/RubyXL/Stylesheet.html +354 -0
- data/rdoc/RubyXL/TableFile.html +122 -0
- data/rdoc/RubyXL/TableParts.html +103 -0
- data/rdoc/RubyXL/TableStyle.html +106 -0
- data/rdoc/RubyXL/TableStyles.html +106 -0
- data/rdoc/RubyXL/Text.html +216 -0
- data/rdoc/RubyXL/Theme.html +535 -0
- data/rdoc/RubyXL/ThemeElements.html +106 -0
- data/rdoc/RubyXL/ThumbnailFile.html +122 -0
- data/rdoc/RubyXL/Top10.html +106 -0
- data/rdoc/RubyXL/VMLDrawingFile.html +134 -0
- data/rdoc/RubyXL/Variant.html +106 -0
- data/rdoc/RubyXL/Vector.html +161 -0
- data/rdoc/RubyXL/VectorValue.html +103 -0
- data/rdoc/RubyXL/VisualProperties.html +106 -0
- data/rdoc/RubyXL/WebPublishObject.html +106 -0
- data/rdoc/RubyXL/WebPublishObjects.html +106 -0
- data/rdoc/RubyXL/WebPublishingItem.html +106 -0
- data/rdoc/RubyXL/WebPublishingItems.html +106 -0
- data/rdoc/RubyXL/WebPublishingProperties.html +106 -0
- data/rdoc/RubyXL/Workbook.html +633 -0
- data/rdoc/RubyXL/WorkbookConvenienceMethods.html +1321 -0
- data/rdoc/RubyXL/WorkbookProperties.html +106 -0
- data/rdoc/RubyXL/WorkbookProtection.html +106 -0
- data/rdoc/RubyXL/WorkbookRoot.html +402 -0
- data/rdoc/RubyXL/WorkbookView.html +106 -0
- data/rdoc/RubyXL/WorkbookViews.html +106 -0
- data/rdoc/RubyXL/Worksheet.html +433 -0
- data/rdoc/RubyXL/WorksheetConvenienceMethods.html +2861 -0
- data/rdoc/RubyXL/WorksheetDimensions.html +106 -0
- data/rdoc/RubyXL/WorksheetFormatProperties.html +103 -0
- data/rdoc/RubyXL/WorksheetProperties.html +106 -0
- data/rdoc/RubyXL/WorksheetProtection.html +106 -0
- data/rdoc/RubyXL/WorksheetView.html +106 -0
- data/rdoc/RubyXL/WorksheetViews.html +106 -0
- data/rdoc/RubyXL/XF.html +106 -0
- data/rdoc/created.rid +38 -0
- data/rdoc/css/fonts.css +167 -0
- data/rdoc/css/rdoc.css +590 -0
- data/rdoc/fonts/Lato-Light.ttf +0 -0
- data/rdoc/fonts/Lato-LightItalic.ttf +0 -0
- data/rdoc/fonts/Lato-Regular.ttf +0 -0
- data/rdoc/fonts/Lato-RegularItalic.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Bold.ttf +0 -0
- data/rdoc/fonts/SourceCodePro-Regular.ttf +0 -0
- data/rdoc/images/add.png +0 -0
- data/rdoc/images/arrow_up.png +0 -0
- data/rdoc/images/brick.png +0 -0
- data/rdoc/images/brick_link.png +0 -0
- data/rdoc/images/bug.png +0 -0
- data/rdoc/images/bullet_black.png +0 -0
- data/rdoc/images/bullet_toggle_minus.png +0 -0
- data/rdoc/images/bullet_toggle_plus.png +0 -0
- data/rdoc/images/date.png +0 -0
- data/rdoc/images/delete.png +0 -0
- data/rdoc/images/find.png +0 -0
- data/rdoc/images/loadingAnimation.gif +0 -0
- data/rdoc/images/macFFBgHack.png +0 -0
- data/rdoc/images/package.png +0 -0
- data/rdoc/images/page_green.png +0 -0
- data/rdoc/images/page_white_text.png +0 -0
- data/rdoc/images/page_white_width.png +0 -0
- data/rdoc/images/plugin.png +0 -0
- data/rdoc/images/ruby.png +0 -0
- data/rdoc/images/tag_blue.png +0 -0
- data/rdoc/images/tag_green.png +0 -0
- data/rdoc/images/transparent.png +0 -0
- data/rdoc/images/wrench.png +0 -0
- data/rdoc/images/wrench_orange.png +0 -0
- data/rdoc/images/zoom.png +0 -0
- data/rdoc/index.html +796 -0
- data/rdoc/js/darkfish.js +161 -0
- data/rdoc/js/jquery.js +4 -0
- data/rdoc/js/navigation.js +142 -0
- data/rdoc/js/navigation.js.gz +0 -0
- data/rdoc/js/search.js +109 -0
- data/rdoc/js/search_index.js +1 -0
- data/rdoc/js/search_index.js.gz +0 -0
- data/rdoc/js/searcher.js +229 -0
- data/rdoc/js/searcher.js.gz +0 -0
- data/rdoc/table_of_contents.html +2758 -0
- data/rubyXL.gemspec +516 -0
- data/spec/lib/cell_spec.rb +515 -0
- data/spec/lib/color_spec.rb +13 -0
- data/spec/lib/parser_spec.rb +118 -0
- data/spec/lib/reference_spec.rb +28 -0
- data/spec/lib/stylesheet_spec.rb +28 -0
- data/spec/lib/text_spec.rb +29 -0
- data/spec/lib/workbook_spec.rb +174 -0
- data/spec/lib/worksheet_spec.rb +1363 -0
- data/spec/spec_helper.rb +11 -0
- data/test/input/.gitkeep +0 -0
- data/test/output/.gitkeep +0 -0
- data/test/test_parse_write.rb +15 -0
- data/tmp/.gitignore +1 -0
- metadata +615 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 30a36596ed8d8dfa9567aac3b553e8064e7ca2c92ac2e842181750cdb6941786
|
4
|
+
data.tar.gz: e4d7b19f3b41b69db294c2575e4a4cfc02295d233171f9b2c6268fc1a3c63099
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 5a8b08b0d5a933878b0b0b8bbcecedec7b2b494800d7db4c29bdbd6a2f0a61261e589d4f3a9043fc9bfbebc733ac95c209f9fc68948a87c316da96b41099f0f4
|
7
|
+
data.tar.gz: e1f349b09c5c1fe8b6fb26af2ca101cffb7ea3e5a60f3c1aee8dae5cc445308b1e6adb587e1fb92fa5a4f934b163bd700202c06aecc7d2153dd7acb57a0118c4
|
data/Gemfile
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
source "http://rubygems.org"
|
2
|
+
|
3
|
+
# Dependencies required to run this gem.
|
4
|
+
gem "nokogiri", ">= 1.4.4"
|
5
|
+
gem "rubyzip", ">= 1.1.6" , :require => 'zip'
|
6
|
+
|
7
|
+
# Development dependencies.
|
8
|
+
group :development, :test do
|
9
|
+
gem "bundler"
|
10
|
+
gem "rake"
|
11
|
+
gem "jeweler"
|
12
|
+
gem "rspec"
|
13
|
+
gem "simplecov"
|
14
|
+
|
15
|
+
# gem 'stackprof'
|
16
|
+
gem 'ruby-prof'
|
17
|
+
end
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 Vivek Bhagwat, 2013-2014 Wesha
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.rdoc
ADDED
@@ -0,0 +1,229 @@
|
|
1
|
+
= rubyXL
|
2
|
+
{<img src="https://badge.fury.io/rb/rubyXL.svg" alt="Gem Version" />}[http://badge.fury.io/rb/rubyXL]
|
3
|
+
{<img src="https://codeclimate.com/github/weshatheleopard/rubyXL.png" alt="Code Climate" />}[https://codeclimate.com/github/weshatheleopard/rubyXL]
|
4
|
+
|
5
|
+
This gem supports operating on +xlsx+ files (Open XML format). While it is capable
|
6
|
+
of properly parsing the entire OOXML structure, its current main emphasis is on
|
7
|
+
reading files produced by MS Excel, making minor modifications to them and saving
|
8
|
+
them to be opened again, while preserving as much of the structure as possible.
|
9
|
+
|
10
|
+
Please note that proprietary binary +xls+ format is *not* supported.
|
11
|
+
|
12
|
+
== To Install:
|
13
|
+
gem install rubyXL
|
14
|
+
|
15
|
+
== To Use:
|
16
|
+
require 'rubyXL' # Assuming rubygems is already required
|
17
|
+
|
18
|
+
=== Parsing an existing workbook
|
19
|
+
workbook = RubyXL::Parser.parse("path/to/Excel/file.xlsx")
|
20
|
+
|
21
|
+
=== Creating a new Workbook
|
22
|
+
workbook = RubyXL::Workbook.new
|
23
|
+
|
24
|
+
=== Accessing
|
25
|
+
|
26
|
+
==== Accessing a Worksheet
|
27
|
+
workbook.worksheets[0] # Returns first worksheet
|
28
|
+
workbook[0] # Returns first worksheet
|
29
|
+
workbook['Sheet1'] # Finds and returns worksheet titled "Sheet1"
|
30
|
+
|
31
|
+
==== Accessing a Row (Array of Cells)
|
32
|
+
Please note that worksheet is a _sparse_ array of rows. Your code *must* expect that any row it plucks from the array may be <tt>nil</tt>.
|
33
|
+
|
34
|
+
worksheet = workbook[0]
|
35
|
+
worksheet.sheet_data[0] # Returns first row of the worksheet
|
36
|
+
worksheet[0] # Returns first row of the worksheet
|
37
|
+
|
38
|
+
==== Accessing a Cell object
|
39
|
+
Please note that row is a _sparse_ array of cells. Your code *must* expect that any cell it plucks from the array may be <tt>nil</tt>.
|
40
|
+
|
41
|
+
worksheet = workbook[0]
|
42
|
+
worksheet.sheet_data[0][0] # Returns cell A1 in the worksheet
|
43
|
+
worksheet[0][0] # Returns cell A1 in the worksheet
|
44
|
+
|
45
|
+
==== Wrappers for accessing Cell properties
|
46
|
+
cell = workbook[0][0][0]
|
47
|
+
cell.is_struckthrough # Returns +true+ if the cell is struckthrough, other boolean properties have same syntax
|
48
|
+
cell.font_name
|
49
|
+
cell.font_size
|
50
|
+
cell.font_color
|
51
|
+
cell.fill_color
|
52
|
+
cell.horizontal_alignment
|
53
|
+
cell.vertical_alignment
|
54
|
+
cell.get_border(:top)
|
55
|
+
cell.get_border_color(:top)
|
56
|
+
|
57
|
+
==== Wrappers for accessing Row properties
|
58
|
+
Please note: these methods are being phased out in favor of the OOXML object model.
|
59
|
+
worksheet = workbook[0]
|
60
|
+
worksheet.get_row_fill(0)
|
61
|
+
worksheet.get_row_font_name(0)
|
62
|
+
worksheet.get_row_font_size(0)
|
63
|
+
worksheet.get_row_font_color(0)
|
64
|
+
worksheet.is_row_underlined(0)
|
65
|
+
worksheet.get_row_height(0)
|
66
|
+
worksheet.get_row_alignment(0, true)
|
67
|
+
worksheet.get_row_alignment(0, false)
|
68
|
+
worksheet.get_row_border(0, :right)
|
69
|
+
worksheet.get_row_border_color(0, :right)
|
70
|
+
|
71
|
+
==== Accessing column properties
|
72
|
+
Please note: these methods are being phased out in favor of the OOXML object model.
|
73
|
+
worksheet = workbook[0]
|
74
|
+
worksheet.get_column_fill(0)
|
75
|
+
worksheet.get_column_font_name(0)
|
76
|
+
worksheet.get_column_font_size(0)
|
77
|
+
worksheet.get_column_font_color(0)
|
78
|
+
worksheet.is_column_underlined(0)
|
79
|
+
worksheet.get_column_width(0)
|
80
|
+
worksheet.get_column_alignment(0, :horizontal)
|
81
|
+
worksheet.get_column_alignment(0, :vertical)
|
82
|
+
worksheet.get_column_border(0, :right)
|
83
|
+
worksheet.get_column_border_color(0, :right)
|
84
|
+
|
85
|
+
==== Table reading
|
86
|
+
In order to discourage unnecessary reshuffling of data in memory, methods +extract_data+ and +get_table+ are being deprecated. You should access and iterate through rows and cells directly:
|
87
|
+
|
88
|
+
worksheet.each { |row|
|
89
|
+
row && row.cells.each { |cell|
|
90
|
+
val = cell && cell.value
|
91
|
+
do_whatever_you_want(val)
|
92
|
+
}
|
93
|
+
}
|
94
|
+
|
95
|
+
=== Modifying
|
96
|
+
|
97
|
+
==== Adding Worksheets
|
98
|
+
worksheet = workbook.add_worksheet('Sheet2')
|
99
|
+
|
100
|
+
==== Renaming Worksheets
|
101
|
+
worksheet.sheet_name = 'Cool New Name'
|
102
|
+
|
103
|
+
==== Adding Cells
|
104
|
+
worksheet.add_cell(0, 0, 'A1') # Sets cell A1 to string "A1"
|
105
|
+
worksheet.add_cell(0, 1, '', 'A1') # Sets formula in the cell B1 to '=A1'
|
106
|
+
|
107
|
+
==== Changing Cells
|
108
|
+
worksheet[0][0].change_contents("", worksheet[0][0].formula) # Sets value of cell A1 to empty string, preserves formula
|
109
|
+
|
110
|
+
==== Changing Fonts
|
111
|
+
worksheet.sheet_data[0][0].change_font_bold(true) # Makes A1 bold
|
112
|
+
worksheet.change_row_italics(0,true) # Makes first row italicized
|
113
|
+
worksheet.change_column_font_name(0, 'Courier') # Makes first column have font Courier
|
114
|
+
|
115
|
+
==== Changing Fills
|
116
|
+
worksheet.sheet_data[0][0].change_fill('0ba53d') # Sets A1 to have fill #0ba53d
|
117
|
+
worksheet.change_row_fill(0, '0ba53d') # Sets first row to have fill #0ba53d
|
118
|
+
worksheet.change_column_fill(0, '0ba53d') # Sets first column to have fill #0ba53d
|
119
|
+
|
120
|
+
==== Changing Borders
|
121
|
+
# Possible weights: hairline, thin, medium, thick
|
122
|
+
# Possible "directions": top, bottom, left, right, diagonal
|
123
|
+
worksheet.sheet_data[0][0].change_border(:top, 'thin') # Sets A1 to have a top, thin border
|
124
|
+
worksheet.change_row_border(0, :left, 'hairline') # Sets first row to have a left, hairline border
|
125
|
+
worksheet.change_column_border(0, :diagonal, 'medium') # Sets first column to have diagonal, medium border
|
126
|
+
|
127
|
+
# Set the border style first so there's something to color.
|
128
|
+
worksheet.change_row_border_color(0, :top, '0ba53d') # Sets first row to have a green top border
|
129
|
+
worksheet.change_column_border_color(0, :top, '0ba53d') # Sets first column to have a green top border
|
130
|
+
|
131
|
+
==== Changing Alignment
|
132
|
+
===== Horizontal
|
133
|
+
center, distributed, justify, left, right
|
134
|
+
worksheet.sheet_data[0][0].change_horizontal_alignment('center') # Sets A1 to be centered
|
135
|
+
worksheet.change_row_horizontal_alignment(0, 'justify') # Sets first row to be justified
|
136
|
+
worksheet.change_column_horizontal_alignment(0, 'right') # Sets first column to be right-aligned
|
137
|
+
|
138
|
+
===== Vertical
|
139
|
+
bottom, center, distributed, top
|
140
|
+
worksheet.sheet_data[0][0].change_vertical_alignment('bottom') # Sets A1 to be bottom aligned
|
141
|
+
worksheet.change_row_vertical_alignment(0, 'distributed') # Sets first row to be distributed vertically
|
142
|
+
worksheet.change_column_vertical_alignment(0, 'top') # Sets first column to be top aligned
|
143
|
+
|
144
|
+
==== Changing Row Height
|
145
|
+
worksheet.change_row_height(0, 30) # Sets first row height to 30
|
146
|
+
|
147
|
+
==== Changing Column Width
|
148
|
+
worksheet.change_column_width(0, 30) # Sets first column width to 30
|
149
|
+
|
150
|
+
==== Merging Cells
|
151
|
+
worksheet.merge_cells(0, 0, 1, 1) # Merges A1:B2
|
152
|
+
|
153
|
+
==== Insert Row
|
154
|
+
This method will insert a row at specified index, pushing all rows below it down. It also copies styles from row above.
|
155
|
+
|
156
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted rows
|
157
|
+
worksheet.insert_row(1)
|
158
|
+
|
159
|
+
==== Insert Column
|
160
|
+
This method will insert a column at specified index, pushing all columns to the right of it one to the right. It also copies styles from column to the left
|
161
|
+
|
162
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted columns
|
163
|
+
worksheet.insert_column(1)
|
164
|
+
|
165
|
+
==== Delete Row
|
166
|
+
This method will delete a row at specified index, pushing all rows below it up.
|
167
|
+
|
168
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted rows
|
169
|
+
worksheet.delete_row(1)
|
170
|
+
|
171
|
+
==== Delete Column
|
172
|
+
This method will delete a column at specified index, pushing all columns to the right of it left.
|
173
|
+
|
174
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted columns
|
175
|
+
worksheet.delete_column(1)
|
176
|
+
|
177
|
+
==== Insert Cell
|
178
|
+
This method will insert a cell at specified position. It takes a :right or :down option, to shift cells either left or down upon inserting (nil means replacing the cell)
|
179
|
+
|
180
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted cells
|
181
|
+
worksheet.insert_cell(0, 0, "blah", formula = nil, :right) # Inserts cell at A1, shifts cells in first row right
|
182
|
+
worksheet.insert_cell(0, 0, "blah", formula = nil, :down) # Inserts cell at A1, shifts cells in first column down
|
183
|
+
worksheet.insert_cell(0, 0, "blah") # Inserts cell at A1, shifts nothing
|
184
|
+
|
185
|
+
==== Delete Cell
|
186
|
+
This method will delete a cell at specified position. It takes a :left or :up option, to shift cells either up or left upon deletion (nil means simply deleting the cell contents)
|
187
|
+
|
188
|
+
WARNING: Use of this method WILL break formulas referencing cells which have been moved, as the formulas do not adapt to the shifted cells
|
189
|
+
worksheet.delete_cell(0, 0, :left) # Deletes A1, shifts contents of first row left
|
190
|
+
worksheet.delete_cell(0, 0, :up) # Deletes A1, shifts contents of first column up
|
191
|
+
worksheet.delete_cell(0, 0) # Deletes A1, does not shift cells
|
192
|
+
|
193
|
+
==== Modifying Cell Format
|
194
|
+
cell = worksheet[0][0]
|
195
|
+
cell.set_number_format '0.0000%' # For formats, see https://support.office.com/en-us/article/5026bbd6-04bc-48cd-bf33-80f18b4eae68
|
196
|
+
|
197
|
+
== I/O
|
198
|
+
|
199
|
+
By default, the gem operates with files on the local filesystem:
|
200
|
+
|
201
|
+
workbook = RubyXL::Parser.parse("path/to/Excel/file.xlsx")
|
202
|
+
workbook.write("path/to/desired/Excel/file.xlsx")
|
203
|
+
|
204
|
+
It can also operate on +StringIO+ objects, thus eliminating the need to save the +xlsx+ file to disk. This capability comes in handy for web servers.
|
205
|
+
|
206
|
+
workbook = RubyXL::Parser.parse_buffer(buffer)
|
207
|
+
workbook.stream
|
208
|
+
|
209
|
+
== Miscellaneous
|
210
|
+
RubyXL::Reference.ind2ref(0,0) == 'A1' # Converts row and column index to Excel-style cell reference
|
211
|
+
RubyXL::Reference.ref2ind('A1') == [0, 0] # Converts Excel-style cell reference to row and column index
|
212
|
+
|
213
|
+
== For more information
|
214
|
+
Take a look at the files in spec/lib/ for rspecs on most methods
|
215
|
+
|
216
|
+
== Contributing to rubyXL
|
217
|
+
|
218
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
219
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
220
|
+
* Fork the project
|
221
|
+
* Start a feature/bugfix branch
|
222
|
+
* Commit and push until you are happy with your contribution
|
223
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
224
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
225
|
+
|
226
|
+
== Copyright
|
227
|
+
|
228
|
+
Copyright (c) 2011 Vivek Bhagwat, 2013-2016 Wesha.
|
229
|
+
See LICENSE.txt for further details.
|
data/Rakefile
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
require 'rubygems'
|
3
|
+
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
|
13
|
+
require 'jeweler'
|
14
|
+
Jeweler::Tasks.new do |gem|
|
15
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
16
|
+
gem.name = "rubyXL"
|
17
|
+
gem.homepage = "http://github.com/gilt/rubyXL"
|
18
|
+
gem.license = "MIT"
|
19
|
+
gem.summary = %Q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
|
20
|
+
gem.description = %Q{rubyXL is a gem which allows the parsing, creation, and manipulation of Microsoft Excel (.xlsx/.xlsm) Documents}
|
21
|
+
gem.email = "bhagwat.vivek@gmail.com"
|
22
|
+
gem.authors = ["Vivek Bhagwat", 'Wesha']
|
23
|
+
# dependencies defined in Gemfile
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
require 'rake/testtask'
|
28
|
+
Rake::TestTask.new(:test) do |test|
|
29
|
+
test.libs << 'lib' << 'test'
|
30
|
+
test.pattern = 'test/**/test_*.rb'
|
31
|
+
test.verbose = true
|
32
|
+
test.warning = true
|
33
|
+
end
|
34
|
+
|
35
|
+
require 'rspec/core/rake_task'
|
36
|
+
RSpec::Core::RakeTask.new(:spec)
|
37
|
+
task :default => :spec
|
38
|
+
|
39
|
+
require 'rdoc/task'
|
40
|
+
Rake::RDocTask.new do |rdoc|
|
41
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
42
|
+
|
43
|
+
rdoc.rdoc_dir = 'rdoc'
|
44
|
+
rdoc.title = "rubyXL #{version}"
|
45
|
+
rdoc.rdoc_files.include('README*')
|
46
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
47
|
+
end
|
48
|
+
|
49
|
+
desc "Dump profiling data with stackprof"
|
50
|
+
task :stackprof do
|
51
|
+
require 'benchmark'
|
52
|
+
require 'stackprof'
|
53
|
+
|
54
|
+
$:.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
|
55
|
+
require './lib/rubyXL'
|
56
|
+
|
57
|
+
spreadsheets = Dir.glob(File.join("test", "input", "*.xls?")).sort!
|
58
|
+
|
59
|
+
spreadsheets.each { |input|
|
60
|
+
puts "<<<--- Profiling parsing of #{input}..."
|
61
|
+
doc = nil
|
62
|
+
StackProf.run(:mode => :cpu, :interval => 100,
|
63
|
+
:out => "tmp/stackprof-cpu-parse-#{File.basename(input)}.dump") {
|
64
|
+
doc = RubyXL::Parser.parse(input)
|
65
|
+
}
|
66
|
+
|
67
|
+
output = File.join("test", "output", File.basename(input))
|
68
|
+
puts "--->>> Profiling writing of #{output}..."
|
69
|
+
StackProf.run(:mode => :cpu, :interval => 100,
|
70
|
+
:out => "tmp/stackprof-cpu-write-#{File.basename(input)}.dump") {
|
71
|
+
doc.write(output)
|
72
|
+
}
|
73
|
+
}
|
74
|
+
end
|
75
|
+
|
76
|
+
desc "Dump profiling data with ruby-prof"
|
77
|
+
task :rubyprof do
|
78
|
+
require 'benchmark'
|
79
|
+
require 'ruby-prof'
|
80
|
+
|
81
|
+
$:.unshift File.dirname(__FILE__) + '/lib' # Make Ruby aware of load path
|
82
|
+
require './lib/rubyXL'
|
83
|
+
|
84
|
+
spreadsheets = Dir.glob(File.join("test", "input", "*.xls?")).sort!
|
85
|
+
|
86
|
+
spreadsheets.each { |input|
|
87
|
+
puts "<<<--- Profiling parsing of #{input}..."
|
88
|
+
doc = nil
|
89
|
+
result = RubyProf.profile {
|
90
|
+
doc = RubyXL::Parser.parse(input)
|
91
|
+
}
|
92
|
+
printer = RubyProf::CallStackPrinter.new(result)
|
93
|
+
File.open("tmp/ruby-prof-parse-#{File.basename(input)}.html", 'w') { |f| printer.print(f, {}) }
|
94
|
+
|
95
|
+
output = File.join("test", "output", File.basename(input))
|
96
|
+
puts "--->>> Profiling writing of #{output}..."
|
97
|
+
result = RubyProf.profile {
|
98
|
+
doc.write(output)
|
99
|
+
}
|
100
|
+
printer = RubyProf::CallStackPrinter.new(result)
|
101
|
+
File.open("tmp/ruby-prof-write-#{File.basename(input)}.html", 'w') { |f| printer.print(f, {}) }
|
102
|
+
}
|
103
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
3.3.27
|
data/lib/rubyXL.rb
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
require 'rubyXL/objects/root'
|
2
|
+
require 'rubyXL/parser'
|
3
|
+
|
4
|
+
module RubyXL
|
5
|
+
|
6
|
+
# Convert any path passed to absolute path (within the XLSX file).
|
7
|
+
def self.from_root(path)
|
8
|
+
return path unless path.absolute?
|
9
|
+
path.relative_path_from(OOXMLTopLevelObject::ROOT)
|
10
|
+
end
|
11
|
+
|
12
|
+
end
|
data/lib/rubyXL/cell.rb
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
module RubyXL
|
2
|
+
|
3
|
+
# http://msdn.microsoft.com/en-us/library/documentformat.openxml.spreadsheet.cellvalues(v=office.14).aspx
|
4
|
+
module DataType
|
5
|
+
SHARED_STRING = 's'
|
6
|
+
RAW_STRING = 'str'
|
7
|
+
INLINE_STRING = 'inlineStr'
|
8
|
+
ERROR = 'e'
|
9
|
+
BOOLEAN = 'b'
|
10
|
+
NUMBER = 'n'
|
11
|
+
DATE = 'd' # Only available in Office2010.
|
12
|
+
end
|
13
|
+
|
14
|
+
module LegacyCell
|
15
|
+
attr_accessor :formula, :worksheet
|
16
|
+
|
17
|
+
def workbook
|
18
|
+
@worksheet.workbook
|
19
|
+
end
|
20
|
+
|
21
|
+
private
|
22
|
+
|
23
|
+
def validate_workbook()
|
24
|
+
unless workbook.nil? || workbook.worksheets.nil?
|
25
|
+
workbook.worksheets.each { |sheet|
|
26
|
+
unless sheet.nil? || sheet.sheet_data.nil? || sheet.sheet_data[row].nil?
|
27
|
+
if sheet.sheet_data[row][column] == self
|
28
|
+
return
|
29
|
+
end
|
30
|
+
end
|
31
|
+
}
|
32
|
+
end
|
33
|
+
raise "This cell #{self} is not in workbook #{workbook}"
|
34
|
+
end
|
35
|
+
|
36
|
+
def validate_worksheet()
|
37
|
+
return if @worksheet && @worksheet[row] && @worksheet[row][column].equal?(self)
|
38
|
+
raise "Cell #{self} is not in worksheet #{worksheet}"
|
39
|
+
end
|
40
|
+
|
41
|
+
def get_cell_xf
|
42
|
+
workbook.cell_xfs[self.style_index || 0]
|
43
|
+
end
|
44
|
+
|
45
|
+
def get_cell_font
|
46
|
+
workbook.fonts[get_cell_xf.font_id]
|
47
|
+
end
|
48
|
+
|
49
|
+
def get_cell_border
|
50
|
+
workbook.borders[get_cell_xf.border_id]
|
51
|
+
end
|
52
|
+
|
53
|
+
end
|
54
|
+
end
|